summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/ContextShadow.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/ContextShadow.h')
-rw-r--r--WebCore/platform/graphics/ContextShadow.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/WebCore/platform/graphics/ContextShadow.h b/WebCore/platform/graphics/ContextShadow.h
index 26f0a36..8f14229 100644
--- a/WebCore/platform/graphics/ContextShadow.h
+++ b/WebCore/platform/graphics/ContextShadow.h
@@ -79,6 +79,7 @@ public:
ContextShadow();
ContextShadow(const Color&, float radius, const FloatSize& offset);
+ bool mustUseContextShadow(PlatformContext);
void clear();
// The pair beginShadowLayer and endShadowLayer creates a temporary image
@@ -106,27 +107,29 @@ public:
PlatformContext beginShadowLayer(PlatformContext, const FloatRect& layerArea);
void endShadowLayer(PlatformContext);
static void purgeScratchBuffer();
+ static TransformationMatrix getTransformationMatrixFromContext(PlatformContext);
+
+ void setShadowsIgnoreTransforms(bool enable) { m_shadowsIgnoreTransforms = enable; }
+ bool shadowsIgnoreTransforms() const { return m_shadowsIgnoreTransforms; }
#if PLATFORM(CAIRO)
void drawRectShadow(GraphicsContext* context, const IntRect& rect, const IntSize& topLeftRadius = IntSize(), const IntSize& topRightRadius = IntSize(), const IntSize& bottomLeftRadius = IntSize(), const IntSize& bottomRightRadius = IntSize());
#endif
-
#if PLATFORM(QT)
- QPointF offset() { return QPointF(m_offset.width(), m_offset.height()); }
+ QPointF offset() const { return QPointF(m_offset.width(), m_offset.height()); }
#endif
-
private:
- IntRect m_layerRect;
- PlatformImage m_layerImage;
- PlatformContext m_layerContext;
-
-#if PLATFORM(QT)
- // Used for reference when canvas scale(x,y) was called.
- FloatRect m_unscaledLayerRect;
-#endif
-
+ PlatformImage m_layerImage; // Buffer to where the temporary shadow will be drawn to.
+ PlatformContext m_layerContext; // Context used to paint the shadow to the layer image.
+ FloatRect m_sourceRect; // Sub-rect of m_layerImage that contains the shadow pixels.
+ FloatPoint m_layerOrigin; // Top-left corner of the (possibly clipped) bounding rect to draw the shadow to.
+ FloatPoint m_layerContextTranslation; // Translation to apply to m_layerContext for the shadow to be correctly clipped.
+ bool m_shadowsIgnoreTransforms;
+
+ void adjustBlurDistance(const PlatformContext);
void blurLayerImage(unsigned char*, const IntSize& imageSize, int stride);
- void calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect);
+ IntRect calculateLayerBoundingRect(const PlatformContext, const FloatRect& layerArea, const IntRect& clipRect);
+
#if PLATFORM(CAIRO)
void drawRectShadowWithoutTiling(PlatformContext context, const IntRect& shadowRect, const IntSize& topLeftRadius, const IntSize& topRightRadius, const IntSize& bottomLeftRadius, const IntSize& bottomRightRadius, float alpha);
#endif