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

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
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 914e000feedff6be8b423b1b2aa44a573e3a6bc2..c54939939c9af2dfe211d3b16797a9e5acd9552d 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -750,14 +750,12 @@ void Layer::PaintContentsToDisplayList(
const gfx::Rect& clip,
ContentLayerClient::PaintingControlSetting painting_control) {
TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_);
+ gfx::Rect invalidation =
+ gfx::IntersectRects(damaged_region_.bounds(), bounds());
sky 2015/04/23 16:29:00 Isn't bounds() in the parent coordinate space and
danakj 2015/04/23 16:34:09 Ah, yes, thanks. I wish they said so in their name
+ 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));
}

Powered by Google App Engine
This is Rietveld 408576698