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

Unified Diff: ui/compositor/paint_context.h

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/paint_context.h
diff --git a/ui/compositor/paint_context.h b/ui/compositor/paint_context.h
index d63f11f7852b44c328b0cef7f855a0c0b1eef8de..f50f4378cd0643a5e34c7450b947bea500cb5788 100644
--- a/ui/compositor/paint_context.h
+++ b/ui/compositor/paint_context.h
@@ -60,6 +60,11 @@ class COMPOSITOR_EXPORT PaintContext {
// invalid.
bool CanCheckInvalidated() const { return !invalidation_.IsEmpty(); }
+ // When true, if a thing is not invalidated it does not need to paint itself.
+ // When false, everything should provide an output when painting regardless of
+ // being invalidated in order to remain visible.
+ bool EarlyOutOfPaintingWhenNotInvalidated() const { return !!canvas_; }
sky 2015/04/23 16:29:00 Oy! The double negatives make this hard to parse (
danakj 2015/04/23 16:34:09 Good call :)
+
// When true, the |bounds| touches an invalidated area, so should be
// re-painted. When false, re-painting can be skipped. Bounds should be in
// the local space with offsets up to the painting root in the PaintContext.
@@ -86,6 +91,9 @@ class COMPOSITOR_EXPORT PaintContext {
friend class ClipTransformRecorder;
friend class CompositingRecorder;
friend class PaintRecorder;
+ // The Cache class also needs to access the DisplayItemList to append its
+ // cache contents.
+ friend class PaintCache;
PaintContext& operator=(const PaintContext& other) = delete;

Powered by Google App Engine
This is Rietveld 408576698