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

Unified Diff: third_party/ktx/ktx.cpp

Issue 340533002: hide SkBitmap::Config entirely (behind a flag) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « tests/KtxTest.cpp ('k') | tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ktx/ktx.cpp
diff --git a/third_party/ktx/ktx.cpp b/third_party/ktx/ktx.cpp
index 5eaadef3bddfeee9584ae7d4e8efcf971af32f99..a05498b7e80b27ee4fc1f19263910976258599a7 100644
--- a/third_party/ktx/ktx.cpp
+++ b/third_party/ktx/ktx.cpp
@@ -358,7 +358,7 @@ bool SkKTXFile::WriteETC1ToKTX(SkWStream* stream, const uint8_t *etc1Data,
}
bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
- const SkBitmap::Config config = bitmap.config();
+ const SkColorType ct = bitmap.colorType();
SkAutoLockPixels alp(bitmap);
const int width = bitmap.width();
@@ -379,17 +379,17 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
// Next, write the header based on the bitmap's config.
Header hdr;
- switch (config) {
- case SkBitmap::kIndex8_Config:
+ switch (ct) {
+ case kIndex_8_SkColorType:
// There is a compressed format for this, but we don't support it yet.
SkDebugf("Writing indexed bitmap to KTX unsupported.\n");
// VVV fall through VVV
default:
- case SkBitmap::kNo_Config:
+ case kUnknown_SkColorType:
// Bitmap hasn't been configured.
return false;
- case SkBitmap::kA8_Config:
+ case kAlpha_8_SkColorType:
hdr.fGLType = GR_GL_UNSIGNED_BYTE;
hdr.fGLTypeSize = 1;
hdr.fGLFormat = GR_GL_RED;
@@ -397,7 +397,7 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
hdr.fGLBaseInternalFormat = GR_GL_RED;
break;
- case SkBitmap::kRGB_565_Config:
+ case kRGB_565_SkColorType:
hdr.fGLType = GR_GL_UNSIGNED_SHORT_5_6_5;
hdr.fGLTypeSize = 2;
hdr.fGLFormat = GR_GL_RGB;
@@ -405,7 +405,7 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
hdr.fGLBaseInternalFormat = GR_GL_RGB;
break;
- case SkBitmap::kARGB_4444_Config:
+ case kARGB_4444_SkColorType:
hdr.fGLType = GR_GL_UNSIGNED_SHORT_4_4_4_4;
hdr.fGLTypeSize = 2;
hdr.fGLFormat = GR_GL_RGBA;
@@ -414,7 +414,7 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
kvPairs.push_back(CreateKeyValue("KTXPremultipliedAlpha", "True"));
break;
- case SkBitmap::kARGB_8888_Config:
+ case kN32_SkColorType:
hdr.fGLType = GR_GL_UNSIGNED_BYTE;
hdr.fGLTypeSize = 1;
hdr.fGLFormat = GR_GL_RGBA;
@@ -470,7 +470,7 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) {
// Write the pixel data...
const uint8_t* rowPtr = src;
- if (SkBitmap::kARGB_8888_Config == config) {
+ if (kN32_SkColorType == ct) {
for (int j = 0; j < height; ++j) {
const uint32_t* pixelsPtr = reinterpret_cast<const uint32_t*>(rowPtr);
for (int i = 0; i < width; ++i) {
« no previous file with comments | « tests/KtxTest.cpp ('k') | tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698