Index: Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp |
=================================================================== |
--- Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp (revision 115490) |
+++ Source/WebCore/platform/graphics/chromium/TransparencyWin.cpp (working copy) |
@@ -210,11 +210,19 @@ |
// uses the variable: to determine how to translate things to account |
// for the offset of the layer. |
m_transformedSourceRect = m_sourceRect; |
- m_layerSize = IntSize(m_sourceRect.width(), m_sourceRect.height()); |
- } else { |
+ } else if (m_transformMode == KeepTransform && m_layerMode != TextComposite) { |
+ // FIXME: support clipping for other modes |
+ IntRect clippedSourceRect = m_sourceRect; |
+ SkRect clipBounds; |
+ if (m_destContext->platformContext()->canvas()->getClipBounds(&clipBounds)) { |
+ FloatRect clipRect(clipBounds.left(), clipBounds.top(), clipBounds.width(), clipBounds.height()); |
+ clippedSourceRect.intersect(enclosingIntRect(clipRect)); |
+ } |
+ m_transformedSourceRect = m_orgTransform.mapRect(clippedSourceRect); |
+ } else |
m_transformedSourceRect = m_orgTransform.mapRect(m_sourceRect); |
- m_layerSize = IntSize(m_transformedSourceRect.width(), m_transformedSourceRect.height()); |
- } |
+ |
+ m_layerSize = IntSize(m_transformedSourceRect.width(), m_transformedSourceRect.height()); |
} |
void TransparencyWin::setupLayer() |