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

Unified Diff: third_party/WebKit/Source/core/paint/RarePaintData.h

Issue 2802593004: Move RarePaintData to its own file (Closed)
Patch Set: Created 3 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: third_party/WebKit/Source/core/paint/RarePaintData.h
diff --git a/third_party/WebKit/Source/core/paint/RarePaintData.h b/third_party/WebKit/Source/core/paint/RarePaintData.h
new file mode 100644
index 0000000000000000000000000000000000000000..201dc2a67a2b8374eb25171d7ca234f440f4cf01
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/RarePaintData.h
@@ -0,0 +1,67 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef RarePaintData_h
+#define RarePaintData_h
+
+#include "core/CoreExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class PropertyTreeState;
+class ObjectPaintProperties;
+
+// This is for paint-related data on LayoutObject that is not needed on all
+// objects.
+// TODO(pdr): Store LayoutBoxModelObject's m_paintLayer in this structure.
+class CORE_EXPORT RarePaintData {
+ WTF_MAKE_NONCOPYABLE(RarePaintData);
+ USING_FAST_MALLOC(RarePaintData);
+
+ public:
+ RarePaintData();
+ ~RarePaintData();
+
+ ObjectPaintProperties* paintProperties() const {
+ return m_paintProperties.get();
+ }
+ ObjectPaintProperties& ensurePaintProperties();
+
+ PropertyTreeState* localBorderBoxProperties() const {
+ return m_localBorderBoxProperties.get();
+ }
+
+ void clearLocalBorderBoxProperties();
+ void setLocalBorderBoxProperties(PropertyTreeState&);
+ const PropertyTreeState* contentsProperties() const;
+
+ private:
+ // Holds references to the paint property nodes created by this object.
+ std::unique_ptr<ObjectPaintProperties> m_paintProperties;
+
+ // This is a complete set of property nodes that should be used as a
+ // starting point to paint a LayoutObject. This data is cached because some
+ // properties inherit from the containing block chain instead of the
+ // painting parent and cannot be derived in O(1) during the paint walk.
+ //
+ // For example: <div style='opacity: 0.3;'/>
+ // The div's local border box properties would have an opacity 0.3 effect
+ // node. Even though the div has no transform, its local border box
+ // properties would have a transform node that points to the div's
+ // ancestor transform space.
+ std::unique_ptr<PropertyTreeState> m_localBorderBoxProperties;
+
+ // This is the complete set of property nodes that can be used to paint the
+ // contents of this object. It is similar to m_localBorderBoxProperties but
+ // includes properties (e.g., overflow clip, scroll translation) that apply
+ // to contents. This cached value is derived from m_localBorderBoxProperties
+ // and m_paintProperties and should be invalidated when these change.
+ mutable std::unique_ptr<PropertyTreeState> m_contentsProperties;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp ('k') | third_party/WebKit/Source/core/paint/RarePaintData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698