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

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

Issue 1870793004: Move common logic between BoxReflectFilterOperation and FEBoxReflect into BoxReflection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-filter-outsets-2
Patch Set: merge with master Created 4 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/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 9b9a868d780442ed2da6679ec3893a8f95d2cf7f..8f606340fb102fe5fba67b19f2f46608a8e549a8 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -2647,23 +2647,23 @@ FilterOperations PaintLayer::computeFilterOperations(const ComputedStyle& style)
// TODO(jbroman): Incorporate the mask image.
const auto* reflectStyle = style.boxReflect();
FloatRect frameRect(toLayoutBox(layoutObject())->frameRect());
- ReflectionDirection direction = VerticalReflection;
+ BoxReflection::ReflectionDirection direction = BoxReflection::VerticalReflection;
float offset = 0;
switch (reflectStyle->direction()) {
case ReflectionAbove:
- direction = VerticalReflection;
+ direction = BoxReflection::VerticalReflection;
offset = -floatValueForLength(reflectStyle->offset(), frameRect.height());
break;
case ReflectionBelow:
- direction = VerticalReflection;
+ direction = BoxReflection::VerticalReflection;
offset = 2 * frameRect.height() + floatValueForLength(reflectStyle->offset(), frameRect.height());
break;
case ReflectionLeft:
- direction = HorizontalReflection;
+ direction = BoxReflection::HorizontalReflection;
offset = -floatValueForLength(reflectStyle->offset(), frameRect.width());
break;
case ReflectionRight:
- direction = HorizontalReflection;
+ direction = BoxReflection::HorizontalReflection;
offset = 2 * frameRect.width() + floatValueForLength(reflectStyle->offset(), frameRect.width());
break;
}
@@ -2674,9 +2674,10 @@ FilterOperations PaintLayer::computeFilterOperations(const ComputedStyle& style)
// SkLocalMatrixImageFilter, but simpler).
// The rect used here should match the one used in FilterPainter.
LayoutRect filterInputBounds = physicalBoundingBoxIncludingReflectionAndStackingChildren(LayoutPoint());
- offset -= 2 * (direction == VerticalReflection ? filterInputBounds.y() : filterInputBounds.x()).toFloat();
+ offset -= 2 * (direction == BoxReflection::VerticalReflection ? filterInputBounds.y() : filterInputBounds.x()).toFloat();
- filterOperations.operations().append(BoxReflectFilterOperation::create(direction, offset));
+ BoxReflection reflection(direction, offset);
+ filterOperations.operations().append(BoxReflectFilterOperation::create(reflection));
}
return computeFilterOperationsHandleReferenceFilters(filterOperations, style.effectiveZoom(), enclosingNode());
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/FilterEffectBuilder.cpp ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698