aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-25 21:23:54 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-25 21:23:54 +0000
commit62b260557d0e9aa9c8a2c08968eddb63a989f3fc (patch)
tree68c0266d14bc5833bc39ad1cd083499b7dcd1726
parent6dd735a86c420068ac7b4a8b3d99e6eb7d779f34 (diff)
move kConfigCount out of Config enum, so we don't pullute type-checking
git-svn-id: http://skia.googlecode.com/svn/trunk@9759 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/core/SkBitmap.h8
-rw-r--r--src/core/SkBitmap.cpp1
2 files changed, 6 insertions, 3 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index ad18547980..0a26f0dfc6 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -59,8 +59,12 @@ public:
* i.e. you may be able to draw from one, but you cannot draw into one.
*/
kRLE_Index8_Config,
-
- kConfigCount
+ };
+
+ // do not add this to the Config enum, otherwise the compiler will let us
+ // pass this as a valid parameter for Config.
+ enum {
+ kConfigCount = kRLE_Index8_Config + 1
};
/**
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 383f0efaef..e308b88b42 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -662,7 +662,6 @@ SkColor SkBitmap::getColor(int x, int y) const {
return SkUnPreMultiply::PMColorToColor((*fColorTable)[dst]);
}
case kNo_Config:
- case kConfigCount:
SkASSERT(false);
return 0;
}