diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-11-05 12:07:58 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-11-05 12:36:23 -0400 |
commit | a1e806ed3b2d9e2727d08cc2a3958fce501f6f33 (patch) | |
tree | 080f1f338514bb7ee83fd8b41007b0f2d7cc689c /WebCore/platform/graphics/android/BaseTile.h | |
parent | 1e6843296fbdb863eaaaa99df71c7b333e7b7803 (diff) | |
download | external_webkit-a1e806ed3b2d9e2727d08cc2a3958fce501f6f33.zip external_webkit-a1e806ed3b2d9e2727d08cc2a3958fce501f6f33.tar.gz external_webkit-a1e806ed3b2d9e2727d08cc2a3958fce501f6f33.tar.bz2 |
Support partial invalidation of tiles based on webkit's inval rect.
This CL reverts the rollback of the original CL now that we have
fixed bug #3165953.
This reverts commit 144ccd9c8dba05ffaa0ae598f9b70032050fc20e.
Change-Id: Ibb5254f652ed95aa3b7b71bf24a2578c51e74a70
Diffstat (limited to 'WebCore/platform/graphics/android/BaseTile.h')
-rw-r--r-- | WebCore/platform/graphics/android/BaseTile.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/android/BaseTile.h b/WebCore/platform/graphics/android/BaseTile.h index 429d950..8870cbf 100644 --- a/WebCore/platform/graphics/android/BaseTile.h +++ b/WebCore/platform/graphics/android/BaseTile.h @@ -36,6 +36,7 @@ #include <EGL/egl.h> #include <EGL/eglext.h> #include <GLES2/gl2.h> +#include <utils/threads.h> namespace WebCore { @@ -69,12 +70,15 @@ public: void reserveTexture(); void removeTexture(); void setUsedLevel(int); - bool isBitmapReady(); + bool isTileReady(); void draw(float transparency, SkRect& rect); // the only thread-safe function called by the background thread void paintBitmap(); + void markAsDirty(const unsigned int pictureCount); + bool isDirty(); + float scale() const { return m_scale; } void setScale(float scale); @@ -89,9 +93,25 @@ private: int m_x; int m_y; - // these variables can be updated throughout the lifetime of the object + // The remaining variables can be updated throughout the lifetime of the object BackedDoubleBufferedTexture* m_texture; float m_scale; + // used to signal that the that the tile is out-of-date and needs to be redrawn + bool m_dirty; + // stores the id of the latest picture from webkit that caused this tile to + // become dirty. A tile is no longer dirty when it has been painted with a + // picture that is newer than this value. + unsigned int m_lastDirtyPicture; + // stores the id of the latest picture painted to the tile. If the id is 0 + // then we know that the picture has not yet been painted an there is nothing + // to display (dirty or otherwise). + unsigned int m_lastPaintedPicture; + + // This mutex serves two purposes. (1) It ensures that certain operations + // happen atomically and (2) it makes sure those operations are synchronized + // across all threads and cores. + android::Mutex m_atomicSync; + }; } // namespace WebCore |