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

Unified Diff: src/core/SkPaintPriv.h

Issue 1236023004: have canvas send discard instead of retain if the draw would overwrite everything (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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.h
diff --git a/src/core/SkPaintPriv.h b/src/core/SkPaintPriv.h
index d859132391c06c774c89ba0db546dca82a930366..708f861b70b77d46dab71bb006e811442e96cdee 100644
--- a/src/core/SkPaintPriv.h
+++ b/src/core/SkPaintPriv.h
@@ -16,13 +16,23 @@ class SkPaint;
class SkPaintPriv {
public:
+ enum ShaderOverrideOpacity {
+ kNone_ShaderOverrideOpacity, //!< there is no overriding shader (bitmap or image)
+ kOpaque_ShaderOverrideOpacity, //!< the overriding shader is opaque
+ kNotOpaque_ShaderOverrideOpacity, //!< the overriding shader may not be opaque
+ };
+
/**
* Returns true if drawing with this paint (or NULL) will ovewrite all affected pixels.
*
* Note: returns conservative true, meaning it may return false even though the paint might
* in fact overwrite its pixels.
*/
- static bool Overwrites(const SkPaint& paint);
+ static bool Overwrites(const SkPaint* paint, ShaderOverrideOpacity);
+
+ static bool Overwrites(const SkPaint& paint) {
+ return Overwrites(&paint, kNone_ShaderOverrideOpacity);
+ }
/**
* Returns true if drawing this bitmap with this paint (or NULL) will ovewrite all affected
« src/core/SkCanvas.cpp ('K') | « src/core/SkCanvas.cpp ('k') | src/core/SkPaintPriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698