summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/skia
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/platform/graphics/skia
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_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')
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp21
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.cpp2
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.h6
4 files changed, 12 insertions, 19 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
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 6ef38f0..74d0c6e 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -977,7 +977,7 @@ void GraphicsContext::setPlatformFillPattern(Pattern* pattern)
platformContext()->setFillShader(pattern->platformPattern(getCTM()));
}
-void GraphicsContext::setPlatformShadow(const IntSize& size,
+void GraphicsContext::setPlatformShadow(const FloatSize& size,
float blurFloat,
const Color& color,
ColorSpace colorSpace)
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index e0d2840..6595f6b 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -222,7 +222,7 @@ void SkiaWinOutlineCache::removePathsForFont(HFONT hfont)
bool windowsCanHandleDrawTextShadow(WebCore::GraphicsContext *context)
{
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.h b/WebCore/platform/graphics/skia/SkiaFontWin.h
index 0bad30f..4c2bb32 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.h
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SkiaWinOutlineCache_h
-#define SkiaWinOutlineCache_h
+#ifndef SkiaFontWin_h
+#define SkiaFontWin_h
#include <windows.h>
#include <usp10.h>
@@ -90,4 +90,4 @@ bool paintSkiaText(GraphicsContext* graphicsContext,
} // namespace WebCore
-#endif // SkiaWinOutlineCache_h
+#endif // SkiaFontWin_h