summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
commit03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch)
tree52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
parentcd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff)
downloadqtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp')
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index eaa1d77b4..e0b52a318 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -79,11 +79,6 @@ public:
m_context3D->makeContextCurrent();
}
- virtual void flush()
- {
- m_context3D->flush();
- }
-
private:
GraphicsContext3D* m_context3D;
};
@@ -280,34 +275,33 @@ PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect
return getImageData<Premultiplied>(rect, context()->platformContext()->canvas(), m_size);
}
-template <Multiply multiplied>
-void putImageData(ByteArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint,
- SkCanvas* canvas, const IntSize& size)
+void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
{
+ SkCanvas* canvas = context()->platformContext()->canvas();
ASSERT(sourceRect.width() > 0);
ASSERT(sourceRect.height() > 0);
int originX = sourceRect.x();
int destX = destPoint.x() + sourceRect.x();
ASSERT(destX >= 0);
- ASSERT(destX < size.width());
+ ASSERT(destX < m_size.width());
ASSERT(originX >= 0);
ASSERT(originX < sourceRect.maxX());
int endX = destPoint.x() + sourceRect.maxX();
- ASSERT(endX <= size.width());
+ ASSERT(endX <= m_size.width());
int numColumns = endX - destX;
int originY = sourceRect.y();
int destY = destPoint.y() + sourceRect.y();
ASSERT(destY >= 0);
- ASSERT(destY < size.height());
+ ASSERT(destY < m_size.height());
ASSERT(originY >= 0);
ASSERT(originY < sourceRect.maxY());
int endY = destPoint.y() + sourceRect.maxY();
- ASSERT(endY <= size.height());
+ ASSERT(endY <= m_size.height());
int numRows = endY - destY;
unsigned srcBytesPerRow = 4 * sourceSize.width();
@@ -324,16 +318,6 @@ void putImageData(ByteArray*& source, const IntSize& sourceSize, const IntRect&
canvas->writePixels(srcBitmap, destX, destY, config8888);
}
-void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
-{
- putImageData<Unmultiplied>(source, sourceSize, sourceRect, destPoint, context()->platformContext()->canvas(), m_size);
-}
-
-void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
-{
- putImageData<Premultiplied>(source, sourceSize, sourceRect, destPoint, context()->platformContext()->canvas(), m_size);
-}
-
template <typename T>
static bool encodeImage(T& source, const String& mimeType, const double* quality, Vector<char>* output)
{