Modified: trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp (213521 => 213522)
--- trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp 2017-03-07 17:22:35 UTC (rev 213521)
+++ trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp 2017-03-07 17:33:45 UTC (rev 213522)
@@ -388,7 +388,7 @@
return edgeSize;
}
-IntRect ShadowBlur::calculateLayerBoundingRect(GraphicsContext& context, const FloatRect& shadowedRect, const IntRect& clipRect)
+IntSize ShadowBlur::calculateLayerBoundingRect(GraphicsContext& context, const FloatRect& shadowedRect, const IntRect& clipRect)
{
IntSize edgeSize = blurredEdgeSize();
@@ -418,7 +418,7 @@
if (!clipRect.contains(enclosingIntRect(layerRect))) {
// If we are totally outside the clip region, we aren't painting at all.
if (intersection(layerRect, clipRect).isEmpty())
- return IntRect();
+ return IntSize();
IntRect inflatedClip = clipRect;
// Pixels at the edges can be affected by pixels outside the buffer,
@@ -451,7 +451,7 @@
float translationY = -shadowedRect.y() + inflation.height() - fabsf(clippedOut.height());
m_layerContextTranslation = FloatSize(translationX, translationY);
- return enclosingIntRect(layerRect);
+ return expandedIntSize(layerRect.size());
}
void ShadowBlur::drawShadowBuffer(GraphicsContext& graphicsContext)
@@ -503,8 +503,8 @@
void ShadowBlur::drawRectShadow(GraphicsContext& graphicsContext, const FloatRoundedRect& shadowedRect)
{
- IntRect layerRect = calculateLayerBoundingRect(graphicsContext, shadowedRect.rect(), graphicsContext.clipBounds());
- if (layerRect.isEmpty())
+ IntSize layerSize = calculateLayerBoundingRect(graphicsContext, shadowedRect.rect(), graphicsContext.clipBounds());
+ if (layerSize.isEmpty())
return;
adjustBlurRadius(graphicsContext);
@@ -512,7 +512,7 @@
// drawRectShadowWithTiling does not work with rotations.
// https://bugs.webkit.org/show_bug.cgi?id=45042
if (!graphicsContext.getCTM().preservesAxisAlignment() || m_type != BlurShadow) {
- drawRectShadowWithoutTiling(graphicsContext, shadowedRect, layerRect);
+ drawRectShadowWithoutTiling(graphicsContext, shadowedRect, layerSize);
return;
}
@@ -522,7 +522,7 @@
if (templateSize.width() > rect.width() || templateSize.height() > rect.height()
|| (templateSize.width() * templateSize.height() > m_sourceRect.width() * m_sourceRect.height())) {
- drawRectShadowWithoutTiling(graphicsContext, shadowedRect, layerRect);
+ drawRectShadowWithoutTiling(graphicsContext, shadowedRect, layerSize);
return;
}
@@ -531,8 +531,8 @@
void ShadowBlur::drawInsetShadow(GraphicsContext& graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect)
{
- IntRect layerRect = calculateLayerBoundingRect(graphicsContext, rect, graphicsContext.clipBounds());
- if (layerRect.isEmpty())
+ IntSize layerSize = calculateLayerBoundingRect(graphicsContext, rect, graphicsContext.clipBounds());
+ if (layerSize.isEmpty())
return;
adjustBlurRadius(graphicsContext);
@@ -540,7 +540,7 @@
// drawInsetShadowWithTiling does not work with rotations.
// https://bugs.webkit.org/show_bug.cgi?id=45042
if (!graphicsContext.getCTM().preservesAxisAlignment() || m_type != BlurShadow) {
- drawInsetShadowWithoutTiling(graphicsContext, rect, holeRect, layerRect);
+ drawInsetShadowWithoutTiling(graphicsContext, rect, holeRect, layerSize);
return;
}
@@ -550,7 +550,7 @@
if (templateSize.width() > hRect.width() || templateSize.height() > hRect.height()
|| (templateSize.width() * templateSize.height() > hRect.width() * hRect.height())) {
- drawInsetShadowWithoutTiling(graphicsContext, rect, holeRect, layerRect);
+ drawInsetShadowWithoutTiling(graphicsContext, rect, holeRect, layerSize);
return;
}
@@ -557,9 +557,9 @@
drawInsetShadowWithTiling(graphicsContext, rect, holeRect, templateSize, edgeSize);
}
-void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext& graphicsContext, const FloatRoundedRect& shadowedRect, const IntRect& layerRect)
+void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext& graphicsContext, const FloatRoundedRect& shadowedRect, const IntSize& layerSize)
{
- m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size());
+ m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerSize);
if (!m_layerImage)
return;
@@ -584,7 +584,7 @@
shadowContext.fillPath(path);
}
- blurShadowBuffer(expandedIntSize(m_layerSize));
+ blurShadowBuffer(layerSize);
}
drawShadowBuffer(graphicsContext);
@@ -592,9 +592,9 @@
ScratchBuffer::singleton().scheduleScratchBufferPurge();
}
-void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext& graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntRect& layerRect)
+void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext& graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntSize& layerSize)
{
- m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size());
+ m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerSize);
if (!m_layerImage)
return;
@@ -625,7 +625,7 @@
shadowContext.setFillColor(Color::black);
shadowContext.fillPath(path);
- blurShadowBuffer(expandedIntSize(m_layerSize));
+ blurShadowBuffer(layerSize);
}
drawShadowBuffer(graphicsContext);
@@ -881,9 +881,9 @@
{
adjustBlurRadius(context);
- IntRect layerRect = calculateLayerBoundingRect(context, layerArea, context.clipBounds());
+ IntSize layerSize = calculateLayerBoundingRect(context, layerArea, context.clipBounds());
- if (layerRect.isEmpty())
+ if (layerSize.isEmpty())
return nullptr;
// We reset the scratch buffer values here, because the buffer will no longer contain
@@ -890,7 +890,7 @@
// data from any previous rectangle or inset shadows drawn via the tiling path.
auto& scratchBuffer = ScratchBuffer::singleton();
scratchBuffer.setCachedShadowValues(FloatSize(), Color::black, IntRect(), FloatRoundedRect::Radii(), m_layerSize);
- m_layerImage = scratchBuffer.getScratchBuffer(layerRect.size());
+ m_layerImage = scratchBuffer.getScratchBuffer(layerSize);
GraphicsContext& shadowContext = m_layerImage->context();
shadowContext.save();
Modified: trunk/Source/WebCore/platform/graphics/ShadowBlur.h (213521 => 213522)
--- trunk/Source/WebCore/platform/graphics/ShadowBlur.h 2017-03-07 17:22:35 UTC (rev 213521)
+++ trunk/Source/WebCore/platform/graphics/ShadowBlur.h 2017-03-07 17:33:45 UTC (rev 213522)
@@ -83,13 +83,13 @@
InnerShadow
};
- IntRect calculateLayerBoundingRect(GraphicsContext&, const FloatRect& layerArea, const IntRect& clipRect);
+ IntSize calculateLayerBoundingRect(GraphicsContext&, const FloatRect& layerArea, const IntRect& clipRect);
IntSize templateSize(const IntSize& blurredEdgeSize, const FloatRoundedRect::Radii&) const;
- void drawRectShadowWithoutTiling(GraphicsContext&, const FloatRoundedRect&, const IntRect& layerRect);
+ void drawRectShadowWithoutTiling(GraphicsContext&, const FloatRoundedRect&, const IntSize& layerSize);
void drawRectShadowWithTiling(GraphicsContext&, const FloatRoundedRect&, const IntSize& shadowTemplateSize, const IntSize& blurredEdgeSize);
- void drawInsetShadowWithoutTiling(GraphicsContext&, const FloatRect&, const FloatRoundedRect& holeRect, const IntRect& layerRect);
+ void drawInsetShadowWithoutTiling(GraphicsContext&, const FloatRect&, const FloatRoundedRect& holeRect, const IntSize& layerSize);
void drawInsetShadowWithTiling(GraphicsContext&, const FloatRect&, const FloatRoundedRect& holeRect, const IntSize& shadowTemplateSize, const IntSize& blurredEdgeSize);
void drawLayerPieces(GraphicsContext&, const FloatRect& shadowBounds, const FloatRoundedRect::Radii&, const IntSize& roundedRadius, const IntSize& templateSize, ShadowDirection);