diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-11-04 16:22:28 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-11-04 16:22:28 -0400 |
commit | 144ccd9c8dba05ffaa0ae598f9b70032050fc20e (patch) | |
tree | e63cbbd7d1297d293f0952904618b9ff63a981f1 /WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h | |
parent | f337498167288e7a10576e418b97d8d9afa223c8 (diff) | |
download | external_webkit-144ccd9c8dba05ffaa0ae598f9b70032050fc20e.zip external_webkit-144ccd9c8dba05ffaa0ae598f9b70032050fc20e.tar.gz external_webkit-144ccd9c8dba05ffaa0ae598f9b70032050fc20e.tar.bz2 |
Revert "Support partial invalidation of tiles based on webkit's inval rect."
This reverts commit fc92ca2409a95b539274985812d88016b6b84b7e.
Diffstat (limited to 'WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h')
-rw-r--r-- | WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h index 6bbb97a..1faa110 100644 --- a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h +++ b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h @@ -36,6 +36,42 @@ namespace WebCore { class BaseTile; +class PaintingInfo { +public: + PaintingInfo() : m_x(-1), m_y(-1), m_webview(0), m_picture(0) { } + PaintingInfo(int x, int y, GLWebViewState* webview) + : m_x(x) + , m_y(y) + , m_webview(webview) + , m_picture(0) + { + if(webview) + m_picture = webview->currentPictureCounter(); + } + bool operator==(const PaintingInfo& info) + { + return m_webview == info.m_webview + && m_x == info.m_x + && m_y == info.m_y + && m_picture == info.m_picture; + } + bool similar(const PaintingInfo& info) + { + return m_webview == info.m_webview + && m_x == info.m_x + && m_y == info.m_y; + } + void setPosition(int x, int y) { m_x = x; m_y = y; } + void setGLWebViewState(GLWebViewState* webview) { m_webview = webview; } + void setPictureUsed(unsigned int picture) { m_picture = picture; } + +private: + int m_x; + int m_y; + GLWebViewState* m_webview; + unsigned int m_picture; +}; + // DoubleBufferedTexture using a SkBitmap as backing mechanism class BackedDoubleBufferedTexture : public DoubleBufferedTexture { public: @@ -52,7 +88,7 @@ public: // updates the texture with current bitmap and releases (and if needed also // swaps) the texture. - void producerUpdate(TextureInfo* textureInfo); + void producerUpdate(BaseTile* painter, TextureInfo* textureInfo, PaintingInfo& info); // The level can be one of the following values: // * -1 for an unused texture. @@ -71,7 +107,11 @@ public: BaseTile* owner() { return m_owner; } // only used by the consumer thread SkCanvas* canvas() { return m_canvas; } // only used by the producer thread - // This is to be only used for debugging on the producer thread + // checks to see if the current readable texture equals the provided PaintingInfo + bool consumerTextureUpToDate(PaintingInfo& info); + // checks to see if the current readable texture is similar to the provided PaintingInfo + bool consumerTextureSimilar(PaintingInfo& info); + bool busy() { return m_busy; } private: @@ -80,13 +120,12 @@ private: int m_usedLevel; BaseTile* m_owner; - // This values signals that the texture is currently in use by the consumer. - // This allows us to prevent the owner of the texture from changing while the - // consumer is holding a lock on the texture. + //The following values are shared among threads and use m_varLock to stay synced + PaintingInfo m_paintingInfoA; + PaintingInfo m_paintingInfoB; bool m_busy; - // We mutex protect the reads/writes of m_busy to ensure that we are reading - // the most up-to-date value even across processors in an SMP system. - android::Mutex m_busyLock; + + android::Mutex m_varLock; }; } // namespace WebCore |