aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmap.cpp
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-16 20:54:21 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-16 20:54:21 +0000
commit6e58cf36f0eba4b195726aa714d5487c91d06d04 (patch)
treeeeaf849a50be871f66a3567250222633871a4347 /src/core/SkBitmap.cpp
parent5a346a85027fc8aae5d836d951e455a22b3272d0 (diff)
restore old behavior of setPixels(): lockPixels after installPixels()
git-svn-id: http://skia.googlecode.com/svn/trunk@13468 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBitmap.cpp')
-rw-r--r--src/core/SkBitmap.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 3e53cd7635..151ab50290 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -511,6 +511,11 @@ bool SkBitmap::installPixels(const SkImageInfo& info, void* pixels, size_t rb,
}
this->setPixelRef(pr)->unref();
+
+ // since we're already allocated, we lockPixels right away
+ this->lockPixels();
+ SkASSERT(this->getPixels());
+ SkDEBUGCODE(this->validate();)
return true;
}