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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 406673003: Add the method isOpaque() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase master Created 6 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') | tests/ImageIsOpaqueTest.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 a1cd602a0733c91c782186338acaf191c28f2fea..a7e4e009e5c2fd2d9b3a1f58457e45b116fc5b6f 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -70,6 +70,8 @@ public:
SkShader::TileMode,
const SkMatrix* localMatrix) const SK_OVERRIDE;
+ virtual bool isOpaque() const SK_OVERRIDE;
+
SkImage_Raster(const SkBitmap& bm)
: INHERITED(bm.width(), bm.height())
, fBitmap(bm) {}
@@ -219,3 +221,7 @@ SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) {
return ((SkImage_Raster*)image)->getPixelRef();
}
+
+bool SkImage_Raster::isOpaque() const {
+ return fBitmap.isOpaque();
+}
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | tests/ImageIsOpaqueTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698