aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkBitmap.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-12-18 12:48:16 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-18 12:48:16 -0800
commit68331cd92a6dd09fb7b70a93b1e3cbe22916ef67 (patch)
tree92d1283fd4718100c1ef8638608549c7b664a370 /include/core/SkBitmap.h
parent9e4ecdc9f86724dcce23dc7546e2f295b901407b (diff)
remove dead code behind SK_SUPPORT_LEGACY_ALLOCPIXELS_BOOL
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r--include/core/SkBitmap.h38
1 files changed, 12 insertions, 26 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 8ffa37953c..7b3cce5076 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -14,16 +14,6 @@
#include "SkPoint.h"
#include "SkRefCnt.h"
-#ifdef SK_SUPPORT_LEGACY_ALLOCPIXELS_BOOL
- #define SK_ALLOCPIXELS_RETURN_TYPE bool
- #define SK_ALLOCPIXELS_RETURN_TRUE return true
- #define SK_ALLOCPIXELS_RETURN_FAIL return false
-#else
- #define SK_ALLOCPIXELS_RETURN_TYPE void
- #define SK_ALLOCPIXELS_RETURN_TRUE return
- #define SK_ALLOCPIXELS_RETURN_FAIL sk_throw()
-#endif
-
struct SkMask;
struct SkIRect;
struct SkRect;
@@ -233,12 +223,10 @@ public:
*/
bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo&, SkPixelRefFactory*, SkColorTable*);
- SK_ALLOCPIXELS_RETURN_TYPE allocPixels(const SkImageInfo& info, SkPixelRefFactory* factory,
- SkColorTable* ctable) {
+ void allocPixels(const SkImageInfo& info, SkPixelRefFactory* factory, SkColorTable* ctable) {
if (!this->tryAllocPixels(info, factory, ctable)) {
- SK_ALLOCPIXELS_RETURN_FAIL;
+ sk_throw();
}
- SK_ALLOCPIXELS_RETURN_TRUE;
}
/**
@@ -251,19 +239,18 @@ public:
*/
bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info, size_t rowBytes);
- SK_ALLOCPIXELS_RETURN_TYPE allocPixels(const SkImageInfo& info, size_t rowBytes) {
+ void allocPixels(const SkImageInfo& info, size_t rowBytes) {
if (!this->tryAllocPixels(info, rowBytes)) {
- SK_ALLOCPIXELS_RETURN_FAIL;
+ sk_throw();
}
- SK_ALLOCPIXELS_RETURN_TRUE;
}
bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info) {
return this->tryAllocPixels(info, info.minRowBytes());
}
- SK_ALLOCPIXELS_RETURN_TYPE allocPixels(const SkImageInfo& info) {
- return this->allocPixels(info, info.minRowBytes());
+ void allocPixels(const SkImageInfo& info) {
+ this->allocPixels(info, info.minRowBytes());
}
bool SK_WARN_UNUSED_RESULT tryAllocN32Pixels(int width, int height, bool isOpaque = false) {
@@ -272,10 +259,10 @@ public:
return this->tryAllocPixels(info);
}
- SK_ALLOCPIXELS_RETURN_TYPE allocN32Pixels(int width, int height, bool isOpaque = false) {
+ void allocN32Pixels(int width, int height, bool isOpaque = false) {
SkImageInfo info = SkImageInfo::MakeN32(width, height,
isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
- return this->allocPixels(info);
+ this->allocPixels(info);
}
/**
@@ -354,8 +341,8 @@ public:
return this->tryAllocPixels(NULL, ctable);
}
- SK_ALLOCPIXELS_RETURN_TYPE allocPixels(SkColorTable* ctable = NULL) {
- return this->allocPixels(NULL, ctable);
+ void allocPixels(SkColorTable* ctable = NULL) {
+ this->allocPixels(NULL, ctable);
}
/** Use the specified Allocator to create the pixelref that manages the
@@ -378,11 +365,10 @@ public:
*/
bool SK_WARN_UNUSED_RESULT tryAllocPixels(Allocator* allocator, SkColorTable* ctable);
- SK_ALLOCPIXELS_RETURN_TYPE allocPixels(Allocator* allocator, SkColorTable* ctable) {
+ void allocPixels(Allocator* allocator, SkColorTable* ctable) {
if (!this->tryAllocPixels(allocator, ctable)) {
- SK_ALLOCPIXELS_RETURN_FAIL;
+ sk_throw();
}
- SK_ALLOCPIXELS_RETURN_TRUE;
}
/**