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

Unified Diff: include/core/SkBitmap.h

Issue 200853002: don't reference config() -- use colorType() instead (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkBitmap.h
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index b69234baa12a74ee2607a363fa84aa75cdafcc14..18c467995030208220e7ae33032aec8947531e7c 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)];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698