diff options
author | Mike Reed <reed@google.com> | 2014-07-08 12:36:44 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2014-07-08 15:05:38 -0400 |
commit | 1103b3255945d2eb2fa9c191e84e2270b343cca9 (patch) | |
tree | 3dd01f46c6a3479974410024250408950ad9859f /libs | |
parent | a3bf3e5c849bfb3bf0a74dcc06ef032355183c2e (diff) | |
download | frameworks_base-1103b3255945d2eb2fa9c191e84e2270b343cca9.zip frameworks_base-1103b3255945d2eb2fa9c191e84e2270b343cca9.tar.gz frameworks_base-1103b3255945d2eb2fa9c191e84e2270b343cca9.tar.bz2 |
SkBitmap::Config is deprecated, use SkColorType
Change-Id: Ic953741325607bf85598c097bb3ab648d4a08996
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DisplayListOp.h | 2 | ||||
-rw-r--r-- | libs/hwui/LayerRenderer.cpp | 10 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 10 | ||||
-rw-r--r-- | libs/hwui/TextureCache.cpp | 14 |
4 files changed, 18 insertions, 18 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h index 901c69e..75d52b4 100644 --- a/libs/hwui/DisplayListOp.h +++ b/libs/hwui/DisplayListOp.h @@ -732,7 +732,7 @@ public: deferInfo.mergeable = state.mMatrix.isSimple() && state.mMatrix.positiveScale() && !state.mClipSideFlags && OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode && - (mBitmap->config() != SkBitmap::kA8_Config); + (mBitmap->colorType() != kAlpha_8_SkColorType); } const SkBitmap* bitmap() { return mBitmap; } diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index 873baf5..a92ef94 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -383,20 +383,20 @@ bool LayerRenderer::copyLayer(RenderState& renderState, Layer* layer, SkBitmap* GLenum error = GL_NO_ERROR; bool status = false; - switch (bitmap->config()) { - case SkBitmap::kA8_Config: + switch (bitmap->colorType()) { + case kAlpha_8_SkColorType: format = GL_ALPHA; type = GL_UNSIGNED_BYTE; break; - case SkBitmap::kRGB_565_Config: + case kRGB_565_SkColorType: format = GL_RGB; type = GL_UNSIGNED_SHORT_5_6_5; break; - case SkBitmap::kARGB_4444_Config: + case kARGB_4444_SkColorType: format = GL_RGBA; type = GL_UNSIGNED_SHORT_4_4_4_4; break; - case SkBitmap::kARGB_8888_Config: + case kN32_SkColorType: default: format = GL_RGBA; type = GL_UNSIGNED_BYTE; diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 1bbcff1..c9f541b 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1957,7 +1957,7 @@ status_t OpenGLRenderer::drawBitmaps(const SkBitmap* bitmap, AssetAtlas::Entry* const float x = (int) floorf(bounds.left + 0.5f); const float y = (int) floorf(bounds.top + 0.5f); - if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) { + if (CC_UNLIKELY(bitmap->colorType() == kAlpha_8_SkColorType)) { drawAlpha8TextureMesh(x, y, x + bounds.getWidth(), y + bounds.getHeight(), texture->id, paint, &vertices[0].x, &vertices[0].u, GL_TRIANGLES, bitmapCount * 6, true, @@ -1986,7 +1986,7 @@ status_t OpenGLRenderer::drawBitmap(const SkBitmap* bitmap, float left, float to if (!texture) return DrawGlInfo::kStatusDone; const AutoTexture autoCleanup(texture); - if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) { + if (CC_UNLIKELY(bitmap->colorType() == kAlpha_8_SkColorType)) { drawAlphaBitmap(texture, left, top, paint); } else { drawTextureRect(left, top, right, bottom, texture, paint); @@ -2014,7 +2014,7 @@ status_t OpenGLRenderer::drawBitmap(const SkBitmap* bitmap, const SkMatrix& matr // to the vertex shader. The save/restore is a bit overkill. save(SkCanvas::kMatrix_SaveFlag); concatMatrix(matrix); - if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) { + if (CC_UNLIKELY(bitmap->colorType() == kAlpha_8_SkColorType)) { drawAlphaBitmap(texture, 0.0f, 0.0f, paint); } else { drawTextureRect(0.0f, 0.0f, bitmap->width(), bitmap->height(), texture, paint); @@ -2037,7 +2037,7 @@ status_t OpenGLRenderer::drawBitmapData(const SkBitmap* bitmap, float left, floa Texture* texture = mCaches.textureCache.getTransient(bitmap); const AutoTexture autoCleanup(texture); - if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) { + if (CC_UNLIKELY(bitmap->colorType() == kAlpha_8_SkColorType)) { drawAlphaBitmap(texture, left, top, paint); } else { drawTextureRect(left, top, right, bottom, texture, paint); @@ -2232,7 +2232,7 @@ status_t OpenGLRenderer::drawBitmap(const SkBitmap* bitmap, dstBottom = srcBottom - srcTop; } - if (CC_UNLIKELY(bitmap->config() == SkBitmap::kA8_Config)) { + if (CC_UNLIKELY(bitmap->colorType() == kAlpha_8_SkColorType)) { drawAlpha8TextureMesh(dstLeft, dstTop, dstRight, dstBottom, texture->id, paint, &mMeshVertices[0].x, &mMeshVertices[0].u, diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 9212d0a..ec9e30a 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -285,20 +285,20 @@ void TextureCache::generateTexture(const SkBitmap* bitmap, Texture* texture, boo Caches::getInstance().bindTexture(texture->id); - switch (bitmap->config()) { - case SkBitmap::kA8_Config: + switch (bitmap->colorType()) { + case kAlpha_8_SkColorType: glPixelStorei(GL_UNPACK_ALIGNMENT, 1); uploadToTexture(resize, GL_ALPHA, bitmap->rowBytesAsPixels(), bitmap->bytesPerPixel(), texture->width, texture->height, GL_UNSIGNED_BYTE, bitmap->getPixels()); texture->blend = true; break; - case SkBitmap::kRGB_565_Config: + case kRGB_565_SkColorType: glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel()); uploadToTexture(resize, GL_RGB, bitmap->rowBytesAsPixels(), bitmap->bytesPerPixel(), texture->width, texture->height, GL_UNSIGNED_SHORT_5_6_5, bitmap->getPixels()); texture->blend = false; break; - case SkBitmap::kARGB_8888_Config: + case kN32_SkColorType: glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel()); uploadToTexture(resize, GL_RGBA, bitmap->rowBytesAsPixels(), bitmap->bytesPerPixel(), texture->width, texture->height, GL_UNSIGNED_BYTE, bitmap->getPixels()); @@ -306,14 +306,14 @@ void TextureCache::generateTexture(const SkBitmap* bitmap, Texture* texture, boo // decoding happened texture->blend = !bitmap->isOpaque(); break; - case SkBitmap::kARGB_4444_Config: - case SkBitmap::kIndex8_Config: + case kARGB_4444_SkColorType: + case kIndex_8_SkColorType: glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel()); uploadLoFiTexture(resize, bitmap, texture->width, texture->height); texture->blend = !bitmap->isOpaque(); break; default: - ALOGW("Unsupported bitmap config: %d", bitmap->config()); + ALOGW("Unsupported bitmap colorType: %d", bitmap->colorType()); break; } |