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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.h

Issue 1632263002: Calculate and track display item opaqueness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix print output and add some commentary Created 4 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: third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.h
index a2a9c1ddf6e02a9fdafa50ac560e6c9b63f7c035..3af2a3d6b4567abc2be4a79f77e1e941bc9f9bfc 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.h
@@ -6,6 +6,7 @@
#define DrawingDisplayItem_h
#include "platform/PlatformExport.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -25,12 +26,14 @@ public:
DrawingDisplayItem(const DisplayItemClient& client
, Type type
, PassRefPtr<const SkPicture> picture
+ , bool knownToBeOpaque = false
#if ENABLE(ASSERT)
, UnderInvalidationCheckingMode underInvalidationCheckingMode = CheckPicture
#endif
)
: DisplayItem(client, type, sizeof(*this))
, m_picture(picture && picture->approximateOpCount() ? picture : nullptr)
+ , m_knownToBeOpaque(knownToBeOpaque)
#if ENABLE(ASSERT)
, m_underInvalidationCheckingMode(underInvalidationCheckingMode)
#endif
@@ -44,6 +47,8 @@ public:
const SkPicture* picture() const { return m_picture.get(); }
+ bool knownToBeOpaque() const { ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); return m_knownToBeOpaque; }
+
#if ENABLE(ASSERT)
UnderInvalidationCheckingMode underInvalidationCheckingMode() const { return m_underInvalidationCheckingMode; }
bool equals(const DisplayItem& other) const final;
@@ -56,6 +61,10 @@ private:
RefPtr<const SkPicture> m_picture;
+ // True if there are no transparent areas. Only used for SlimmingPaintV2.
pdr. 2016/01/27 05:07:46 Jbroman, what do you think about this? It's very
jbroman 2016/01/27 16:04:27 Ugh, it probably costs us 4-8 bytes per due to poi
+ // TODO(pdr): It's messy, but we may want to move this to DisplayItem which has free bits.
+ const bool m_knownToBeOpaque;
+
#if ENABLE(ASSERT)
UnderInvalidationCheckingMode m_underInvalidationCheckingMode;
#endif

Powered by Google App Engine
This is Rietveld 408576698