aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-02 12:50:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-02 12:50:45 -0700
commit848250415eddc54075f7eb8795e8db79e749c6ab (patch)
treeeb60aea6e61c9b3a9e195ab3cfb01d571351f78b /src/lazy
parent00f30bdc9e34b013da54b4406f36556c5be8d041 (diff)
make allocPixels throw on failure
BUG=skia: R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/510423005
Diffstat (limited to 'src/lazy')
-rw-r--r--src/lazy/SkCachingPixelRef.cpp2
-rw-r--r--src/lazy/SkDiscardablePixelRef.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp
index 56431880c9..bd675324f1 100644
--- a/src/lazy/SkCachingPixelRef.cpp
+++ b/src/lazy/SkCachingPixelRef.cpp
@@ -46,7 +46,7 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
const SkImageInfo& info = this->info();
if (!SkBitmapCache::Find(this->getGenerationID(), info.fWidth, info.fHeight, &fLockedBitmap)) {
// Cache has been purged, must re-decode.
- if (!fLockedBitmap.allocPixels(info, fRowBytes)) {
+ if (!fLockedBitmap.tryAllocPixels(info, fRowBytes)) {
fErrorInDecoding = true;
return false;
}
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index a86c3deff4..ec8d5ea9af 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -110,7 +110,7 @@ bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst,
SkASSERT(info.colorType() != kUnknown_SkColorType);
if (dst->empty()) { // Use a normal pixelref.
- return dst->allocPixels();
+ return dst->tryAllocPixels();
}
SkAutoTUnref<SkDiscardablePixelRef> ref(
SkNEW_ARGS(SkDiscardablePixelRef,