From 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 2 Jun 2011 12:07:03 +0100 Subject: Merge WebKit at r84325: Initial merge by git. Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b --- .../platform/graphics/chromium/PlatformCanvas.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp') diff --git a/Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp b/Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp index 29589f4..afaa6f7 100644 --- a/Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp +++ b/Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp @@ -34,7 +34,7 @@ #include "PlatformContextSkia.h" #include "SkColorPriv.h" #include "skia/ext/platform_canvas.h" -#elif PLATFORM(CG) +#elif USE(CG) #include #endif @@ -52,8 +52,8 @@ void PlatformCanvas::resize(const IntSize& size) { m_size = size; #if USE(SKIA) - m_skiaCanvas = new skia::PlatformCanvas(size.width(), size.height(), false); -#elif PLATFORM(CG) + m_skiaCanvas = skia::CreateBitmapCanvas(size.width(), size.height(), false); +#elif USE(CG) size_t bufferSize = size.width() * size.height() * 4; m_pixelData = adoptArrayPtr(new uint8_t[bufferSize]); memset(m_pixelData.get(), 0, bufferSize); @@ -73,8 +73,9 @@ PlatformCanvas::AutoLocker::AutoLocker(PlatformCanvas* canvas) m_pixels = static_cast(m_bitmap->getPixels()); } else m_bitmap = 0; -#elif PLATFORM(CG) - m_pixels = &canvas->m_pixelData[0]; +#elif USE(CG) + if (canvas->m_pixelData) + m_pixels = &canvas->m_pixelData[0]; #endif } @@ -86,16 +87,15 @@ PlatformCanvas::AutoLocker::~AutoLocker() #endif } -PlatformCanvas::Painter::Painter(PlatformCanvas* canvas) +PlatformCanvas::Painter::Painter(PlatformCanvas* canvas, PlatformCanvas::Painter::TextOption option) { #if USE(SKIA) m_skiaContext = adoptPtr(new PlatformContextSkia(canvas->m_skiaCanvas.get())); - // This is needed to get text to show up correctly. - m_skiaContext->setDrawingToImageBuffer(true); + m_skiaContext->setDrawingToImageBuffer(option == GrayscaleText); m_context = adoptPtr(new GraphicsContext(reinterpret_cast(m_skiaContext.get()))); -#elif PLATFORM(CG) +#elif USE(CG) m_colorSpace = CGColorSpaceCreateDeviceRGB(); size_t rowBytes = canvas->size().width() * 4; -- cgit v1.1