From 4bb235bf0c685558760b8ffb28b737aa47eee4f5 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Tue, 7 May 2013 19:19:24 +0000 Subject: [PATCH] revert 9043 git-svn-id: http://skia.googlecode.com/svn/trunk@9044 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/SkGpuDevice.cpp | 6 ++++++ src/gpu/SkGr.cpp | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 22f01f9..837ff8c 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1367,6 +1367,12 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, SkASSERT(bitmap.width() <= fContext->getMaxTextureSize() && bitmap.height() <= fContext->getMaxTextureSize()); + SkAutoLockPixels alp(bitmap, !bitmap.getTexture()); + if (!bitmap.getTexture() && !bitmap.readyToDraw()) { + SkDebugf("nothing to draw\n"); + return; + } + GrTexture* texture; SkAutoCachedTexture act(this, bitmap, ¶ms, &texture); if (NULL == texture) { diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 1a33034..d76a34a 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -24,7 +24,7 @@ static void build_compressed_data(void* buffer, const SkBitmap& bitmap) { SkASSERT(SkBitmap::kIndex8_Config == bitmap.config()); - SkAutoLockPixels alp(bitmap); + SkAutoLockPixels apl(bitmap); if (!bitmap.readyToDraw()) { SkDEBUGFAIL("bitmap not ready to draw!"); return; @@ -135,10 +135,6 @@ static GrTexture* sk_gr_create_bitmap_texture(GrContext* ctx, } } - SkAutoLockPixels alp(*bitmap); - if (!bitmap->readyToDraw()) { - return NULL; - } if (cache) { // This texture is likely to be used again so leave it in the cache GrCacheID cacheID; -- 2.7.4