diff options
author | Kristian Monsen <kristianm@google.com> | 2010-06-28 16:42:48 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-07-02 10:29:56 +0100 |
commit | 06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch) | |
tree | 20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp | |
parent | 72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff) | |
download | external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2 |
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp')
-rw-r--r-- | WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp index e76ed7b..62e2f17 100644 --- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp +++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp @@ -38,11 +38,10 @@ namespace WebCore { bool GraphicsContext3D::getImageData(Image* image, - Vector<uint8_t>& outputVector, + unsigned int format, + unsigned int type, bool premultiplyAlpha, - bool* hasAlphaChannel, - AlphaOp* neededAlphaOp, - unsigned int* format) + Vector<uint8_t>& outputVector) { if (!image) return false; @@ -60,18 +59,12 @@ bool GraphicsContext3D::getImageData(Image* image, ASSERT(rowBytes == skiaImage->width() * 4); uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels()); outputVector.resize(rowBytes * height); - int size = rowBytes * height; - memcpy(outputVector.data(), pixels, size); - *hasAlphaChannel = true; + AlphaOp neededAlphaOp = kAlphaDoNothing; if (!premultiplyAlpha) // FIXME: must fetch the image data before the premultiplication step - *neededAlphaOp = kAlphaDoUnmultiply; - // Convert from BGRA to RGBA. FIXME: add GL_BGRA extension support - // to all underlying OpenGL implementations. - for (int i = 0; i < size; i += 4) - std::swap(outputVector[i], outputVector[i + 2]); - *format = RGBA; - return true; + neededAlphaOp = kAlphaDoUnmultiply; + return packPixels(pixels, kSourceFormatBGRA8, skiaImage->width(), height, + format, type, neededAlphaOp, outputVector.data()); } } // namespace WebCore |