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

Unified Diff: src/core/SkPaintPriv.cpp

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
Index: src/core/SkPaintPriv.cpp
diff --git a/src/core/SkPaintPriv.cpp b/src/core/SkPaintPriv.cpp
index c6957cd1cafe29ba19b76937a3d10999c7680927..c5422fa06bc359151b7e17e2a349f339b98c8508 100644
--- a/src/core/SkPaintPriv.cpp
+++ b/src/core/SkPaintPriv.cpp
@@ -9,6 +9,7 @@
#include "SkBitmap.h"
#include "SkColorFilter.h"
+#include "SkImage.h"
#include "SkPaint.h"
#include "SkShader.h"
@@ -49,3 +50,16 @@ bool isPaintOpaque(const SkPaint* paint, const SkBitmap* bmpReplacesShader) {
return isPaintOpaque(paint, contentType);
}
+
+bool isPaintOpaque(const SkPaint* paint, const SkImage* imageReplacesShader) {
+ SkPaintBitmapOpacity contentType;
+
+ if (!imageReplacesShader)
+ contentType = kNoBitmap_SkPaintBitmapOpacity;
+ else if (imageReplacesShader->isOpaque())
+ contentType = kOpaque_SkPaintBitmapOpacity;
+ else
+ contentType = kUnknown_SkPaintBitmapOpacity;
+
+ return isPaintOpaque(paint, contentType);
+}

Powered by Google App Engine
This is Rietveld 408576698