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

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

Issue 2022563002: Remove display item scope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/core.gypi ('k') | third_party/WebKit/Source/core/paint/ScopeRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index e0e240983d0dd23e181d8f70cca7b65df7a9edb2..3dbc5a07f64fe080a0fd337c8bc36876c89ee14e 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -17,7 +17,6 @@
#include "core/paint/PaintInfo.h"
#include "core/paint/PaintLayer.h"
#include "core/paint/SVGClipPainter.h"
-#include "core/paint/ScopeRecorder.h"
#include "core/paint/ScrollRecorder.h"
#include "core/paint/ScrollableAreaPainter.h"
#include "core/paint/Transform3DRecorder.h"
@@ -27,6 +26,7 @@
#include "platform/graphics/paint/ClipPathRecorder.h"
#include "platform/graphics/paint/ClipRecorder.h"
#include "platform/graphics/paint/CompositingRecorder.h"
+#include "platform/graphics/paint/DisplayItemCacheSkipper.h"
#include "platform/graphics/paint/PaintChunkProperties.h"
#include "platform/graphics/paint/ScopedPaintChunkProperties.h"
#include "platform/graphics/paint/SubsequenceRecorder.h"
@@ -108,7 +108,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContentsAndReflectio
// Paint the reflection first if we have one.
if (m_paintLayer.reflectionInfo() && !RuntimeEnabledFeatures::cssBoxReflectFilterEnabled()) {
- ScopeRecorder scopeRecorder(context);
+ DisplayItemCacheSkipper skipper(context);
if (m_paintLayer.reflectionInfo()->paint(context, paintingInfo, localPaintFlags) == MayBeClippedByPaintDirtyRect)
result = MayBeClippedByPaintDirtyRect;
}
@@ -516,12 +516,12 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerWithTransform(Graphi
fragments.append(fragment);
}
- bool needsScope = fragments.size() > 1;
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (fragments.size() > 1)
+ cacheSkipper.emplace(context);
+
PaintResult result = FullyPainted;
for (const auto& fragment : fragments) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
Optional<LayerClipRecorder> clipRecorder;
if (parentLayer) {
ClipRect clipRectForFragment(ancestorBackgroundClipRect);
@@ -634,12 +634,11 @@ void PaintLayerPainter::paintOverflowControlsForFragments(const PaintLayerFragme
if (!scrollableArea)
return;
- bool needsScope = layerFragments.size() > 1;
- for (auto& fragment : layerFragments) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (layerFragments.size() > 1)
+ cacheSkipper.emplace(context);
+ for (auto& fragment : layerFragments) {
// We need to apply the same clips and transforms that
// paintFragmentWithPhase would have.
LayoutRect cullRect = fragment.backgroundRect.rect();
@@ -714,13 +713,12 @@ void PaintLayerPainter::paintBackgroundForFragments(const PaintLayerFragments& l
GraphicsContext& context, const LayoutRect& transparencyPaintDirtyRect,
const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags)
{
- bool needsScope = layerFragments.size() > 1;
- for (auto& fragment : layerFragments) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (layerFragments.size() > 1)
+ cacheSkipper.emplace(context);
+
+ for (auto& fragment : layerFragments)
paintFragmentWithPhase(PaintPhaseSelfBlockBackgroundOnly, fragment, context, fragment.backgroundRect, localPaintingInfo, paintFlags, HasNotClipped);
- }
}
void PaintLayerPainter::paintForegroundForFragments(const PaintLayerFragments& layerFragments,
@@ -755,53 +753,49 @@ void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase,
const PaintLayerFragments& layerFragments, GraphicsContext& context,
const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags, ClipState clipState)
{
- bool needsScope = layerFragments.size() > 1;
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (layerFragments.size() > 1)
+ cacheSkipper.emplace(context);
+
for (auto& fragment : layerFragments) {
- if (!fragment.foregroundRect.isEmpty()) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
+ if (!fragment.foregroundRect.isEmpty())
paintFragmentWithPhase(phase, fragment, context, fragment.foregroundRect, localPaintingInfo, paintFlags, clipState);
- }
}
}
void PaintLayerPainter::paintSelfOutlineForFragments(const PaintLayerFragments& layerFragments,
GraphicsContext& context, const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags)
{
- bool needsScope = layerFragments.size() > 1;
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (layerFragments.size() > 1)
+ cacheSkipper.emplace(context);
+
for (auto& fragment : layerFragments) {
- if (!fragment.backgroundRect.isEmpty()) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
+ if (!fragment.backgroundRect.isEmpty())
paintFragmentWithPhase(PaintPhaseSelfOutlineOnly, fragment, context, fragment.backgroundRect, localPaintingInfo, paintFlags, HasNotClipped);
- }
}
}
void PaintLayerPainter::paintMaskForFragments(const PaintLayerFragments& layerFragments,
GraphicsContext& context, const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags)
{
- bool needsScope = layerFragments.size() > 1;
- for (auto& fragment : layerFragments) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (layerFragments.size() > 1)
+ cacheSkipper.emplace(context);
+
+ for (auto& fragment : layerFragments)
paintFragmentWithPhase(PaintPhaseMask, fragment, context, fragment.backgroundRect, localPaintingInfo, paintFlags, HasNotClipped);
- }
}
void PaintLayerPainter::paintChildClippingMaskForFragments(const PaintLayerFragments& layerFragments,
GraphicsContext& context, const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags)
{
- bool needsScope = layerFragments.size() > 1;
- for (auto& fragment: layerFragments) {
- Optional<ScopeRecorder> scopeRecorder;
- if (needsScope)
- scopeRecorder.emplace(context);
+ Optional<DisplayItemCacheSkipper> cacheSkipper;
+ if (layerFragments.size() > 1)
+ cacheSkipper.emplace(context);
+
+ for (auto& fragment: layerFragments)
paintFragmentWithPhase(PaintPhaseClippingMask, fragment, context, fragment.foregroundRect, localPaintingInfo, paintFlags, HasNotClipped);
- }
}
void PaintLayerPainter::paintOverlayScrollbars(GraphicsContext& context, const LayoutRect& damageRect, const GlobalPaintFlags paintFlags)
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/paint/ScopeRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698