diff options
author | Derek Sollenberger <derek@android.com> | 2012-01-31 14:04:06 -0500 |
---|---|---|
committer | Derek Sollenberger <derek@android.com> | 2012-01-31 14:07:30 -0500 |
commit | 2857538e8cd8c752b06ee75dd039791a186455b3 (patch) | |
tree | 8cb2c1d6380b090cdbe9e17408323f64931ada26 /Source/WebCore/platform/graphics/android | |
parent | 0ab06914e1fb967121601f35b3e25065723d6d35 (diff) | |
download | external_webkit-2857538e8cd8c752b06ee75dd039791a186455b3.zip external_webkit-2857538e8cd8c752b06ee75dd039791a186455b3.tar.gz external_webkit-2857538e8cd8c752b06ee75dd039791a186455b3.tar.bz2 |
Skia API changes as a result of an update to the Skia library.
These changes are required to work with r3022 of Skia
Change-Id: I4d4a13bad9acc54934bbb46bdfc08ee424c7a33a
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
5 files changed, 8 insertions, 15 deletions
diff --git a/Source/WebCore/platform/graphics/android/GaneshContext.cpp b/Source/WebCore/platform/graphics/android/GaneshContext.cpp index 03e6eb7..e67bcd4 100644 --- a/Source/WebCore/platform/graphics/android/GaneshContext.cpp +++ b/Source/WebCore/platform/graphics/android/GaneshContext.cpp @@ -191,12 +191,7 @@ SkDevice* GaneshContext::getDeviceForBaseTileSurface(const TileRenderInfo& rende GrContext* grContext = getGrContext(); GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc); - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, - renderInfo.tileSize.width(), - renderInfo.tileSize.height()); - - m_baseTileDeviceSurface = new SkGpuDevice(grContext, bitmap, renderTarget); + m_baseTileDeviceSurface = new SkGpuDevice(grContext, renderTarget); renderTarget->unref(); XLOG("generated device %p", m_baseTileDeviceSurface); } @@ -262,11 +257,7 @@ SkDevice* GaneshContext::getDeviceForBaseTileFBO(const TileRenderInfo& renderInf GrContext* grContext = getGrContext(); GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc); - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, - TilesManager::tileWidth(), TilesManager::tileWidth()); - - m_baseTileDeviceFBO = new SkGpuDevice(grContext, bitmap, renderTarget); + m_baseTileDeviceFBO = new SkGpuDevice(grContext, renderTarget); renderTarget->unref(); XLOG("generated device %p", m_baseTileDeviceFBO); } diff --git a/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp b/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp index f4df33a..29acb2b 100644 --- a/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp +++ b/Source/WebCore/platform/graphics/android/GaneshRenderer.cpp @@ -117,7 +117,6 @@ void GaneshRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can // set the GPU device to the canvas canvas->setDevice(device); - canvas->setDeviceFactory(device->getDeviceFactory()); // invert canvas contents if (renderInfo.textureInfo->getSharedTextureMode() == EglImageMode) { diff --git a/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp b/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp index 691fbca..751a08f 100644 --- a/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp @@ -36,6 +36,7 @@ #include "SkBitmapRef.h" #include "SkCanvas.h" #include "SkColorPriv.h" +#include "SkData.h" #include "SkDevice.h" #include "SkImageEncoder.h" #include "SkStream.h" @@ -241,7 +242,9 @@ String ImageBuffer::toDataURL(const String&, const double*) const // Convert it into base64. Vector<char> pngEncodedData; - pngEncodedData.append(pngStream.getStream(), pngStream.getOffset()); + SkData* streamData = pngStream.copyToData(); + pngEncodedData.append((char*)streamData->data(), streamData->size()); + streamData->unref(); Vector<char> base64EncodedData; base64Encode(pngEncodedData, base64EncodedData); // Append with a \0 so that it's a valid string. diff --git a/Source/WebCore/platform/graphics/android/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/ImageTexture.cpp index 23e3899..577e7f0 100644 --- a/Source/WebCore/platform/graphics/android/ImageTexture.cpp +++ b/Source/WebCore/platform/graphics/android/ImageTexture.cpp @@ -126,7 +126,7 @@ SkBitmap* ImageTexture::convertBitmap(SkBitmap* bitmap) // Create a copy of the image img->setConfig(SkBitmap::kARGB_8888_Config, w, h); img->allocPixels(); - SkDevice* device = new SkDevice(NULL, *img, false); + SkDevice* device = new SkDevice(*img); SkCanvas canvas; canvas.setDevice(device); device->unref(); diff --git a/Source/WebCore/platform/graphics/android/RasterRenderer.cpp b/Source/WebCore/platform/graphics/android/RasterRenderer.cpp index 0c92de4..9991fbd 100644 --- a/Source/WebCore/platform/graphics/android/RasterRenderer.cpp +++ b/Source/WebCore/platform/graphics/android/RasterRenderer.cpp @@ -101,7 +101,7 @@ void RasterRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can g_bitmap->eraseARGB(255, 255, 255, 255); } - SkDevice* device = new SkDevice(NULL, *g_bitmap, false); + SkDevice* device = new SkDevice(*g_bitmap); if (renderInfo.measurePerf) { m_perfMon.stop(TAG_CREATE_BITMAP); |