Index: src/core/SkPaintPriv.cpp |
diff --git a/src/core/SkPaintPriv.cpp b/src/core/SkPaintPriv.cpp |
index a4a7327110ff930e48b7986bbe95b5ddf8206f0a..6725cb49befd4c191bda3b817d7a7eb82d0915ce 100644 |
--- a/src/core/SkPaintPriv.cpp |
+++ b/src/core/SkPaintPriv.cpp |
@@ -5,26 +5,19 @@ |
* found in the LICENSE file. |
*/ |
-#include "SkPaintPriv.h" |
- |
#include "SkBitmap.h" |
#include "SkColorFilter.h" |
+#include "SkPaintPriv.h" |
#include "SkImage.h" |
#include "SkPaint.h" |
#include "SkShader.h" |
-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 |
-}; |
- |
static bool changes_alpha(const SkPaint& paint) { |
SkColorFilter* cf = paint.getColorFilter(); |
return cf && !(cf->getFlags() & SkColorFilter::kAlphaUnchanged_Flag); |
} |
-static bool overwrites(const SkPaint* paint, ShaderOverrideOpacity overrideOpacity) { |
+bool SkPaintPriv::Overwrites(const SkPaint* paint, ShaderOverrideOpacity overrideOpacity) { |
if (!paint) { |
// No paint means we default to SRC_OVER, so we overwrite iff our shader-override |
// is opaque, or we don't have one. |
@@ -51,16 +44,12 @@ static bool overwrites(const SkPaint* paint, ShaderOverrideOpacity overrideOpaci |
return SkXfermode::IsOpaque(paint->getXfermode(), opacityType); |
} |
-bool SkPaintPriv::Overwrites(const SkPaint& paint) { |
- return overwrites(&paint, kNone_ShaderOverrideOpacity); |
-} |
- |
bool SkPaintPriv::Overwrites(const SkBitmap& bitmap, const SkPaint* paint) { |
- return overwrites(paint, bitmap.isOpaque() ? kOpaque_ShaderOverrideOpacity |
+ return Overwrites(paint, bitmap.isOpaque() ? kOpaque_ShaderOverrideOpacity |
: kNotOpaque_ShaderOverrideOpacity); |
} |
bool SkPaintPriv::Overwrites(const SkImage* image, const SkPaint* paint) { |
- return overwrites(paint, image->isOpaque() ? kOpaque_ShaderOverrideOpacity |
+ return Overwrites(paint, image->isOpaque() ? kOpaque_ShaderOverrideOpacity |
: kNotOpaque_ShaderOverrideOpacity); |
} |