Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: src/core/SkBitmap.cpp

Issue 170713006: installPixels returns true if null-pixels -- devolving to setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index b6c2e2f65ccd4dc8e4cd50e883c6586df94f0d1a..5b83b44a66375ff391090c4689c8f94400d6387c 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -503,6 +503,11 @@ bool SkBitmap::installPixels(const SkImageInfo& info, void* pixels, size_t rb,
return false;
}
+ // No pixels means just behave like setConfig()
+ if (NULL == pixels) {
+ return true;
+ }
+
SkPixelRef* pr = SkMallocPixelRef::NewWithProc(info, rb, NULL, pixels,
releaseProc, context);
if (!pr) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698