Merge "Call SkBitmap::config() instead of ::getConfig()"
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 0f610e9..8c2931f 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -123,7 +123,7 @@
glGenTextures(1, &texture->name);
glBindTexture(GL_TEXTURE_2D, texture->name);
- switch (bitmap.getConfig()) {
+ switch (bitmap.config()) {
case SkBitmap::kA8_Config:
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_ALPHA,
GL_UNSIGNED_BYTE, p);
@@ -181,7 +181,7 @@
if (tw < w) tw <<= 1;
if (th < h) th <<= 1;
- switch (bitmap.getConfig()) {
+ switch (bitmap.config()) {
case SkBitmap::kARGB_8888_Config:
if (tw != w || th != h) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tw, th, 0, GL_RGBA,
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index e3f90af..094129b 100644
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -543,7 +543,7 @@
p->writeInt32(bitmap->rowBytes());
p->writeInt32(density);
- if (bitmap->getConfig() == SkBitmap::kIndex8_Config) {
+ if (bitmap->config() == SkBitmap::kIndex8_Config) {
SkColorTable* ctable = bitmap->getColorTable();
if (ctable != NULL) {
int count = ctable->count();
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index da6219f..80bd3e2 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -157,7 +157,7 @@
virtual bool allocPixelRef(SkBitmap* bitmap, SkColorTable* ctable) {
// accounts for scale in final allocation, using eventual size and config
const int bytesPerPixel = SkBitmap::ComputeBytesPerPixel(
- configForScaledOutput(bitmap->getConfig()));
+ configForScaledOutput(bitmap->config()));
const int requestedSize = bytesPerPixel *
int(bitmap->width() * mScale + 0.5f) *
int(bitmap->height() * mScale + 0.5f);
diff --git a/core/jni/android/graphics/NinePatchImpl.cpp b/core/jni/android/graphics/NinePatchImpl.cpp
index 01e7e3e..d43c1be 100644
--- a/core/jni/android/graphics/NinePatchImpl.cpp
+++ b/core/jni/android/graphics/NinePatchImpl.cpp
@@ -38,7 +38,7 @@
#include <utils/Log.h>
static bool getColor(const SkBitmap& bitmap, int x, int y, SkColor* c) {
- switch (bitmap.getConfig()) {
+ switch (bitmap.config()) {
case SkBitmap::kARGB_8888_Config:
*c = SkUnPreMultiply::PMColorToColor(*bitmap.getAddr32(x, y));
break;
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index 9793b4f..4bb091d 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -632,7 +632,7 @@
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetIntField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
return getInternalFormat(config);
}
@@ -642,7 +642,7 @@
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetIntField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
return getType(config);
}
@@ -653,7 +653,7 @@
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetIntField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
if (internalformat < 0) {
internalformat = getInternalFormat(config);
}
@@ -702,7 +702,7 @@
SkBitmap const * nativeBitmap =
(SkBitmap const *)env->GetIntField(jbitmap, nativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
- SkBitmap::Config config = bitmap.getConfig();
+ SkBitmap::Config config = bitmap.config();
if (format < 0) {
format = getInternalFormat(config);
if (format == GL_PALETTE8_RGBA8_OES)
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index e256ec2..82c74da 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -2146,7 +2146,7 @@
const float x = (int) floorf(bounds.left + 0.5f);
const float y = (int) floorf(bounds.top + 0.5f);
- if (CC_UNLIKELY(bitmap->getConfig() == SkBitmap::kA8_Config)) {
+ if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) {
int color = paint != NULL ? paint->getColor() : 0;
drawAlpha8TextureMesh(x, y, x + bounds.getWidth(), y + bounds.getHeight(),
texture->id, paint != NULL, color, alpha, mode,
@@ -2177,7 +2177,7 @@
if (!texture) return DrawGlInfo::kStatusDone;
const AutoTexture autoCleanup(texture);
- if (CC_UNLIKELY(bitmap->getConfig() == SkBitmap::kA8_Config)) {
+ if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) {
drawAlphaBitmap(texture, left, top, paint);
} else {
drawTextureRect(left, top, right, bottom, texture, paint);
@@ -2204,7 +2204,7 @@
// to the vertex shader. The save/restore is a bit overkill.
save(SkCanvas::kMatrix_SaveFlag);
concatMatrix(matrix);
- if (CC_UNLIKELY(bitmap->getConfig() == SkBitmap::kA8_Config)) {
+ if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) {
drawAlphaBitmap(texture, 0.0f, 0.0f, paint);
} else {
drawTextureRect(0.0f, 0.0f, bitmap->width(), bitmap->height(), texture, paint);
@@ -2226,7 +2226,7 @@
Texture* texture = mCaches.textureCache.getTransient(bitmap);
const AutoTexture autoCleanup(texture);
- if (CC_UNLIKELY(bitmap->getConfig() == SkBitmap::kA8_Config)) {
+ if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) {
drawAlphaBitmap(texture, left, top, paint);
} else {
drawTextureRect(left, top, right, bottom, texture, paint);
@@ -2423,7 +2423,7 @@
dstBottom = srcBottom - srcTop;
}
- if (CC_UNLIKELY(bitmap->getConfig() == SkBitmap::kA8_Config)) {
+ if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) {
int color = paint ? paint->getColor() : 0;
drawAlpha8TextureMesh(dstLeft, dstTop, dstRight, dstBottom,
texture->id, paint != NULL, color, alpha, mode,
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index a56eb33..1d4af7f 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -237,7 +237,7 @@
Caches::getInstance().bindTexture(texture->id);
- switch (bitmap->getConfig()) {
+ switch (bitmap->config()) {
case SkBitmap::kA8_Config:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
uploadToTexture(resize, GL_ALPHA, bitmap->rowBytesAsPixels(),
@@ -265,7 +265,7 @@
texture->blend = !bitmap->isOpaque();
break;
default:
- ALOGW("Unsupported bitmap config: %d", bitmap->getConfig());
+ ALOGW("Unsupported bitmap config: %d", bitmap->config());
break;
}