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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 2250663002: Add alphaType() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@special-image-alpha-type
Patch Set: Remove virtuals from SkImage, slight cleanup Created 4 years, 4 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/image/SkImage_Gpu.cpp ('k') | src/pdf/SkPDFBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index abdecb9794e077ce0ad2d7391860c00f037e8da6..358e91a0fa75473f5e6a65153cadefacb10096d5 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -78,6 +78,9 @@ public:
SkImageInfo onImageInfo() const override {
return fBitmap.info();
}
+ SkAlphaType onAlphaType() const override {
+ return fBitmap.alphaType();
+ }
bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY, CachingHint) const override;
bool onPeekPixels(SkPixmap*) const override;
@@ -94,7 +97,6 @@ public:
SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); }
- bool isOpaque() const override;
bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const override;
SkImage_Raster(const SkBitmap& bm, bool bitmapMayBeMutable = false)
@@ -360,10 +362,6 @@ const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* image) {
return ((const SkImage_Raster*)image)->getPixelRef();
}
-bool SkImage_Raster::isOpaque() const {
- return fBitmap.isOpaque();
-}
-
bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const {
if (kRO_LegacyBitmapMode == mode) {
// When we're a snapshot from a surface, our bitmap may not be marked immutable
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/pdf/SkPDFBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698