diff options
author | Chris Craik <ccraik@google.com> | 2011-08-28 19:15:00 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2011-09-02 16:12:04 -0700 |
commit | 8ad3ab0e47f0d5039e89c1873c178f538ec1b0df (patch) | |
tree | 80f8455d94b5ae10753e35b4f6badeea5fb8e040 /Source/WebCore/platform/graphics/android/TiledPage.h | |
parent | e3edcfcfc731bd5051947d8c0a4b2685e7cae84d (diff) | |
download | external_webkit-8ad3ab0e47f0d5039e89c1873c178f538ec1b0df.zip external_webkit-8ad3ab0e47f0d5039e89c1873c178f538ec1b0df.tar.gz external_webkit-8ad3ab0e47f0d5039e89c1873c178f538ec1b0df.tar.bz2 |
Enable double buffering via base tiles
bug:2522049
allocate textures and tiles using the gldraw count when they were most recently
prepared
remaining issues:
-layers still flicker (presumably from texture stealing)
-layers aren't double buffered yet
Change-Id: Iccdf68326d7d476269d4e3a13903aaab249ee92d
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TiledPage.h')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TiledPage.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.h b/Source/WebCore/platform/graphics/android/TiledPage.h index 56a34f4..14306eb 100644 --- a/Source/WebCore/platform/graphics/android/TiledPage.h +++ b/Source/WebCore/platform/graphics/android/TiledPage.h @@ -52,8 +52,12 @@ class IntRect; class TiledPage : public TilePainter { public: enum PrepareBounds { - kExpandedBounds = 0, - kVisibleBounds = 1 + ExpandedBounds = 0, + VisibleBounds = 1 + }; + enum SwapMethod { + SwapWhateverIsReady = 0, + SwapWholePage = 1 }; TiledPage(int id, GLWebViewState* state); @@ -64,8 +68,12 @@ public: // prepare the page for display on the screen void prepare(bool goingDown, bool goingLeft, const SkIRect& tileBounds, PrepareBounds bounds); + void updateTileState(const SkIRect& tileBounds); + // check to see if the page is ready for display - bool ready(const SkIRect& tileBounds, float scale); + + // swap 'buffers' by swapping each modified texture + bool swapBuffersIfReady(const SkIRect& tileBounds, float scale, SwapMethod swap); // draw the page on the screen void draw(float transparency, const SkIRect& tileBounds); @@ -83,15 +91,13 @@ public: void setScale(float scale) { m_scale = scale; m_invScale = 1 / scale; } void invalidateRect(const IntRect& invalRect, const unsigned int pictureCount); - void setUsable(bool usable); + void discardTextures(); void updateBaseTileSize(); bool scrollingDown() { return m_scrollingDown; } SkIRect* expandedTileBounds() { return &m_expandedTileBounds; } private: - void updateTileState(const SkIRect& tileBounds); void prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y, const SkIRect& tileBounds); - void updateTileUsedLevel(const SkIRect& tileBounds, BaseTile& tile); BaseTile* getBaseTile(int x, int y) const; |