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

Unified Diff: src/core/SkImageGenerator.cpp

Issue 980903002: Option for SkCodec to treat dst as all zeroes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update SkBmpCodec to use new ZeroInitialized API. 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/SkSwizzler.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 aabe83e4f919945c923e065a61680ff6b0455b61..4c69fd2a0be34f344229cdc8743cd62188066786 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -16,8 +16,8 @@ bool SkImageGenerator::getInfo(SkImageInfo* info) {
}
SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels,
- size_t rowBytes, SkPMColor ctable[],
- int* ctableCount) {
+ size_t rowBytes, const Options* options,
+ SkPMColor ctable[], int* ctableCount) {
if (kUnknown_SkColorType == info.colorType()) {
return kInvalidConversion;
}
@@ -40,7 +40,12 @@ SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, vo
ctable = NULL;
}
- const Result result = this->onGetPixels(info, pixels, rowBytes, ctable, ctableCount);
+ // Default options.
+ Options optsStorage;
+ if (NULL == options) {
+ options = &optsStorage;
+ }
+ const Result result = this->onGetPixels(info, pixels, rowBytes, *options, ctable, ctableCount);
if ((kIncompleteInput == result || kSuccess == result) && ctableCount) {
SkASSERT(*ctableCount >= 0 && *ctableCount <= 256);
@@ -54,7 +59,7 @@ SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, vo
if (kIndex_8_SkColorType == info.colorType()) {
return kInvalidConversion;
}
- return this->getPixels(info, pixels, rowBytes, NULL, NULL);
+ return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL);
}
bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
@@ -119,7 +124,19 @@ bool SkImageGenerator::onGetInfo(SkImageInfo*) {
return false;
}
+#ifdef SK_SUPPORT_LEGACY_OPTIONLESS_GET_PIXELS
SkImageGenerator::Result SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t,
SkPMColor*, int*) {
return kUnimplemented;
}
+#endif
+
+SkImageGenerator::Result SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst,
+ size_t rb, const Options& options,
+ SkPMColor* colors, int* colorCount) {
+#ifdef SK_SUPPORT_LEGACY_OPTIONLESS_GET_PIXELS
+ return this->onGetPixels(info, dst, rb, colors, colorCount);
+#else
+ return kUnimplemented;
+#endif
+}
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698