summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/skia
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-13 16:23:25 +0100
committerBen Murdoch <benm@google.com>2011-05-16 11:35:02 +0100
commit65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch)
treef478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/platform/graphics/skia
parent47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff)
downloadexternal_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/platform/graphics/skia')
-rw-r--r--Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h2
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp9
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageSkia.cpp2
3 files changed, 8 insertions, 5 deletions
diff --git a/Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h b/Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
index 553f203..974f126 100644
--- a/Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
+++ b/Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
@@ -82,6 +82,8 @@ private:
explicit BitmapImageSingleFrameSkia(const SkBitmap&);
};
+FloatRect normalizeRect(const FloatRect&);
+
} // namespace WebCore
#endif // BitmapImageSingleFrameSkia_h
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index a9f6d3c..b65b5bd 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -114,11 +114,12 @@ void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, con
if (context->platformContext()->canAccelerate()) {
DrawingBuffer* sourceDrawingBuffer = m_data.m_platformContext.gpuCanvas()->drawingBuffer();
unsigned sourceTexture = static_cast<unsigned>(sourceDrawingBuffer->platformColorBuffer());
- FloatRect destRectFlipped(destRect);
- destRectFlipped.setY(destRect.y() + destRect.height());
- destRectFlipped.setHeight(-destRect.height());
+ FloatRect destRectNormalized(normalizeRect(destRect));
+ FloatRect srcRectFlipped(normalizeRect(srcRect));
+ srcRectFlipped.setY(m_size.height() - srcRect.y());
+ srcRectFlipped.setHeight(-srcRect.height());
context->platformContext()->prepareForHardwareDraw();
- context->platformContext()->gpuCanvas()->drawTexturedRect(sourceTexture, m_size, srcRect, destRectFlipped, styleColorSpace, op);
+ context->platformContext()->gpuCanvas()->drawTexturedRect(sourceTexture, m_size, srcRectFlipped, destRectNormalized, styleColorSpace, op);
return;
}
m_data.m_platformContext.syncSoftwareCanvas();
diff --git a/Source/WebCore/platform/graphics/skia/ImageSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageSkia.cpp
index c7fa6f4..91a4e4f 100644
--- a/Source/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -298,7 +298,7 @@ static void TransformDimensions(const SkMatrix& matrix, float srcWidth, float sr
}
// A helper method for translating negative width and height values.
-static FloatRect normalizeRect(const FloatRect& rect)
+FloatRect normalizeRect(const FloatRect& rect)
{
FloatRect norm = rect;
if (norm.width() < 0) {