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

Unified Diff: include/core/SkImageInfo.h

Issue 870023002: Don't use SK_ASSERT in header. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move function to cpp Created 5 years, 11 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
« no previous file with comments | « no previous file | src/core/SkImageInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageInfo.h
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index 341ec143a2273e22fdc10fdf359c0098b326d114..c51fa4ff82804c138d5bf07a0d0fa1fc0cb6518b 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -93,22 +93,7 @@ enum SkColorType {
#endif
};
-static int SkColorTypeBytesPerPixel(SkColorType ct) {
- static const uint8_t gSize[] = {
- 0, // Unknown
- 1, // Alpha_8
- 2, // RGB_565
- 2, // ARGB_4444
- 4, // RGBA_8888
- 4, // BGRA_8888
- 1, // kIndex_8
- };
- SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1),
- size_mismatch_with_SkColorType_enum);
-
- SkASSERT((size_t)ct < SK_ARRAY_COUNT(gSize));
- return gSize[ct];
-}
+int SkColorTypeBytesPerPixel(SkColorType ct);
static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) {
return width * SkColorTypeBytesPerPixel(ct);
@@ -242,9 +227,7 @@ public:
return SkImageInfo::Make(fWidth, fHeight, newColorType, fAlphaType, fProfileType);
}
- int bytesPerPixel() const {
- return SkColorTypeBytesPerPixel(fColorType);
- }
+ SK_API int bytesPerPixel() const;
dshwang 2015/01/30 21:15:16 move this definition to cpp because SkColorTypeByt
uint64_t minRowBytes64() const {
return sk_64_mul(fWidth, this->bytesPerPixel());
« no previous file with comments | « no previous file | src/core/SkImageInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698