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

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

Issue 2279823002: Use LayoutSVGResourceClipper::resourceBoundingBox() in ClipPathClipper (Closed)
Patch Set: Rebase Created 4 years, 3 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/FilterPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/FilterPainter.cpp b/third_party/WebKit/Source/core/paint/FilterPainter.cpp
index bed244ef03ea4b14b3df647245fe11fa520d2bc3..a291a134834d43af6737002b2063a853a11c5616 100644
--- a/third_party/WebKit/Source/core/paint/FilterPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/FilterPainter.cpp
@@ -15,15 +15,12 @@
#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
#include "platform/graphics/paint/FilterDisplayItem.h"
#include "platform/graphics/paint/PaintController.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebCompositorSupport.h"
#include "wtf/PtrUtil.h"
#include <memory>
namespace blink {
-FilterPainter::FilterPainter(PaintLayer& layer, GraphicsContext& context, const LayoutPoint& offsetFromRoot, const ClipRect& clipRect, PaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags,
- LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed)
+FilterPainter::FilterPainter(PaintLayer& layer, GraphicsContext& context, const LayoutPoint& offsetFromRoot, const ClipRect& clipRect, PaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
: m_filterInProgress(false)
, m_context(context)
, m_layoutObject(layer.layoutObject())
@@ -35,18 +32,13 @@ FilterPainter::FilterPainter(PaintLayer& layer, GraphicsContext& context, const
if (!lastEffect)
return;
- ASSERT(layer.filterInfo());
+ DCHECK(layer.filterInfo());
lastEffect->determineFilterPrimitiveSubregion(MapRectForward);
sk_sp<SkImageFilter> imageFilter = SkiaImageFilterBuilder::build(lastEffect, ColorSpaceDeviceRGB);
if (!imageFilter)
return;
- if (!rootRelativeBoundsComputed) {
- rootRelativeBounds = layer.physicalBoundingBoxIncludingReflectionAndStackingChildren(offsetFromRoot);
- rootRelativeBoundsComputed = true;
- }
-
// We'll handle clipping to the dirty rect before filter rasterization.
// Filter processing will automatically expand the clip rect and the offscreen to accommodate any filter outsets.
// FIXME: It is incorrect to just clip to the damageRect here once multiple fragments are involved.
@@ -55,11 +47,11 @@ FilterPainter::FilterPainter(PaintLayer& layer, GraphicsContext& context, const
// done it above, and doing it later will defeat the outsets.
paintingInfo.clipToDirtyRect = false;
- if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius()) {
+ DCHECK(m_layoutObject);
+
+ if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius())
m_clipRecorder = wrapUnique(new LayerClipRecorder(context, *layer.layoutObject(), DisplayItem::kClipLayerFilter, clipRect, &paintingInfo, LayoutPoint(), paintFlags));
- }
- ASSERT(m_layoutObject);
if (!context.getPaintController().displayItemConstructionIsDisabled()) {
FilterOperations filterOperations(layer.computeFilterOperations(m_layoutObject->styleRef()));
CompositorFilterOperations compositorFilterOperations;
@@ -70,7 +62,7 @@ FilterPainter::FilterPainter(PaintLayer& layer, GraphicsContext& context, const
// the layer's filter. See crbug.com/502026.
if (compositorFilterOperations.isEmpty())
return;
- LayoutRect visualBounds(rootRelativeBounds);
+ LayoutRect visualBounds(layer.physicalBoundingBoxIncludingReflectionAndStackingChildren(offsetFromRoot));
if (layer.enclosingPaginationLayer()) {
// Filters are set up before pagination, so we need to make the bounding box visual on our own.
visualBounds.moveBy(-offsetFromRoot);
« no previous file with comments | « third_party/WebKit/Source/core/paint/FilterPainter.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698