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

Unified Diff: cc/debug/debug_rect_history.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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 | « cc/cc_unittests.isolate ('k') | cc/debug/invalidation_benchmark.h » ('j') | no next file with comments »
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..c257c60c5cf761a503ca96af1077c8ff3b702988 100644
--- a/cc/debug/debug_rect_history.cc
+++ b/cc/debug/debug_rect_history.cc
@@ -68,17 +68,21 @@ 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(
- DebugRect(PAINT_RECT_TYPE,
- MathUtil::MapEnclosingClippedRect(
- layer->screen_space_transform(), update_content_rect)));
+
+ for (Region::Iterator it(invalidation_region); it.has_rect(); it.next()) {
+ 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)));
+ }
}
for (unsigned i = 0; i < layer->children().size(); ++i)
@@ -163,10 +167,9 @@ void DebugRectHistory::SaveScreenSpaceRects(
}
void DebugRectHistory::SaveTouchEventHandlerRects(LayerImpl* layer) {
- LayerTreeHostCommon::CallFunctionForSubtree<LayerImpl>(
- layer,
- base::Bind(&DebugRectHistory::SaveTouchEventHandlerRectsCallback,
- base::Unretained(this)));
+ LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
+ SaveTouchEventHandlerRectsCallback(layer);
+ });
}
void DebugRectHistory::SaveTouchEventHandlerRectsCallback(LayerImpl* layer) {
@@ -183,10 +186,9 @@ void DebugRectHistory::SaveTouchEventHandlerRectsCallback(LayerImpl* layer) {
}
void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) {
- LayerTreeHostCommon::CallFunctionForSubtree<LayerImpl>(
- layer,
- base::Bind(&DebugRectHistory::SaveWheelEventHandlerRectsCallback,
- base::Unretained(this)));
+ LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
+ SaveWheelEventHandlerRectsCallback(layer);
+ });
}
void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) {
@@ -204,10 +206,9 @@ void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) {
}
void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) {
- LayerTreeHostCommon::CallFunctionForSubtree<LayerImpl>(
- layer,
- base::Bind(&DebugRectHistory::SaveScrollEventHandlerRectsCallback,
- base::Unretained(this)));
+ LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
+ SaveScrollEventHandlerRectsCallback(layer);
+ });
}
void DebugRectHistory::SaveScrollEventHandlerRectsCallback(LayerImpl* layer) {
@@ -225,10 +226,9 @@ void DebugRectHistory::SaveScrollEventHandlerRectsCallback(LayerImpl* layer) {
}
void DebugRectHistory::SaveNonFastScrollableRects(LayerImpl* layer) {
- LayerTreeHostCommon::CallFunctionForSubtree<LayerImpl>(
- layer,
- base::Bind(&DebugRectHistory::SaveNonFastScrollableRectsCallback,
- base::Unretained(this)));
+ LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
+ SaveNonFastScrollableRectsCallback(layer);
+ });
}
void DebugRectHistory::SaveNonFastScrollableRectsCallback(LayerImpl* layer) {
« no previous file with comments | « cc/cc_unittests.isolate ('k') | cc/debug/invalidation_benchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698