Index: src/core/SkBitmap.cpp |
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp |
index 68874175cda195b6d6905cf12b1d538244b6ae60..e5cc0d7fcd7b627bcecf57d4bde26c0567c2ba80 100644 |
--- a/src/core/SkBitmap.cpp |
+++ b/src/core/SkBitmap.cpp |
@@ -202,7 +202,7 @@ |
return true; |
} |
-bool SkBitmap::setInfo(const SkImageInfo& origInfo, size_t rowBytes) { |
+bool SkBitmap::setConfig(const SkImageInfo& origInfo, size_t rowBytes) { |
SkImageInfo info = origInfo; |
if (!validate_alphaType(info.fColorType, info.fAlphaType, |
@@ -241,7 +241,8 @@ |
bool SkBitmap::setConfig(Config config, int width, int height, size_t rowBytes, |
SkAlphaType alphaType) { |
SkColorType ct = SkBitmapConfigToColorType(config); |
- return this->setInfo(SkImageInfo::Make(width, height, ct, alphaType), rowBytes); |
+ return this->setConfig(SkImageInfo::Make(width, height, ct, alphaType), |
+ rowBytes); |
} |
bool SkBitmap::setAlphaType(SkAlphaType alphaType) { |
@@ -418,7 +419,7 @@ |
if (kIndex_8_SkColorType == info.fColorType && NULL == ctable) { |
return reset_return_false(this); |
} |
- if (!this->setInfo(info)) { |
+ if (!this->setConfig(info)) { |
return reset_return_false(this); |
} |
@@ -443,7 +444,7 @@ |
bool SkBitmap::installPixels(const SkImageInfo& info, void* pixels, size_t rb, SkColorTable* ct, |
void (*releaseProc)(void* addr, void* context), void* context) { |
- if (!this->setInfo(info, rb)) { |
+ if (!this->setConfig(info, rb)) { |
this->reset(); |
return false; |
} |
@@ -883,8 +884,8 @@ |
SkPixelRef* pixelRef = fPixelRef->deepCopy(this->config(), &subset); |
if (pixelRef != NULL) { |
SkBitmap dst; |
- dst.setInfo(SkImageInfo::Make(subset.width(), subset.height(), |
- this->colorType(), this->alphaType())); |
+ dst.setConfig(SkImageInfo::Make(subset.width(), subset.height(), |
+ this->colorType(), this->alphaType())); |
dst.setIsVolatile(this->isVolatile()); |
dst.setPixelRef(pixelRef)->unref(); |
SkDEBUGCODE(dst.validate()); |
@@ -899,8 +900,8 @@ |
SkASSERT(static_cast<unsigned>(r.fTop) < static_cast<unsigned>(this->height())); |
SkBitmap dst; |
- dst.setInfo(SkImageInfo::Make(r.width(), r.height(), this->colorType(), this->alphaType()), |
- this->rowBytes()); |
+ dst.setConfig(SkImageInfo::Make(r.width(), r.height(), this->colorType(), this->alphaType()), |
+ this->rowBytes()); |
dst.setIsVolatile(this->isVolatile()); |
if (fPixelRef) { |
@@ -993,7 +994,7 @@ |
dstInfo.fColorType = dstColorType; |
SkBitmap tmpDst; |
- if (!tmpDst.setInfo(dstInfo)) { |
+ if (!tmpDst.setConfig(dstInfo)) { |
return false; |
} |
@@ -1101,13 +1102,13 @@ |
// Use the same rowBytes as the original. |
rowBytes = fRowBytes; |
} else { |
- // With the new config, an appropriate fRowBytes will be computed by setInfo. |
+ // With the new config, an appropriate fRowBytes will be computed by setConfig. |
rowBytes = 0; |
} |
SkImageInfo info = fInfo; |
info.fColorType = dstCT; |
- if (!dst->setInfo(info, rowBytes)) { |
+ if (!dst->setConfig(info, rowBytes)) { |
return false; |
} |
dst->setPixelRef(pixelRef, fPixelRefOrigin)->unref(); |
@@ -1217,7 +1218,7 @@ |
dstM.fRowBytes = SkAlign4(dstM.fBounds.width()); |
} else { |
NO_FILTER_CASE: |
- tmpBitmap.setInfo(SkImageInfo::MakeA8(this->width(), this->height()), srcM.fRowBytes); |
+ tmpBitmap.setConfig(SkImageInfo::MakeA8(this->width(), this->height()), srcM.fRowBytes); |
if (!tmpBitmap.allocPixels(allocator, NULL)) { |
// Allocation of pixels for alpha bitmap failed. |
SkDebugf("extractAlpha failed to allocate (%d,%d) alpha bitmap\n", |
@@ -1240,8 +1241,8 @@ |
} |
SkAutoMaskFreeImage dstCleanup(dstM.fImage); |
- tmpBitmap.setInfo(SkImageInfo::MakeA8(dstM.fBounds.width(), dstM.fBounds.height()), |
- dstM.fRowBytes); |
+ tmpBitmap.setConfig(SkImageInfo::MakeA8(dstM.fBounds.width(), dstM.fBounds.height()), |
+ dstM.fRowBytes); |
if (!tmpBitmap.allocPixels(allocator, NULL)) { |
// Allocation of pixels for alpha bitmap failed. |
SkDebugf("extractAlpha failed to allocate (%d,%d) alpha bitmap\n", |
@@ -1331,7 +1332,7 @@ |
SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewWithData(info, info.minRowBytes(), |
ctable.get(), data.get())); |
- bitmap->setInfo(pr->info()); |
+ bitmap->setConfig(pr->info()); |
bitmap->setPixelRef(pr, 0, 0); |
return true; |
} |
@@ -1355,7 +1356,7 @@ |
return; |
} |
- bool configIsValid = this->setInfo(info, rowBytes); |
+ bool configIsValid = this->setConfig(info, rowBytes); |
buffer.validate(configIsValid); |
int reftype = buffer.readInt(); |