revert 9043
git-svn-id: http://skia.googlecode.com/svn/trunk@9044 2bbb7eff-a529-9590-31e7-b0007b416f81
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 @@
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) {