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

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

Issue 2844803007: Introduce FragmentData, and put ObjectPaintProperties into it. (Closed)
Patch Set: none 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/RarePaintData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/RarePaintData.cpp
diff --git a/third_party/WebKit/Source/core/paint/RarePaintData.cpp b/third_party/WebKit/Source/core/paint/RarePaintData.cpp
index 896be5123214fb527973d4f34edf7484b5f6e782..1a47a617fbc777bd3f79159a85b91ce936946fc1 100644
--- a/third_party/WebKit/Source/core/paint/RarePaintData.cpp
+++ b/third_party/WebKit/Source/core/paint/RarePaintData.cpp
@@ -4,7 +4,7 @@
#include "core/paint/RarePaintData.h"
-#include "core/paint/ObjectPaintProperties.h"
+#include "core/paint/FragmentData.h"
#include "core/paint/PaintLayer.h"
namespace blink {
@@ -17,14 +17,10 @@ void RarePaintData::SetLayer(std::unique_ptr<PaintLayer> layer) {
layer_ = std::move(layer);
};
-ObjectPaintProperties& RarePaintData::EnsurePaintProperties() {
- if (!paint_properties_)
- paint_properties_ = ObjectPaintProperties::Create();
- return *paint_properties_.get();
-}
-
-void RarePaintData::ClearPaintProperties() {
- paint_properties_.reset(nullptr);
+FragmentData& RarePaintData::EnsureFragment() {
+ if (!fragment_data_)
+ fragment_data_ = FragmentData::Create();
+ return *fragment_data_.get();
}
void RarePaintData::ClearLocalBorderBoxProperties() {
@@ -41,13 +37,15 @@ void RarePaintData::SetLocalBorderBoxProperties(PropertyTreeState& state) {
PropertyTreeState RarePaintData::ContentsProperties() const {
DCHECK(local_border_box_properties_);
PropertyTreeState contents(*local_border_box_properties_);
- if (paint_properties_) {
- if (paint_properties_->ScrollTranslation())
- contents.SetTransform(paint_properties_->ScrollTranslation());
- if (paint_properties_->OverflowClip())
- contents.SetClip(paint_properties_->OverflowClip());
- else if (paint_properties_->CssClip())
- contents.SetClip(paint_properties_->CssClip());
+ if (fragment_data_) {
+ if (auto* properties = fragment_data_->PaintProperties()) {
+ if (properties->ScrollTranslation())
+ contents.SetTransform(properties->ScrollTranslation());
+ if (properties->OverflowClip())
+ contents.SetClip(properties->OverflowClip());
+ else if (properties->CssClip())
+ contents.SetClip(properties->CssClip());
+ }
}
// TODO(chrishtr): cssClipFixedPosition needs to be handled somehow.
« no previous file with comments | « third_party/WebKit/Source/core/paint/RarePaintData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698