diff options
| author | Leon Scroggins III <scroggo@google.com> | 2013-12-03 15:06:30 -0500 |
|---|---|---|
| committer | Leon Scroggins III <scroggo@google.com> | 2013-12-03 15:23:11 -0500 |
| commit | 4b9a19a8f865970e0079f431c8c2c2a8e4333ae9 (patch) | |
| tree | 8133e88dfa631ab30311375f3751f7b7ff09e58b | |
| parent | 8af04d8b85183978aa6182c281325394bf47a593 (diff) | |
| download | frameworks_base-4b9a19a8f865970e0079f431c8c2c2a8e4333ae9.zip frameworks_base-4b9a19a8f865970e0079f431c8c2c2a8e4333ae9.tar.gz frameworks_base-4b9a19a8f865970e0079f431c8c2c2a8e4333ae9.tar.bz2 | |
Call SkBitmap::config() instead of ::getConfig()
getConfig() has been deprecated.
Change-Id: I32066256ab82ac4760c752c80856d1b56d291fae
| -rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 4 | ||||
| -rw-r--r-- | core/jni/android/graphics/Bitmap.cpp | 2 | ||||
| -rw-r--r-- | core/jni/android/graphics/BitmapFactory.cpp | 2 | ||||
| -rw-r--r-- | core/jni/android/graphics/NinePatchImpl.cpp | 2 | ||||
| -rw-r--r-- | core/jni/android/opengl/util.cpp | 8 | ||||
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 10 | ||||
| -rw-r--r-- | libs/hwui/TextureCache.cpp | 4 |
7 files changed, 16 insertions, 16 deletions
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 @@ status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets, 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 @@ status_t BootAnimation::initTexture(void* buffer, size_t len) 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 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject, 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 @@ public: 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 @@ static jint util_getInternalFormat(JNIEnv *env, jclass clazz, 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 @@ static jint util_getType(JNIEnv *env, jclass clazz, 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 @@ static jint util_texImage2D(JNIEnv *env, jclass clazz, 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 @@ static jint util_texSubImage2D(JNIEnv *env, jclass clazz, 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 @@ status_t OpenGLRenderer::drawBitmaps(SkBitmap* bitmap, AssetAtlas::Entry* entry, 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 @@ status_t OpenGLRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, SkP 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 @@ status_t OpenGLRenderer::drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* // 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 @@ status_t OpenGLRenderer::drawBitmapData(SkBitmap* bitmap, float left, float top, 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 @@ status_t OpenGLRenderer::drawBitmap(SkBitmap* bitmap, 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 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege 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 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege texture->blend = !bitmap->isOpaque(); break; default: - ALOGW("Unsupported bitmap config: %d", bitmap->getConfig()); + ALOGW("Unsupported bitmap config: %d", bitmap->config()); break; } |
