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

Unified Diff: Source/platform/graphics/paint/CachedDisplayItem.h

Issue 847783003: New display item caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New method, supporting partial paint Created 5 years, 11 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: Source/platform/graphics/paint/CachedDisplayItem.h
diff --git a/Source/platform/graphics/paint/CachedDisplayItem.h b/Source/platform/graphics/paint/CachedDisplayItem.h
index c5d55359352059aa32400ec138328f8202bf3ab9..706235dc2fee9dedaaf657cc2bc0e13250bd2605 100644
--- a/Source/platform/graphics/paint/CachedDisplayItem.h
+++ b/Source/platform/graphics/paint/CachedDisplayItem.h
@@ -5,6 +5,7 @@
#ifndef CachedDisplayItem_h
#define CachedDisplayItem_h
+#include "platform/geometry/FloatRect.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "wtf/Assertions.h"
@@ -21,17 +22,34 @@ public:
return adoptPtr(new CachedDisplayItem(client, type));
}
+#ifndef NDEBUG
+ static PassOwnPtr<CachedDisplayItem> create(DisplayItemClient client, Type type, const FloatRect& bounds)
+ {
+ return adoptPtr(new CachedDisplayItem(client, type, bounds));
+ }
+#endif
+
virtual bool isCached() const { return true; }
private:
CachedDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { }
+#ifdef NDEBUG
// CachedDisplayItem is never replayed or appended to WebDisplayItemList.
- virtual void replay(GraphicsContext*) override final { ASSERT_NOT_REACHED(); }
- virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { ASSERT_NOT_REACHED(); }
+ virtual void replay(GraphicsContext*) final { ASSERT_NOT_REACHED(); }
+ virtual void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NOT_REACHED(); }
+#else
+ CachedDisplayItem(DisplayItemClient client, Type type, const FloatRect& bounds)
+ : DisplayItem(client, type)
+ , m_bounds(bounds) { }
+
+ // Generates red rectangle to indicate under-invalidation errors.
+ virtual void replay(GraphicsContext*) final;
+ virtual void appendToWebDisplayItemList(WebDisplayItemList*) const final;
-#ifndef NDEBUG
virtual const char* name() const override { return "Cached"; }
+
+ const FloatRect m_bounds;
#endif
};

Powered by Google App Engine
This is Rietveld 408576698