diff options
author | prashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 07:22:47 +0000 |
---|---|---|
committer | prashant.n@samsung.com <prashant.n@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 07:22:47 +0000 |
commit | 87fe8475ab1b747912f0fb322c1e6f1f159a5d60 (patch) | |
tree | 3f0fc014c079b4ebafde7149166bd2b7a19d5227 /cc/layers/tiled_layer.cc | |
parent | 53e6e2ad808d6588a41df026b0f375e9beeda939 (diff) | |
download | chromium_src-87fe8475ab1b747912f0fb322c1e6f1f159a5d60.zip chromium_src-87fe8475ab1b747912f0fb322c1e6f1f159a5d60.tar.gz chromium_src-87fe8475ab1b747912f0fb322c1e6f1f159a5d60.tar.bz2 |
Dirty rects always contain full tiles with delegated rendering.
Fix: Compute update_rect separately from original dirty rects and pass
them to update_rect_ as well as updating the contents.
BUG=316469
Review URL: https://codereview.chromium.org/85143002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/tiled_layer.cc')
-rw-r--r-- | cc/layers/tiled_layer.cc | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc index a650672..24baef5 100644 --- a/cc/layers/tiled_layer.cc +++ b/cc/layers/tiled_layer.cc @@ -334,8 +334,10 @@ bool TiledLayer::UpdateTiles(int left, return false; } - gfx::Rect paint_rect = - MarkTilesForUpdate(left, top, right, bottom, ignore_occlusions); + gfx::Rect update_rect; + gfx::Rect paint_rect; + MarkTilesForUpdate( + &update_rect, &paint_rect, left, top, right, bottom, ignore_occlusions); if (occlusion) occlusion->overdraw_metrics()->DidPaint(paint_rect); @@ -345,7 +347,7 @@ bool TiledLayer::UpdateTiles(int left, *updated = true; UpdateTileTextures( - paint_rect, left, top, right, bottom, queue, occlusion); + update_rect, paint_rect, left, top, right, bottom, queue, occlusion); return true; } @@ -422,12 +424,13 @@ bool TiledLayer::HaveTexturesForTiles(int left, return true; } -gfx::Rect TiledLayer::MarkTilesForUpdate(int left, - int top, - int right, - int bottom, - bool ignore_occlusions) { - gfx::Rect paint_rect; +void TiledLayer::MarkTilesForUpdate(gfx::Rect* update_rect, + gfx::Rect* paint_rect, + int left, + int top, + int right, + int bottom, + bool ignore_occlusions) { for (int j = top; j <= bottom; ++j) { for (int i = left; i <= right; ++i) { UpdatableTile* tile = TileAt(i, j); @@ -437,6 +440,10 @@ gfx::Rect TiledLayer::MarkTilesForUpdate(int left, continue; if (tile->occluded && !ignore_occlusions) continue; + + // Prepare update rect from original dirty rects. + update_rect->Union(tile->dirty_rect); + // TODO(reveman): Decide if partial update should be allowed based on cost // of update. https://bugs.webkit.org/show_bug.cgi?id=77376 if (tile->is_dirty() && @@ -455,14 +462,14 @@ gfx::Rect TiledLayer::MarkTilesForUpdate(int left, } } - paint_rect.Union(tile->dirty_rect); + paint_rect->Union(tile->dirty_rect); tile->MarkForUpdate(); } } - return paint_rect; } -void TiledLayer::UpdateTileTextures(gfx::Rect paint_rect, +void TiledLayer::UpdateTileTextures(gfx::Rect update_rect, + gfx::Rect paint_rect, int left, int top, int right, @@ -477,7 +484,7 @@ void TiledLayer::UpdateTileTextures(gfx::Rect paint_rect, float height_scale = paint_properties().bounds.height() / static_cast<float>(content_bounds().height()); - update_rect_ = gfx::ScaleRect(paint_rect, width_scale, height_scale); + update_rect_ = gfx::ScaleRect(update_rect, width_scale, height_scale); // Calling PrepareToUpdate() calls into WebKit to paint, which may have the // side effect of disabling compositing, which causes our reference to the |