From 69e64637925d51f746560b2da21c4b0a10eed48a Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 14 Mar 2014 20:48:05 +0000 Subject: [PATCH] don't reference config() -- use colorType() instead BUG=skia: Review URL: https://codereview.chromium.org/200853002 git-svn-id: http://skia.googlecode.com/svn/trunk@13813 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkBitmap.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index b69234b..18c4679 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -471,7 +471,7 @@ public: */ bool readyToDraw() const { return this->getPixels() != NULL && - (this->config() != kIndex8_Config || NULL != fColorTable); + (this->colorType() != kIndex_8_SkColorType || NULL != fColorTable); } /** Returns the pixelRef's texture, or NULL @@ -890,28 +890,28 @@ private: inline uint32_t* SkBitmap::getAddr32(int x, int y) const { SkASSERT(fPixels); - SkASSERT(this->config() == kARGB_8888_Config); + SkASSERT(4 == this->bytesPerPixel()); SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)this->height()); return (uint32_t*)((char*)fPixels + y * fRowBytes + (x << 2)); } inline uint16_t* SkBitmap::getAddr16(int x, int y) const { SkASSERT(fPixels); - SkASSERT(this->config() == kRGB_565_Config || this->config() == kARGB_4444_Config); + SkASSERT(2 == this->bytesPerPixel()); SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)this->height()); return (uint16_t*)((char*)fPixels + y * fRowBytes + (x << 1)); } inline uint8_t* SkBitmap::getAddr8(int x, int y) const { SkASSERT(fPixels); - SkASSERT(this->config() == kA8_Config || this->config() == kIndex8_Config); + SkASSERT(1 == this->bytesPerPixel()); SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)this->height()); return (uint8_t*)fPixels + y * fRowBytes + x; } inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { SkASSERT(fPixels); - SkASSERT(this->config() == kIndex8_Config); + SkASSERT(kIndex_8_SkColorType == this->colorType()); SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)this->height()); SkASSERT(fColorTable); return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; -- 2.7.4