diff options
Diffstat (limited to 'WebCore/platform/graphics/skia/ImageSkia.cpp')
-rw-r--r-- | WebCore/platform/graphics/skia/ImageSkia.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp index 1ff87cc..aed289f 100644 --- a/WebCore/platform/graphics/skia/ImageSkia.cpp +++ b/WebCore/platform/graphics/skia/ImageSkia.cpp @@ -36,22 +36,20 @@ #include "ChromiumBridge.h" #include "FloatConversion.h" #include "FloatRect.h" +#include "GLES2Canvas.h" +#include "GLES2Context.h" #include "GraphicsContext.h" #include "Logging.h" #include "NativeImageSkia.h" #include "PlatformContextSkia.h" #include "PlatformString.h" -#include "SkiaUtils.h" +#include "SkPixelRef.h" #include "SkRect.h" #include "SkShader.h" +#include "SkiaUtils.h" #include "skia/ext/image_operations.h" #include "skia/ext/platform_canvas.h" -#if USE(GLES2_RENDERING) -#include "GLES2Canvas.h" -#include "GLES2Context.h" -#include "SkPixelRef.h" -#endif namespace WebCore { @@ -409,23 +407,21 @@ void Image::drawPattern(GraphicsContext* context, context->platformContext()->paintSkPaint(destRect, paint); } -#if USE(GLES2_RENDERING) static void drawBitmapGLES2(GraphicsContext* ctxt, NativeImageSkia* bitmap, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) { ctxt->platformContext()->prepareForHardwareDraw(); GLES2Canvas* gpuCanvas = ctxt->platformContext()->gpuCanvas(); - GLES2Texture* texture = gpuCanvas->getTexture(bitmap); + Texture* texture = gpuCanvas->getTexture(bitmap); if (!texture) { ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config); ASSERT(bitmap->rowBytes() == bitmap->width() * 4); - texture = gpuCanvas->createTexture(bitmap, GLES2Texture::BGRA8, bitmap->width(), bitmap->height()); + texture = gpuCanvas->createTexture(bitmap, Texture::BGRA8, bitmap->width(), bitmap->height()); SkAutoLockPixels lock(*bitmap); ASSERT(bitmap->getPixels()); texture->load(bitmap->getPixels()); } gpuCanvas->drawTexturedRect(texture, srcRect, dstRect, styleColorSpace, compositeOp); } -#endif // ================================================ // BitmapImage Class @@ -472,12 +468,11 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, if (normSrcRect.isEmpty() || normDstRect.isEmpty()) return; // Nothing to draw. -#if USE(GLES2_RENDERING) if (ctxt->platformContext()->useGPU()) { drawBitmapGLES2(ctxt, bm, normSrcRect, normDstRect, colorSpace, compositeOp); return; } -#endif + ctxt->platformContext()->prepareForSoftwareDraw(); paintSkBitmap(ctxt->platformContext(), @@ -501,12 +496,10 @@ void BitmapImageSingleFrameSkia::draw(GraphicsContext* ctxt, if (normSrcRect.isEmpty() || normDstRect.isEmpty()) return; // Nothing to draw. -#if USE(GLES2_RENDERING) if (ctxt->platformContext()->useGPU()) { drawBitmapGLES2(ctxt, &m_nativeImage, srcRect, dstRect, styleColorSpace, compositeOp); return; } -#endif ctxt->platformContext()->prepareForSoftwareDraw(); |