Permalink
Browse files

am 2857538: Skia API changes as a result of an update to the Skia lib…

…rary.

* commit '2857538e8cd8c752b06ee75dd039791a186455b3':
  Skia API changes as a result of an update to the Skia library.
  • Loading branch information...
2 parents 9d7bc9e + 2857538 commit 75a0da9a16b6d086bf9a90620160e32286630179 Derek Sollenberger committed with Android Git Automerger Feb 6, 2012
@@ -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);
}
@@ -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) {
@@ -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.
@@ -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();
@@ -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);
@@ -503,7 +503,7 @@ bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect,
// Make sure we have valid coordinates. We might not have valid coords
// if the zoom manager is still initializing. We will be redrawn
// once the correct scale is set
- if (!m_visibleRect.hasValidCoordinates())
+ if (!m_visibleRect.isFinite())
return false;
bool treesSwapped = false;
bool newTreeHasAnim = false;

0 comments on commit 75a0da9

Please sign in to comment.