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

Unified Diff: include/core/SkImageGenerator.h

Issue 1495693003: Index8 GPU and CPU raster support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: generate index8, n32 replaced by onGetColorType Created 5 years 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
Index: include/core/SkImageGenerator.h
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h
index 3d508ddfb1c7ec7f1ceb34b9a12d3ce3d50f6060..c9ae1376bcb96a36d41e922b339f997766041cf8 100644
--- a/include/core/SkImageGenerator.h
+++ b/include/core/SkImageGenerator.h
@@ -74,7 +74,12 @@ public:
/**
* Return the ImageInfo associated with this generator.
*/
- const SkImageInfo& getInfo() const { return fInfo; }
+ const SkImageInfo& getInfo() {
+ SkColorType colorType;
+ if ((colorType = onGetColorType()) != fInfo.colorType())
+ fInfo = fInfo.makeColorType(colorType);
+ return fInfo;
+ }
/**
* Decode into the given pixels, a block of memory of size at
@@ -199,10 +204,12 @@ protected:
return nullptr;
}
+ virtual SkColorType onGetColorType() { return fInfo.colorType(); }
aleksandar.stojiljkovic 2015/12/07 19:31:02 Does this look better? Implemented the chromium pa
+
bool tryGenerateBitmap(SkBitmap* bm, const SkImageInfo* optionalInfo, SkBitmap::Allocator*);
private:
- const SkImageInfo fInfo;
+ SkImageInfo fInfo;
const uint32_t fUniqueID;
// This is our default impl, which may be different on different platforms.
« no previous file with comments | « gyp/gpu.gypi ('k') | src/core/SkBitmapDevice.cpp » ('j') | src/core/SkImageCacherator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698