aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-14 20:48:05 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-14 20:48:05 +0000
commit69e64637925d51f746560b2da21c4b0a10eed48a (patch)
treeff8b3a6b74f73f4c42e177b411c9387938a35e7e
parent2ff20aba210e8cafafd4e98c51722a4f413ac518 (diff)
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
-rw-r--r--include/core/SkBitmap.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index b69234baa1..18c4679950 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)];