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

Unified Diff: src/core/SkImageGenerator.cpp

Issue 1017293002: guarded change to SkImageGenerator to make getInfo() const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/codec/SkCodec.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageGenerator.cpp
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
index 4c69fd2a0be34f344229cdc8743cd62188066786..27bc141d577c4cb03a7b44c1dc278800e46500de 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -7,13 +7,15 @@
#include "SkImageGenerator.h"
-bool SkImageGenerator::getInfo(SkImageInfo* info) {
- SkImageInfo dummy;
- if (NULL == info) {
- info = &dummy;
+#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO
+SkImageInfo SkImageGenerator::getInfo() {
+ SkImageInfo info;
+ if (!this->onGetInfo(&info)) {
+ info = SkImageInfo::MakeUnknown(0, 0);
}
- return this->onGetInfo(info);
+ return info;
}
+#endif
SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels,
size_t rowBytes, const Options* options,
@@ -120,9 +122,11 @@ SkData* SkImageGenerator::onRefEncodedData() {
return NULL;
}
+#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO
bool SkImageGenerator::onGetInfo(SkImageInfo*) {
return false;
}
+#endif
#ifdef SK_SUPPORT_LEGACY_OPTIONLESS_GET_PIXELS
SkImageGenerator::Result SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t,
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698