aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-01 12:51:34 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-01 12:51:34 +0000
commitd7aaf6034e519ea9b70649c1d344f2f24de90ccb (patch)
treed3ee4c9a59476d4fc95861b107de61369a591101 /src/core
parentbb5c46591c50d05418467cd1c4e927ceb85c2ba9 (diff)
Add Xfermode bench. Also clear before rendering in bench (rather than after).
Author: bsalomon@google.com Reviewed By: robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/13334011 git-svn-id: http://skia.googlecode.com/svn/trunk@8454 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkXfermode.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 6f22aa43a6..d1a0f7a76e 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -1107,19 +1107,25 @@ private:
typedef SkProcXfermode INHERITED;
};
-#ifdef SK_DEVELOPER
-void SkProcCoeffXfermode::toString(SkString* str) const {
- str->append("SkProcCoeffXfermode: ");
-
- const char *gModeStrings[kLastMode+1] = {
+const char* SkXfermode::ModeName(Mode mode) {
+ SkASSERT((unsigned) mode <= (unsigned)kLastMode);
+ const char* gModeStrings[] = {
"Clear", "Src", "Dst", "SrcOver", "DstOver", "SrcIn", "DstIn",
"SrcOut", "DstOut", "SrcATop", "DstATop", "Xor", "Plus",
"Modulate", "Screen", "Overlay", "Darken", "Lighten", "ColorDodge",
- "ColorBurn", "HardLight", "SoftLight", "Difference", "Exclusion"
+ "ColorBurn", "HardLight", "SoftLight", "Difference", "Exclusion",
+ "Multiply", "Hue", "Saturation", "Color", "Luminosity"
};
+ return gModeStrings[mode];
+ SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gModeStrings) == kLastMode + 1, mode_count);
+}
+
+#ifdef SK_DEVELOPER
+void SkProcCoeffXfermode::toString(SkString* str) const {
+ str->append("SkProcCoeffXfermode: ");
str->append("mode: ");
- str->append(gModeStrings[fMode]);
+ str->append(ModeName(fMode));
static const char* gCoeffStrings[kCoeffCount] = {
"Zero", "One", "SC", "ISC", "DC", "IDC", "SA", "ISA", "DA", "IDA"