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

Unified Diff: ui/compositor/layer.cc

Issue 1101783002: ui: Cache the output of View::OnPaint when the View isn't invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cache: . Created 5 years, 8 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 | « ui/compositor/compositor.gyp ('k') | ui/compositor/paint_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 914e000feedff6be8b423b1b2aa44a573e3a6bc2..2b6f9219c574b40c1bdd6d6e0742c0d47d0a1478 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -750,14 +750,13 @@ void Layer::PaintContentsToDisplayList(
const gfx::Rect& clip,
ContentLayerClient::PaintingControlSetting painting_control) {
TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_);
+ gfx::Rect local_bounds(bounds().size());
+ gfx::Rect invalidation(
+ gfx::IntersectRects(damaged_region_.bounds(), local_bounds));
+ DCHECK(clip.Contains(invalidation));
ClearDamagedRects();
if (!delegate_)
return;
- // TODO(danakj): Save the invalidation on the layer and pass that down
- // instead of the |clip| here. That will break everything until View
- // early-outs emit cached display items instead of nothing.
- gfx::Rect invalidation = clip;
- DCHECK(clip.Contains(invalidation));
delegate_->OnPaintLayer(
PaintContext(display_list, device_scale_factor_, clip, invalidation));
}
« no previous file with comments | « ui/compositor/compositor.gyp ('k') | ui/compositor/paint_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698