Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: cc/layers/tiled_layer.cc

Issue 85143002: Dirty rects always contain full tiles with delegated rendering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build break Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/tiled_layer.h ('k') | cc/test/fake_content_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/tiled_layer.cc
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index a65067203783563902edbc06ee677aabbad7f258..24baef526eb67025dbfc24e929aa7db4eb8709a5 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
« no previous file with comments | « cc/layers/tiled_layer.h ('k') | cc/test/fake_content_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698