Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
am 2857538: Skia API changes as a result of an update to the Skia lib…
Browse files Browse the repository at this point in the history
…rary.

* commit '2857538e8cd8c752b06ee75dd039791a186455b3':
  Skia API changes as a result of an update to the Skia library.
  • Loading branch information
Derek Sollenberger authored and Android Git Automerger committed Feb 6, 2012
2 parents 9d7bc9e + 2857538 commit 75a0da9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
13 changes: 2 additions & 11 deletions Source/WebCore/platform/graphics/android/GaneshContext.cpp
Expand Up @@ -191,12 +191,7 @@ SkDevice* GaneshContext::getDeviceForBaseTileSurface(const TileRenderInfo& rende
GrContext* grContext = getGrContext(); GrContext* grContext = getGrContext();
GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc); GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc);


SkBitmap bitmap; m_baseTileDeviceSurface = new SkGpuDevice(grContext, renderTarget);
bitmap.setConfig(SkBitmap::kARGB_8888_Config,
renderInfo.tileSize.width(),
renderInfo.tileSize.height());

m_baseTileDeviceSurface = new SkGpuDevice(grContext, bitmap, renderTarget);
renderTarget->unref(); renderTarget->unref();
XLOG("generated device %p", m_baseTileDeviceSurface); XLOG("generated device %p", m_baseTileDeviceSurface);
} }
Expand Down Expand Up @@ -262,11 +257,7 @@ SkDevice* GaneshContext::getDeviceForBaseTileFBO(const TileRenderInfo& renderInf
GrContext* grContext = getGrContext(); GrContext* grContext = getGrContext();
GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc); GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc);


SkBitmap bitmap; m_baseTileDeviceFBO = new SkGpuDevice(grContext, renderTarget);
bitmap.setConfig(SkBitmap::kARGB_8888_Config,
TilesManager::tileWidth(), TilesManager::tileWidth());

m_baseTileDeviceFBO = new SkGpuDevice(grContext, bitmap, renderTarget);
renderTarget->unref(); renderTarget->unref();
XLOG("generated device %p", m_baseTileDeviceFBO); XLOG("generated device %p", m_baseTileDeviceFBO);
} }
Expand Down
Expand Up @@ -117,7 +117,6 @@ void GaneshRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can


// set the GPU device to the canvas // set the GPU device to the canvas
canvas->setDevice(device); canvas->setDevice(device);
canvas->setDeviceFactory(device->getDeviceFactory());


// invert canvas contents // invert canvas contents
if (renderInfo.textureInfo->getSharedTextureMode() == EglImageMode) { if (renderInfo.textureInfo->getSharedTextureMode() == EglImageMode) {
Expand Down
Expand Up @@ -36,6 +36,7 @@
#include "SkBitmapRef.h" #include "SkBitmapRef.h"
#include "SkCanvas.h" #include "SkCanvas.h"
#include "SkColorPriv.h" #include "SkColorPriv.h"
#include "SkData.h"
#include "SkDevice.h" #include "SkDevice.h"
#include "SkImageEncoder.h" #include "SkImageEncoder.h"
#include "SkStream.h" #include "SkStream.h"
Expand Down Expand Up @@ -241,7 +242,9 @@ String ImageBuffer::toDataURL(const String&, const double*) const


// Convert it into base64. // Convert it into base64.
Vector<char> pngEncodedData; 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; Vector<char> base64EncodedData;
base64Encode(pngEncodedData, base64EncodedData); base64Encode(pngEncodedData, base64EncodedData);
// Append with a \0 so that it's a valid string. // Append with a \0 so that it's a valid string.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/android/ImageTexture.cpp
Expand Up @@ -126,7 +126,7 @@ SkBitmap* ImageTexture::convertBitmap(SkBitmap* bitmap)
// Create a copy of the image // Create a copy of the image
img->setConfig(SkBitmap::kARGB_8888_Config, w, h); img->setConfig(SkBitmap::kARGB_8888_Config, w, h);
img->allocPixels(); img->allocPixels();
SkDevice* device = new SkDevice(NULL, *img, false); SkDevice* device = new SkDevice(*img);
SkCanvas canvas; SkCanvas canvas;
canvas.setDevice(device); canvas.setDevice(device);
device->unref(); device->unref();
Expand Down
Expand Up @@ -101,7 +101,7 @@ void RasterRenderer::setupCanvas(const TileRenderInfo& renderInfo, SkCanvas* can
g_bitmap->eraseARGB(255, 255, 255, 255); g_bitmap->eraseARGB(255, 255, 255, 255);
} }


SkDevice* device = new SkDevice(NULL, *g_bitmap, false); SkDevice* device = new SkDevice(*g_bitmap);


if (renderInfo.measurePerf) { if (renderInfo.measurePerf) {
m_perfMon.stop(TAG_CREATE_BITMAP); m_perfMon.stop(TAG_CREATE_BITMAP);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/android/nav/WebView.cpp
Expand Up @@ -503,7 +503,7 @@ bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect,
// Make sure we have valid coordinates. We might not have valid coords // Make sure we have valid coordinates. We might not have valid coords
// if the zoom manager is still initializing. We will be redrawn // if the zoom manager is still initializing. We will be redrawn
// once the correct scale is set // once the correct scale is set
if (!m_visibleRect.hasValidCoordinates()) if (!m_visibleRect.isFinite())
return false; return false;
bool treesSwapped = false; bool treesSwapped = false;
bool newTreeHasAnim = false; bool newTreeHasAnim = false;
Expand Down

0 comments on commit 75a0da9

Please sign in to comment.