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

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

Issue 1791543005: InPrePaint document state and PrePaintTreeWalk class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/PrePaintTreeWalk.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
similarity index 93%
rename from third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
rename to third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
index 224f99c3872452f09416b9b52931a5de571633fb..53ae041ab9eee125521b66b24528395974750399 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/paint/PaintPropertyTreeBuilder.h"
+#include "core/paint/PrePaintTreeWalk.h"
#include "core/frame/FrameView.h"
#include "core/layout/LayoutPart.h"
@@ -19,8 +19,8 @@ namespace blink {
// The walk will be done in the primary tree order (= DOM order), thus the context will also be
// responsible for bookkeeping tree state in other order, for example, the most recent position
// container seen.
-struct PaintPropertyTreeBuilderContext {
- PaintPropertyTreeBuilderContext()
+struct PrePaintTreeWalkContext {
+ PrePaintTreeWalkContext()
: currentTransform(nullptr)
, currentClip(nullptr)
, transformForAbsolutePosition(nullptr)
@@ -62,14 +62,14 @@ struct PaintPropertyTreeBuilderContext {
EffectPaintPropertyNode* currentEffect;
};
-void PaintPropertyTreeBuilder::buildPropertyTrees(FrameView& rootFrame)
+void PrePaintTreeWalk::buildPropertyTrees(FrameView& rootFrame)
{
- walk(rootFrame, PaintPropertyTreeBuilderContext());
+ walk(rootFrame, PrePaintTreeWalkContext());
}
-void PaintPropertyTreeBuilder::walk(FrameView& frameView, const PaintPropertyTreeBuilderContext& context)
+void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext& context)
{
- PaintPropertyTreeBuilderContext localContext(context);
+ PrePaintTreeWalkContext localContext(context);
// TODO(pdr): Creating paint properties for FrameView here will not be
// needed once settings()->rootLayerScrolls() is enabled.
@@ -100,7 +100,7 @@ void PaintPropertyTreeBuilder::walk(FrameView& frameView, const PaintPropertyTre
walk(*layoutView, localContext);
}
-static void deriveBorderBoxFromContainerContext(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static void deriveBorderBoxFromContainerContext(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
if (!object.isBoxModelObject())
return;
@@ -134,7 +134,7 @@ static void deriveBorderBoxFromContainerContext(const LayoutObject& object, Pain
context.paintOffset += toLayoutBox(boxModelObject).locationOffset();
}
-static PassRefPtr<TransformPaintPropertyNode> createPaintOffsetTranslationIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static PassRefPtr<TransformPaintPropertyNode> createPaintOffsetTranslationIfNeeded(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
bool shouldCreatePaintOffsetTranslationNode = false;
if (object.isSVGRoot()) {
@@ -167,7 +167,7 @@ static FloatPoint3D transformOrigin(const LayoutBox& box)
style.transformOriginZ());
}
-static PassRefPtr<TransformPaintPropertyNode> createTransformIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static PassRefPtr<TransformPaintPropertyNode> createTransformIfNeeded(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
if (object.isSVG() && !object.isSVGRoot()) {
const AffineTransform& transform = object.localToParentTransform();
@@ -196,7 +196,7 @@ static PassRefPtr<TransformPaintPropertyNode> createTransformIfNeeded(const Layo
return newTransformNodeForTransform.release();
}
-static PassRefPtr<EffectPaintPropertyNode> createEffectIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static PassRefPtr<EffectPaintPropertyNode> createEffectIfNeeded(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
const ComputedStyle& style = object.styleRef();
if (!style.hasOpacity())
@@ -206,7 +206,7 @@ static PassRefPtr<EffectPaintPropertyNode> createEffectIfNeeded(const LayoutObje
return newEffectNode.release();
}
-static PassRefPtr<ClipPaintPropertyNode> createOverflowClipIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static PassRefPtr<ClipPaintPropertyNode> createOverflowClipIfNeeded(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
if (!object.isBox())
return nullptr;
@@ -250,7 +250,7 @@ static FloatPoint perspectiveOrigin(const LayoutBox& box)
floatValueForLength(style.perspectiveOriginY(), borderBoxSize.height()));
}
-static PassRefPtr<TransformPaintPropertyNode> createPerspectiveIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static PassRefPtr<TransformPaintPropertyNode> createPerspectiveIfNeeded(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
const ComputedStyle& style = object.styleRef();
if (!object.isBox() || !style.hasPerspective())
@@ -263,7 +263,7 @@ static PassRefPtr<TransformPaintPropertyNode> createPerspectiveIfNeeded(const La
return newTransformNodeForPerspective.release();
}
-static PassRefPtr<TransformPaintPropertyNode> createScrollTranslationIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static PassRefPtr<TransformPaintPropertyNode> createScrollTranslationIfNeeded(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
if (!object.isBoxModelObject() || !object.hasOverflowClip())
return nullptr;
@@ -281,7 +281,7 @@ static PassRefPtr<TransformPaintPropertyNode> createScrollTranslationIfNeeded(co
return newTransformNodeForScrollTranslation.release();
}
-static void updateOutOfFlowContext(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
+static void updateOutOfFlowContext(const LayoutObject& object, PrePaintTreeWalkContext& context)
{
// At the html->svg boundary (see: createPaintOffsetTranslationIfNeeded) the currentTransform is
// up-to-date for all children of the svg root element. Additionally, inside SVG, all positioning
@@ -303,7 +303,7 @@ static void updateOutOfFlowContext(const LayoutObject& object, PaintPropertyTree
}
}
-static PassOwnPtr<ObjectPaintProperties::LocalBorderBoxProperties> recordTreeContextIfNeeded(LayoutObject& object, const PaintPropertyTreeBuilderContext& context)
+static PassOwnPtr<ObjectPaintProperties::LocalBorderBoxProperties> recordTreeContextIfNeeded(LayoutObject& object, const PrePaintTreeWalkContext& context)
{
// Note: Currently only layer painter makes use of the pre-computed context.
// This condition may be loosened with no adverse effects beside memory use.
@@ -318,9 +318,9 @@ static PassOwnPtr<ObjectPaintProperties::LocalBorderBoxProperties> recordTreeCon
return recordedContext.release();
}
-void PaintPropertyTreeBuilder::walk(LayoutObject& object, const PaintPropertyTreeBuilderContext& context)
+void PrePaintTreeWalk::walk(LayoutObject& object, const PrePaintTreeWalkContext& context)
{
- PaintPropertyTreeBuilderContext localContext(context);
+ PrePaintTreeWalkContext localContext(context);
deriveBorderBoxFromContainerContext(object, localContext);
RefPtr<TransformPaintPropertyNode> newTransformNodeForPaintOffsetTranslation = createPaintOffsetTranslationIfNeeded(object, localContext);

Powered by Google App Engine
This is Rietveld 408576698