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

Unified Diff: cc/debug/debug_rect_history.cc

Issue 958843004: Fix for 424682: Draw correct repaint regions instead of a conservative bounding box (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated PictureLayerImpl::GetInvalidationRegion to calculate intersection of invalidation_ and upda… Created 5 years, 10 months 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 | « no previous file | cc/layers/layer_impl.h » ('j') | cc/layers/picture_layer_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/debug_rect_history.cc
diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc
index cde7765383f33ba59dccd77278663f9257d3976e..2c77760e907d5e0dccc34a1491089832ba71e17b 100644
--- a/cc/debug/debug_rect_history.cc
+++ b/cc/debug/debug_rect_history.cc
@@ -68,17 +68,24 @@ void DebugRectHistory::SavePaintRects(LayerImpl* layer) {
// not. Therefore we traverse recursively over all layers, not just the render
// surface list.
- if (!layer->update_rect().IsEmpty() && layer->DrawsContent()) {
+ Region invalidation_region = layer->GetInvalidationRegion();
+ if (!invalidation_region.IsEmpty() && layer->DrawsContent()) {
float width_scale = layer->content_bounds().width() /
static_cast<float>(layer->bounds().width());
float height_scale = layer->content_bounds().height() /
static_cast<float>(layer->bounds().height());
- gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect(
- layer->update_rect(), width_scale, height_scale);
- debug_rects_.push_back(
+
+ for (Region::Iterator it(invalidation_region);
+ it.has_rect();
danakj 2015/03/02 20:10:53 this doesn't look like how git cl format would do
daplatz 2015/03/02 20:28:02 no i did not know about it. sweet.
+ it.next()) {
+
danakj 2015/03/02 20:10:53 nit: remove this whitespace
daplatz 2015/03/02 20:28:02 Acknowledged.
+ gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect(
+ it.rect(), width_scale, height_scale);
+ debug_rects_.push_back(
DebugRect(PAINT_RECT_TYPE,
- MathUtil::MapEnclosingClippedRect(
- layer->screen_space_transform(), update_content_rect)));
+ MathUtil::MapEnclosingClippedRect(
+ layer->screen_space_transform(), update_content_rect)));
+ }
}
for (unsigned i = 0; i < layer->children().size(); ++i)
« no previous file with comments | « no previous file | cc/layers/layer_impl.h » ('j') | cc/layers/picture_layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698