diff options
77 files changed, 132 insertions, 128 deletions
diff --git a/bench/DeferredSurfaceCopyBench.cpp b/bench/DeferredSurfaceCopyBench.cpp index 713078038e..fcc19d4c39 100644 --- a/bench/DeferredSurfaceCopyBench.cpp +++ b/bench/DeferredSurfaceCopyBench.cpp @@ -37,7 +37,7 @@ protected: SkImageInfo info; info.fWidth = kSurfaceWidth; info.fHeight = kSurfaceHeight; - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; info.fAlphaType = kPremul_SkAlphaType; const SkRect fullCanvasRect = SkRect::MakeWH( SkIntToScalar(kSurfaceWidth), SkIntToScalar(kSurfaceHeight)); diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp index ca760b7d70..cc55bb9f29 100644 --- a/bench/benchmain.cpp +++ b/bench/benchmain.cpp @@ -207,20 +207,20 @@ static const struct Config { GLContextType contextType; bool runByDefault; } gConfigs[] = { - { kPMColor_SkColorType, "NONRENDERING", 0, SkBenchmark::kNonRendering_Backend, kNative, true}, - { kPMColor_SkColorType, "8888", 0, SkBenchmark::kRaster_Backend, kNative, true}, + { kN32_SkColorType, "NONRENDERING", 0, SkBenchmark::kNonRendering_Backend, kNative, true}, + { kN32_SkColorType, "8888", 0, SkBenchmark::kRaster_Backend, kNative, true}, { kRGB_565_SkColorType, "565", 0, SkBenchmark::kRaster_Backend, kNative, true}, #if SK_SUPPORT_GPU - { kPMColor_SkColorType, "GPU", 0, SkBenchmark::kGPU_Backend, kNative, true}, - { kPMColor_SkColorType, "MSAA4", 4, SkBenchmark::kGPU_Backend, kNative, false}, - { kPMColor_SkColorType, "MSAA16", 16, SkBenchmark::kGPU_Backend, kNative, false}, - { kPMColor_SkColorType, "NVPRMSAA4", 4, SkBenchmark::kGPU_Backend, kNVPR, true}, - { kPMColor_SkColorType, "NVPRMSAA16", 16, SkBenchmark::kGPU_Backend, kNVPR, false}, + { kN32_SkColorType, "GPU", 0, SkBenchmark::kGPU_Backend, kNative, true}, + { kN32_SkColorType, "MSAA4", 4, SkBenchmark::kGPU_Backend, kNative, false}, + { kN32_SkColorType, "MSAA16", 16, SkBenchmark::kGPU_Backend, kNative, false}, + { kN32_SkColorType, "NVPRMSAA4", 4, SkBenchmark::kGPU_Backend, kNVPR, true}, + { kN32_SkColorType, "NVPRMSAA16", 16, SkBenchmark::kGPU_Backend, kNVPR, false}, #if SK_ANGLE - { kPMColor_SkColorType, "ANGLE", 0, SkBenchmark::kGPU_Backend, kANGLE, true}, + { kN32_SkColorType, "ANGLE", 0, SkBenchmark::kGPU_Backend, kANGLE, true}, #endif // SK_ANGLE - { kPMColor_SkColorType, "Debug", 0, SkBenchmark::kGPU_Backend, kDebug, kIsDebug}, - { kPMColor_SkColorType, "NULLGPU", 0, SkBenchmark::kGPU_Backend, kNull, true}, + { kN32_SkColorType, "Debug", 0, SkBenchmark::kGPU_Backend, kDebug, kIsDebug}, + { kN32_SkColorType, "NULLGPU", 0, SkBenchmark::kGPU_Backend, kNull, true}, #endif // SK_SUPPORT_GPU }; diff --git a/debugger/QT/SkImageWidget.cpp b/debugger/QT/SkImageWidget.cpp index 9e263008be..03c7e7e0f9 100644 --- a/debugger/QT/SkImageWidget.cpp +++ b/debugger/QT/SkImageWidget.cpp @@ -19,7 +19,7 @@ SkImageWidget::SkImageWidget(SkDebugger *debugger) SkImageInfo info; info.fWidth = kImageWidgetWidth; info.fHeight = kImageWidgetHeight; - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; info.fAlphaType = kPremul_SkAlphaType; fSurface = SkSurface::NewRasterDirect(info, fPixels, 4 * kImageWidgetWidth); @@ -88,7 +88,7 @@ static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms, for (int i = 0; i < gms.count(); i++) { for (int j = 0; j < configs.count(); j++) { START("565", CpuGMTask, kRGB_565_SkColorType); - START("8888", CpuGMTask, kPMColor_SkColorType); + START("8888", CpuGMTask, kN32_SkColorType); START("gpu", GpuGMTask, native, 0); START("msaa4", GpuGMTask, native, 4); START("msaa16", GpuGMTask, native, 16); @@ -115,7 +115,7 @@ static void kick_off_benches(const SkTDArray<BenchRegistry::Factory>& benches, for (int j = 0; j < configs.count(); j++) { START("nonrendering", NonRenderingBenchTask); START("565", CpuBenchTask, kRGB_565_SkColorType); - START("8888", CpuBenchTask, kPMColor_SkColorType); + START("8888", CpuBenchTask, kN32_SkColorType); START("gpu", GpuBenchTask, native, 0); START("msaa4", GpuBenchTask, native, 4); START("msaa16", GpuBenchTask, native, 16); diff --git a/dm/DMBenchTask.cpp b/dm/DMBenchTask.cpp index c53daf95b4..bcedb96f25 100644 --- a/dm/DMBenchTask.cpp +++ b/dm/DMBenchTask.cpp @@ -63,7 +63,7 @@ static void draw_raster(SkBenchmark* bench, SkColorType colorType) { } void NonRenderingBenchTask::draw() { - draw_raster(fBench.get(), kPMColor_SkColorType); + draw_raster(fBench.get(), kN32_SkColorType); } void CpuBenchTask::draw() { @@ -73,7 +73,7 @@ void CpuBenchTask::draw() { void GpuBenchTask::draw(GrContextFactory* grFactory) { SkImageInfo info = SkImageInfo::Make(fBench->getSize().x(), fBench->getSize().y(), - kPMColor_SkColorType, + kN32_SkColorType, kPremul_SkAlphaType); SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, info, fSampleCount)); diff --git a/dm/DMGpuGMTask.cpp b/dm/DMGpuGMTask.cpp index c4867b6e9e..c72f675660 100644 --- a/dm/DMGpuGMTask.cpp +++ b/dm/DMGpuGMTask.cpp @@ -27,7 +27,7 @@ GpuGMTask::GpuGMTask(const char* config, void GpuGMTask::draw(GrContextFactory* grFactory) { SkImageInfo info = SkImageInfo::Make(SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height()), - kPMColor_SkColorType, + kN32_SkColorType, kPremul_SkAlphaType); SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, info, fSampleCount)); SkCanvas* canvas = surface->getCanvas(); diff --git a/experimental/iOSSampleApp/Shared/SkUIView.mm b/experimental/iOSSampleApp/Shared/SkUIView.mm index 904cb9c992..e2dce54a69 100644 --- a/experimental/iOSSampleApp/Shared/SkUIView.mm +++ b/experimental/iOSSampleApp/Shared/SkUIView.mm @@ -30,7 +30,7 @@ if (NULL != fWind) { fWind->setVisibleP(true); fWind->resize(self.frame.size.width, self.frame.size.height, - kPMColor_SkColorType); + kN32_SkColorType); } } diff --git a/experimental/iOSSampleApp/SkSampleUIView.mm b/experimental/iOSSampleApp/SkSampleUIView.mm index 7b90cb778d..a9defbe610 100644 --- a/experimental/iOSSampleApp/SkSampleUIView.mm +++ b/experimental/iOSSampleApp/SkSampleUIView.mm @@ -337,7 +337,7 @@ static FPSState gFPS; fWind = new SampleWindow(self, 1, &kDummyArgv, fDevManager); fWind->resize(self.frame.size.width, self.frame.size.height, - kPMColor_SkColorType); + kN32_SkColorType); } return self; } diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp index 36b711e994..b441e34f56 100644 --- a/gm/bitmapcopy.cpp +++ b/gm/bitmapcopy.cpp @@ -22,7 +22,7 @@ static const char* gColorTypeNames[] = { static const SkColorType gColorTypes[] = { kRGB_565_SkColorType, kARGB_4444_SkColorType, - kPMColor_SkColorType, + kN32_SkColorType, }; #define NUM_CONFIGS SK_ARRAY_COUNT(gColorTypes) diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp index fb3b304eb9..5fa213062b 100644 --- a/gm/bitmapfilters.cpp +++ b/gm/bitmapfilters.cpp @@ -87,7 +87,7 @@ class FilterGM : public GM { make_bm(&fBM8); fBM8.copyTo(&fBM4444, kARGB_4444_SkColorType); fBM8.copyTo(&fBM16, kRGB_565_SkColorType); - fBM8.copyTo(&fBM32, kPMColor_SkColorType); + fBM8.copyTo(&fBM32, kN32_SkColorType); } public: SkBitmap fBM8, fBM4444, fBM16, fBM32; diff --git a/gm/bitmappremul.cpp b/gm/bitmappremul.cpp index fd563eb775..e315fafdde 100644 --- a/gm/bitmappremul.cpp +++ b/gm/bitmappremul.cpp @@ -30,7 +30,7 @@ static void init_bitmap(SkColorType ct, SkBitmap* bitmap) { static SkBitmap make_argb8888_gradient() { SkBitmap bitmap; - init_bitmap(kPMColor_SkColorType, &bitmap); + init_bitmap(kN32_SkColorType, &bitmap); uint8_t rowColor = 0; for (int y = 0; y < SLIDE_SIZE; y++) { uint32_t* dst = bitmap.getAddr32(0, y); @@ -64,7 +64,7 @@ static SkBitmap make_argb4444_gradient() { static SkBitmap make_argb8888_stripes() { SkBitmap bitmap; - init_bitmap(kPMColor_SkColorType, &bitmap); + init_bitmap(kN32_SkColorType, &bitmap); uint8_t rowColor = 0; for (int y = 0; y < SLIDE_SIZE; y++) { uint32_t* dst = bitmap.getAddr32(0, y); diff --git a/gm/gammatext.cpp b/gm/gammatext.cpp index 7ee55db2fb..f520754123 100644 --- a/gm/gammatext.cpp +++ b/gm/gammatext.cpp @@ -40,7 +40,7 @@ static bool setFont(SkPaint* paint, const char name[]) { static CGContextRef makeCG(const SkImageInfo& info, const void* addr, size_t rowBytes) { - if (kPMColor_SkColorType != info.colorType() || NULL == addr) { + if (kN32_SkColorType != info.colorType() || NULL == addr) { return NULL; } CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 52e7332b64..03556e70e9 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -268,7 +268,7 @@ public: static void force_all_opaque(const SkBitmap& bitmap) { SkColorType colorType = bitmap.colorType(); switch (colorType) { - case kPMColor_SkColorType: + case kN32_SkColorType: force_all_opaque_8888(bitmap); break; case kRGB_565_SkColorType: @@ -294,7 +294,7 @@ public: // from this method, we should be able to get rid of the // transformation to 8888 format also. SkBitmap copy; - bitmap.copyTo(©, kPMColor_SkColorType); + bitmap.copyTo(©, kN32_SkColorType); if (!SkImageEncoder::EncodeFile(path.c_str(), copy, SkImageEncoder::kPNG_Type, 100)) { @@ -740,8 +740,8 @@ public: return; } - if ((kPMColor_SkColorType != expectedBitmap.colorType()) || - (kPMColor_SkColorType != actualBitmap.colorType())) { + if ((kN32_SkColorType != expectedBitmap.colorType()) || + (kN32_SkColorType != actualBitmap.colorType())) { SkDebugf("---- %s: not computing max per-channel pixel mismatch because non-8888\n", testName); return; diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp index 5b97f13fc8..abecadae9a 100644 --- a/gm/tilemodes.cpp +++ b/gm/tilemodes.cpp @@ -50,7 +50,7 @@ static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, } static const SkColorType gColorTypes[] = { - kPMColor_SkColorType, + kN32_SkColorType, kRGB_565_SkColorType, }; @@ -166,7 +166,7 @@ static const int gHeight = 32; static SkShader* make_bm(SkShader::TileMode tx, SkShader::TileMode ty) { SkBitmap bm; - makebm(&bm, kPMColor_SkColorType, gWidth, gHeight); + makebm(&bm, kN32_SkColorType, gWidth, gHeight); return SkShader::CreateBitmapShader(bm, tx, ty); } diff --git a/gm/tilemodes_scaled.cpp b/gm/tilemodes_scaled.cpp index 932d3f7220..bbb86a70fd 100644 --- a/gm/tilemodes_scaled.cpp +++ b/gm/tilemodes_scaled.cpp @@ -50,7 +50,7 @@ static void setup(SkPaint* paint, const SkBitmap& bm, SkPaint::FilterLevel filte } static const SkColorType gColorTypes[] = { - kPMColor_SkColorType, + kN32_SkColorType, kRGB_565_SkColorType, }; @@ -177,7 +177,7 @@ static const int gHeight = 32; static SkShader* make_bm(SkShader::TileMode tx, SkShader::TileMode ty) { SkBitmap bm; - makebm(&bm, kPMColor_SkColorType, gWidth, gHeight); + makebm(&bm, kN32_SkColorType, gWidth, gHeight); return SkShader::CreateBitmapShader(bm, tx, ty); } diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 77a7947f19..3cf5a632bc 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -301,9 +301,8 @@ # Temporary until https:#googleplex-android-review.git.corp.google.com/#/c/442220/ # lands. 'SK_SUPPORT_LEGACY_GETTOTALCLIP', - # Use a better name for kPMColor_SkColorType until - # https://code.google.com/p/skia/issues/detail?id=2384 is fixed. - 'kNative_8888_SkColorType kPMColor_SkColorType', + # Still need to switch Android to the new name for N32. + 'kNative_8888_SkColorType kN32_SkColorType', ], }], diff --git a/gyp/skia_for_chromium_defines.gypi b/gyp/skia_for_chromium_defines.gypi index 6eaa5945f4..1bbd0c3054 100644 --- a/gyp/skia_for_chromium_defines.gypi +++ b/gyp/skia_for_chromium_defines.gypi @@ -15,6 +15,7 @@ 'skia_for_chromium_defines': [ 'SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1', 'SK_SUPPORT_LEGACY_GETTOPDEVICE', + 'SK_SUPPORT_LEGACY_N32_NAME', ], }, } diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h index 1c73d959af..83919549d5 100644 --- a/include/core/SkImageInfo.h +++ b/include/core/SkImageInfo.h @@ -80,12 +80,16 @@ enum SkColorType { kLastEnum_SkColorType = kIndex_8_SkColorType, #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) - kPMColor_SkColorType = kBGRA_8888_SkColorType + kN32_SkColorType = kBGRA_8888_SkColorType, #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) - kPMColor_SkColorType = kRGBA_8888_SkColorType + kN32_SkColorType = kRGBA_8888_SkColorType, #else #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order" #endif + +#ifdef SK_SUPPORT_LEGACY_N32_NAME + kPMColor_SkColorType = kN32_SkColorType +#endif }; static int SkColorTypeBytesPerPixel(SkColorType ct) { @@ -136,7 +140,7 @@ struct SkImageInfo { */ static SkImageInfo MakeN32(int width, int height, SkAlphaType at) { SkImageInfo info = { - width, height, kPMColor_SkColorType, at + width, height, kN32_SkColorType, at }; return info; } @@ -146,7 +150,7 @@ struct SkImageInfo { */ static SkImageInfo MakeN32Premul(int width, int height) { SkImageInfo info = { - width, height, kPMColor_SkColorType, kPremul_SkAlphaType + width, height, kN32_SkColorType, kPremul_SkAlphaType }; return info; } diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index c8fbf3dd15..050fc4aa8c 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -958,7 +958,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev fSlideMenu = new SkOSMenu; this->addMenu(fSlideMenu); - this->setColorType(kPMColor_SkColorType); + this->setColorType(kN32_SkColorType); this->setVisibleP(true); this->setClipToBounds(false); @@ -1449,7 +1449,7 @@ void SampleWindow::afterChildren(SkCanvas* orig) { SkBaseDevice* device = orig->getDevice(); SkBitmap bmp; - if (device->accessBitmap(false).copyTo(&bmp, kPMColor_SkColorType)) { + if (device->accessBitmap(false).copyTo(&bmp, kN32_SkColorType)) { static int gSampleGrabCounter; SkString name; name.printf("sample_grab_%d.png", gSampleGrabCounter++); @@ -1552,7 +1552,7 @@ static SkColorType gColorTypeCycle[] = { kUnknown_SkColorType, // none -> none kUnknown_SkColorType, // a8 -> none kARGB_4444_SkColorType, // 565 -> 4444 - kPMColor_SkColorType, // 4444 -> 8888 + kN32_SkColorType, // 4444 -> 8888 kRGB_565_SkColorType, // 8888 -> 565 kRGB_565_SkColorType, // 8888 -> 565 kUnknown_SkColorType, // index8 -> none diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp index a3ebafa296..e05d074f3b 100644 --- a/samplecode/SampleDitherBitmap.cpp +++ b/samplecode/SampleDitherBitmap.cpp @@ -84,7 +84,7 @@ public: DitherBitmapView() { fResult = test_pathregion(); fBM8 = make_bitmap(); - fBM8.copyTo(&fBM32, kPMColor_SkColorType); + fBM8.copyTo(&fBM32, kN32_SkColorType); this->setBGColor(0xFFDDDDDD); } diff --git a/samplecode/SampleEncode.cpp b/samplecode/SampleEncode.cpp index 4769fbb0a8..080c05f5d7 100644 --- a/samplecode/SampleEncode.cpp +++ b/samplecode/SampleEncode.cpp @@ -43,7 +43,7 @@ static void make_image(SkBitmap* bm, SkColorType ct, int configIndex) { SkIntToScalar(width)/2, paint); switch (ct) { - case kPMColor_SkColorType: + case kN32_SkColorType: bm->swap(device); break; case kRGB_565_SkColorType: { @@ -81,7 +81,7 @@ static void make_image(SkBitmap* bm, SkColorType ct, int configIndex) { // configs to build the original bitmap in. Can be at most these 3 static const SkColorType gColorTypes[] = { - kPMColor_SkColorType, + kN32_SkColorType, kRGB_565_SkColorType, kIndex_8_SkColorType, // opaque kIndex_8_SkColorType // alpha diff --git a/samplecode/SampleFilter.cpp b/samplecode/SampleFilter.cpp index 7b2c5516a2..e17a33c3d4 100644 --- a/samplecode/SampleFilter.cpp +++ b/samplecode/SampleFilter.cpp @@ -91,7 +91,7 @@ public: make_bm(&fBM8); fBM8.copyTo(&fBM4444, kARGB_4444_SkColorType); fBM8.copyTo(&fBM16, kRGB_565_SkColorType); - fBM8.copyTo(&fBM32, kPMColor_SkColorType); + fBM8.copyTo(&fBM32, kN32_SkColorType); this->setBGColor(0xFFDDDDDD); } diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp index 28671d6b99..8d58b9b8de 100644 --- a/samplecode/SampleFilterFuzz.cpp +++ b/samplecode/SampleFilterFuzz.cpp @@ -116,7 +116,7 @@ static bool valid_for_raster_canvas(const SkImageInfo& info) { case kAlpha_8_SkColorType: case kRGB_565_SkColorType: return true; - case kPMColor_SkColorType: + case kN32_SkColorType: return kPremul_SkAlphaType == info.alphaType() || kOpaque_SkAlphaType == info.alphaType(); default: diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp index 735b9907ef..9ffccebf1a 100644 --- a/samplecode/SampleTiling.cpp +++ b/samplecode/SampleTiling.cpp @@ -55,7 +55,7 @@ static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, } static const SkColorType gColorTypes[] = { - kPMColor_SkColorType, + kN32_SkColorType, kRGB_565_SkColorType, }; static const int gWidth = 32; diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 0736e17ff3..72395172da 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -346,7 +346,7 @@ static bool config_to_colorType(SkBitmap::Config config, SkColorType* ctOut) { ct = kARGB_4444_SkColorType; break; case SkBitmap::kARGB_8888_Config: - ct = kPMColor_SkColorType; + ct = kN32_SkColorType; break; case SkBitmap::kNo_Config: default: @@ -997,7 +997,7 @@ bool SkBitmap::canCopyTo(SkColorType dstColorType) const { switch (dstColorType) { case kAlpha_8_SkColorType: case kRGB_565_SkColorType: - case kPMColor_SkColorType: + case kN32_SkColorType: break; case kIndex_8_SkColorType: if (!sameConfigs) { @@ -1005,7 +1005,7 @@ bool SkBitmap::canCopyTo(SkColorType dstColorType) const { } break; case kARGB_4444_SkColorType: - return sameConfigs || kPMColor_SkColorType == this->colorType(); + return sameConfigs || kN32_SkColorType == this->colorType(); default: return false; } @@ -1116,7 +1116,7 @@ bool SkBitmap::copyTo(SkBitmap* dst, SkColorType dstColorType, } } } else if (kARGB_4444_SkColorType == dstColorType - && kPMColor_SkColorType == src->colorType()) { + && kN32_SkColorType == src->colorType()) { SkASSERT(src->height() == tmpDst.height()); SkASSERT(src->width() == tmpDst.width()); for (int y = 0; y < src->height(); ++y) { diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index ba529a766b..c2b633e1a6 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -45,7 +45,7 @@ static bool valid_for_bitmap_device(const SkImageInfo& info, case kRGB_565_SkColorType: canonicalAlphaType = kOpaque_SkAlphaType; break; - case kPMColor_SkColorType: + case kN32_SkColorType: break; default: return false; diff --git a/src/core/SkBitmapFilter.cpp b/src/core/SkBitmapFilter.cpp index 1653cbb20e..a9c3223fbc 100644 --- a/src/core/SkBitmapFilter.cpp +++ b/src/core/SkBitmapFilter.cpp @@ -124,7 +124,7 @@ bool SkBitmapProcState::setBitmapFilterProcs() { } // TODO: consider supporting other colortypes (e.g. 565, A8) - if (fBitmap->colorType() != kPMColor_SkColorType) { + if (fBitmap->colorType() != kN32_SkColorType) { return false; } diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index 9c2c77b950..a397b78439 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -22,7 +22,7 @@ bool SkBitmapProcShader::CanDo(const SkBitmap& bm, TileMode tx, TileMode ty) { case kAlpha_8_SkColorType: case kRGB_565_SkColorType: case kIndex_8_SkColorType: - case kPMColor_SkColorType: + case kN32_SkColorType: // if (tx == ty && (kClamp_TileMode == tx || kRepeat_TileMode == tx)) return true; default: @@ -130,7 +130,7 @@ bool SkBitmapProcShader::setContext(const SkBitmap& device, flags |= (kHasSpan16_Flag | kIntrinsicly16_Flag); break; case kIndex_8_SkColorType: - case kPMColor_SkColorType: + case kN32_SkColorType: if (bitmapIsOpaque) { flags |= kHasSpan16_Flag; } @@ -279,7 +279,7 @@ static bool canUseColorShader(const SkBitmap& bm, SkColor* color) { } switch (bm.colorType()) { - case kPMColor_SkColorType: + case kN32_SkColorType: *color = SkUnPreMultiply::PMColorToColor(*bm.getAddr32(0, 0)); return true; case kRGB_565_SkColorType: diff --git a/src/core/SkBitmapScaler.cpp b/src/core/SkBitmapScaler.cpp index 9e8c5feef0..599e9d8eb5 100644 --- a/src/core/SkBitmapScaler.cpp +++ b/src/core/SkBitmapScaler.cpp @@ -282,7 +282,7 @@ bool SkBitmapScaler::Resize(SkBitmap* resultPtr, SkAutoLockPixels locker(source); if (!source.readyToDraw() || - source.colorType() != kPMColor_SkColorType) { + source.colorType() != kN32_SkColorType) { return false; } diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index 4d70395e52..52a05eded8 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -923,7 +923,7 @@ SkBlitter* SkBlitter::Choose(const SkBitmap& device, blitter = SkBlitter_ChooseD565(device, *paint, allocator); break; - case kPMColor_SkColorType: + case kN32_SkColorType: if (shader) { blitter = allocator->createT<SkARGB32_Shader_Blitter>(device, *paint); } else if (paint->getColor() == SK_ColorBLACK) { diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp index e15e2fcde4..91a3cd1fee 100644 --- a/src/core/SkBlitter_Sprite.cpp +++ b/src/core/SkBlitter_Sprite.cpp @@ -67,7 +67,7 @@ SkBlitter* SkBlitter::ChooseSprite(const SkBitmap& device, const SkPaint& paint, case kRGB_565_SkColorType: blitter = SkSpriteBlitter::ChooseD16(source, paint, allocator); break; - case kPMColor_SkColorType: + case kN32_SkColorType: blitter = SkSpriteBlitter::ChooseD32(source, paint, allocator); break; default: diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 8d35eaedf9..b67a657456 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2620,7 +2620,7 @@ static bool supported_for_raster_canvas(const SkImageInfo& info) { switch (info.colorType()) { case kAlpha_8_SkColorType: case kRGB_565_SkColorType: - case kPMColor_SkColorType: + case kN32_SkColorType: break; default: return false; diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 946bf75310..7eb0be6b6b 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -188,7 +188,7 @@ static BitmapXferProc ChooseBitmapXferProc(const SkBitmap& bitmap, */ SkPMColor pmc = SkPreMultiplyColor(color); switch (bitmap.colorType()) { - case kPMColor_SkColorType: + case kN32_SkColorType: if (data) { *data = pmc; } @@ -221,7 +221,7 @@ static void CallBitmapXferProc(const SkBitmap& bitmap, const SkIRect& rect, BitmapXferProc proc, uint32_t procData) { int shiftPerPixel; switch (bitmap.colorType()) { - case kPMColor_SkColorType: + case kN32_SkColorType: shiftPerPixel = 2; break; case kRGB_565_SkColorType: @@ -515,7 +515,7 @@ PtProcRec::Proc PtProcRec::chooseProc(SkBlitter** blitterPtr) { const SkBitmap* bm = blitter->justAnOpaqueColor(&value); if (bm && kRGB_565_SkColorType == bm->colorType()) { proc = bw_pt_rect_16_hair_proc; - } else if (bm && kPMColor_SkColorType == bm->colorType()) { + } else if (bm && kN32_SkColorType == bm->colorType()) { proc = bw_pt_rect_32_hair_proc; } else { proc = bw_pt_rect_hair_proc; diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp index 1e37884c31..886b1438ca 100644 --- a/src/core/SkScaledImageCache.cpp +++ b/src/core/SkScaledImageCache.cpp @@ -277,7 +277,7 @@ bool SkScaledImageCacheDiscardableAllocator::allocPixelRef(SkBitmap* bitmap, } // can we relax this? - if (kPMColor_SkColorType != bitmap->colorType()) { + if (kN32_SkColorType != bitmap->colorType()) { return false; } diff --git a/src/core/SkSpriteBlitter_ARGB32.cpp b/src/core/SkSpriteBlitter_ARGB32.cpp index b05e5033e4..a4ae41c689 100644 --- a/src/core/SkSpriteBlitter_ARGB32.cpp +++ b/src/core/SkSpriteBlitter_ARGB32.cpp @@ -20,7 +20,7 @@ class Sprite_D32_S32 : public SkSpriteBlitter { public: Sprite_D32_S32(const SkBitmap& src, U8CPU alpha) : INHERITED(src) { - SkASSERT(src.colorType() == kPMColor_SkColorType); + SkASSERT(src.colorType() == kN32_SkColorType); unsigned flags32 = 0; if (255 != alpha) { @@ -289,7 +289,7 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseD32(const SkBitmap& source, const SkPain blitter = allocator->createT<Sprite_D32_S4444>(source); } break; - case kPMColor_SkColorType: + case kN32_SkColorType: if (xfermode || filter) { if (255 == alpha) { // this can handle xfermode or filter, but not alpha diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp index 74c1961dbd..3f712bb3ec 100644 --- a/src/core/SkSpriteBlitter_RGB16.cpp +++ b/src/core/SkSpriteBlitter_RGB16.cpp @@ -325,7 +325,7 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, const SkPain unsigned alpha = paint.getAlpha(); switch (source.colorType()) { - case kPMColor_SkColorType: { + case kN32_SkColorType: { blitter = allocator->createT<Sprite_D16_S32_BlitRowProc>(source); break; } diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index f938ba61bb..205e9a9516 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -306,9 +306,9 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const { bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, SkBitmap* dst, SkIPoint* offset) const { - SkASSERT(src.colorType() == kPMColor_SkColorType); + SkASSERT(src.colorType() == kN32_SkColorType); - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp index eabf066c7d..8f78ff2bd6 100644 --- a/src/effects/SkBicubicImageFilter.cpp +++ b/src/effects/SkBicubicImageFilter.cpp @@ -91,7 +91,7 @@ bool SkBicubicImageFilter::onFilterImage(Proxy* proxy, return false; } - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 363691abfe..63990abc22 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -149,7 +149,7 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy, return false; } - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 0200cabff8..39222444d2 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -205,8 +205,8 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, (displInput && !displInput->filterImage(proxy, src, ctx, &displ, &displOffset))) { return false; } - if ((displ.colorType() != kPMColor_SkColorType) || - (color.colorType() != kPMColor_SkColorType)) { + if ((displ.colorType() != kN32_SkColorType) || + (color.colorType() != kN32_SkColorType)) { return false; } SkIRect bounds; diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 09ceef03ef..b485ae1bb4 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -943,7 +943,7 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, return false; } - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } SkIRect bounds; @@ -1034,7 +1034,7 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy, return false; } - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 51ade99e34..5096640166 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -282,11 +282,11 @@ void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const { bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* dst, SkIPoint* offset) const { - SkASSERT(src.colorType() == kPMColor_SkColorType); + SkASSERT(src.colorType() == kN32_SkColorType); SkASSERT(fSrcRect.width() < src.width()); SkASSERT(fSrcRect.height() < src.height()); - if ((src.colorType() != kPMColor_SkColorType) || + if ((src.colorType() != kN32_SkColorType) || (fSrcRect.width() >= src.width()) || (fSrcRect.height() >= src.height())) { return false; diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index 7b9812ddbc..878cbae795 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -260,7 +260,7 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, return false; } - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index fb69758edd..2350e6c29e 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -149,7 +149,7 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p return false; } - if (src.colorType() != kPMColor_SkColorType) { + if (src.colorType() != kN32_SkColorType) { return false; } diff --git a/src/effects/SkTransparentShader.cpp b/src/effects/SkTransparentShader.cpp index b6a5e1edea..bd8b99a3c0 100644 --- a/src/effects/SkTransparentShader.cpp +++ b/src/effects/SkTransparentShader.cpp @@ -29,7 +29,7 @@ uint32_t SkTransparentShader::getFlags() { if (fAlpha == 255) flags |= kOpaqueAlpha_Flag; break; - case kPMColor_SkColorType: + case kN32_SkColorType: if (fAlpha == 255 && fDevice->isOpaque()) flags |= kOpaqueAlpha_Flag; break; @@ -43,7 +43,7 @@ void SkTransparentShader::shadeSpan(int x, int y, SkPMColor span[], int count) { unsigned scale = SkAlpha255To256(fAlpha); switch (fDevice->colorType()) { - case kPMColor_SkColorType: + case kN32_SkColorType: if (scale == 256) { SkPMColor* src = fDevice->getAddr32(x, y); if (src != span) { diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index b1fa560dfc..2ebb9c71d9 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -517,7 +517,7 @@ const SkPMColor* SkGradientShaderBase::getCache32() const { info.fWidth = kCache32Count; info.fHeight = 4; // for our 4 dither rows info.fAlphaType = kPremul_SkAlphaType; - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; if (NULL == fCache32PixelRef) { fCache32PixelRef = SkMallocPixelRef::NewAllocate(info, 0, NULL); diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 7c804ab2a0..08d4411397 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -229,7 +229,7 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo if (kRGB_565_SkColorType == info.colorType()) { info.fAlphaType = kOpaque_SkAlphaType; // force this setting } else { - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; if (kOpaque_SkAlphaType != info.alphaType()) { info.fAlphaType = kPremul_SkAlphaType; // force this setting } diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index db46b86901..754a7be9aa 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -43,7 +43,7 @@ static void build_compressed_data(void* buffer, const SkBitmap& bitmap) { dstPI.fRowBytes = count * sizeof(SkPMColor); SkSrcPixelInfo srcPI; - srcPI.fColorType = kPMColor_SkColorType; + srcPI.fColorType = kN32_SkColorType; srcPI.fAlphaType = kPremul_SkAlphaType; srcPI.fPixels = ctable->lockColors(); srcPI.fRowBytes = count * sizeof(SkPMColor); @@ -166,7 +166,7 @@ static GrTexture* sk_gr_create_bitmap_texture(GrContext* ctx, return result; } } else { - origBitmap.copyTo(&tmpBitmap, kPMColor_SkColorType); + origBitmap.copyTo(&tmpBitmap, kN32_SkColorType); // now bitmap points to our temp, which has been promoted to 32bits bitmap = &tmpBitmap; desc.fConfig = SkBitmapConfig2GrPixelConfig(bitmap->config()); diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index a567c41ca8..4cbfd81bed 100644 --- a/src/image/SkImage.cpp +++ b/src/image/SkImage.cpp @@ -90,7 +90,7 @@ SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { static bool raster_canvas_supports(const SkImageInfo& info) { switch (info.fColorType) { - case kPMColor_SkColorType: + case kN32_SkColorType: return kUnpremul_SkAlphaType != info.fAlphaType; case kRGB_565_SkColorType: return true; diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp index a044aad0a0..dada230de8 100644 --- a/src/image/SkImagePriv.cpp +++ b/src/image/SkImagePriv.cpp @@ -20,7 +20,7 @@ SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType colorType) { case kRGB_565_SkColorType: return SkBitmap::kRGB_565_Config; - case kPMColor_SkColorType: + case kN32_SkColorType: return SkBitmap::kARGB_8888_Config; case kIndex_8_SkColorType: @@ -44,7 +44,7 @@ SkColorType SkBitmapConfigToColorType(SkBitmap::Config config) { kIndex_8_SkColorType, // kIndex8_Config kRGB_565_SkColorType, // kRGB_565_Config kARGB_4444_SkColorType, // kARGB_4444_Config - kPMColor_SkColorType, // kARGB_8888_Config + kN32_SkColorType, // kARGB_8888_Config }; SkASSERT((unsigned)config < SK_ARRAY_COUNT(gCT)); return gCT[config]; diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 475f50ed8a..aa08f44260 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -59,7 +59,7 @@ GrTexture* SkImage_Gpu::onGetTexture() { } bool SkImage_Gpu::getROPixels(SkBitmap* dst) const { - return fBitmap.copyTo(dst, kPMColor_SkColorType); + return fBitmap.copyTo(dst, kN32_SkColorType); } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/image/SkSurface_Picture.cpp b/src/image/SkSurface_Picture.cpp index 8f65b3eb55..f7d97acd11 100644 --- a/src/image/SkSurface_Picture.cpp +++ b/src/image/SkSurface_Picture.cpp @@ -62,7 +62,7 @@ SkImage* SkSurface_Picture::onNewImageSnapshot() { } else { SkImageInfo info; info.fWidth = info.fHeight = 0; - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; info.fAlphaType = kOpaque_SkAlphaType; return SkImage::NewRasterCopy(info, NULL, 0); } diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp index e24c0e8699..74197379ce 100644 --- a/src/image/SkSurface_Raster.cpp +++ b/src/image/SkSurface_Raster.cpp @@ -47,7 +47,7 @@ bool SkSurface_Raster::Valid(const SkImageInfo& info, size_t rowBytes) { case kRGB_565_SkColorType: shift = 1; break; - case kPMColor_SkColorType: + case kN32_SkColorType: shift = 2; break; default: diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp index 5b842abf5f..b3924a7daa 100644 --- a/src/images/SkDecodingImageGenerator.cpp +++ b/src/images/SkDecodingImageGenerator.cpp @@ -242,7 +242,7 @@ SkImageGenerator* CreateDecodingImageGenerator( if (kIndex_8_SkColorType == bitmap.colorType()) { // We don't support kIndex8 because we don't support // colortables in this workflow. - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; } } else { if (!bitmap.canCopyTo(opts.fRequestedColorType)) { diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp index c61ce98a8b..c683752fdd 100644 --- a/src/ports/SkImageDecoder_CG.cpp +++ b/src/ports/SkImageDecoder_CG.cpp @@ -209,7 +209,7 @@ bool SkImageEncoder_CG::onEncode(SkWStream* stream, const SkBitmap& bm, // <Error>: CGImageDestinationFinalize image destination does not have enough images // So instead we copy to 8888. if (bm.colorType() == kARGB_4444_SkColorType) { - bm.copyTo(&bitmap8888, kPMColor_SkColorType); + bm.copyTo(&bitmap8888, kN32_SkColorType); bmPtr = &bitmap8888; } type = kUTTypePNG; diff --git a/src/ports/SkImageDecoder_WIC.cpp b/src/ports/SkImageDecoder_WIC.cpp index 9d5479497e..74b2c39195 100644 --- a/src/ports/SkImageDecoder_WIC.cpp +++ b/src/ports/SkImageDecoder_WIC.cpp @@ -306,10 +306,10 @@ bool SkImageEncoder_WIC::onEncode(SkWStream* stream //Convert to 8888 if needed. const SkBitmap* bitmap; SkBitmap bitmapCopy; - if (kPMColor_SkColorType == bitmapOrig.colorType() && bitmapOrig.isOpaque()) { + if (kN32_SkColorType == bitmapOrig.colorType() && bitmapOrig.isOpaque()) { bitmap = &bitmapOrig; } else { - if (!bitmapOrig.copyTo(&bitmapCopy, kPMColor_SkColorType)) { + if (!bitmapOrig.copyTo(&bitmapCopy, kN32_SkColorType)) { return false; } bitmap = &bitmapCopy; diff --git a/src/utils/SkBitmapHasher.cpp b/src/utils/SkBitmapHasher.cpp index 6c861cd04b..bd038ddaa0 100644 --- a/src/utils/SkBitmapHasher.cpp +++ b/src/utils/SkBitmapHasher.cpp @@ -57,7 +57,7 @@ static inline uint64_t first_8_bytes_as_uint64(const uint8_t *bytearray) { // Hmm, that didn't work. Maybe if we create a new // kARGB_8888_Config version of the bitmap it will work better? SkBitmap copyBitmap; - if (!bitmap.copyTo(©Bitmap, kPMColor_SkColorType)) { + if (!bitmap.copyTo(©Bitmap, kN32_SkColorType)) { return false; } return ComputeDigestInternal(copyBitmap, result); diff --git a/src/utils/SkCanvasStateUtils.cpp b/src/utils/SkCanvasStateUtils.cpp index c5b558a1fb..64f62dd8b1 100644 --- a/src/utils/SkCanvasStateUtils.cpp +++ b/src/utils/SkCanvasStateUtils.cpp @@ -223,7 +223,7 @@ SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas* canvas) { layerState->height = bitmap.height(); switch (bitmap.colorType()) { - case kPMColor_SkColorType: + case kN32_SkColorType: layerState->raster.config = kARGB_8888_RasterConfig; break; case kRGB_565_SkColorType: @@ -281,7 +281,7 @@ static SkCanvas* create_canvas_from_canvas_layer(const SkCanvasLayerState& layer SkBitmap bitmap; SkColorType colorType = - layerState.raster.config == kARGB_8888_RasterConfig ? kPMColor_SkColorType : + layerState.raster.config == kARGB_8888_RasterConfig ? kN32_SkColorType : layerState.raster.config == kRGB_565_RasterConfig ? kRGB_565_SkColorType : kUnknown_SkColorType; diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp index 7687c3c7e4..00166e9ed7 100644 --- a/src/utils/mac/SkCreateCGImageRef.cpp +++ b/src/utils/mac/SkCreateCGImageRef.cpp @@ -34,7 +34,7 @@ static bool getBitmapInfo(const SkBitmap& bm, *upscaleTo32 = true; } // fall through - case kPMColor_SkColorType: + case kN32_SkColorType: *bitsPerComponent = 8; #if SK_PMCOLOR_BYTE_ORDER(R,G,B,A) *info = kCGBitmapByteOrder32Big; @@ -94,7 +94,7 @@ static SkBitmap* prepareForImageRef(const SkBitmap& bm, copy = new SkBitmap; // here we make a ceep copy of the pixels, since CG won't take our // 565 directly - bm.copyTo(copy, kPMColor_SkColorType); + bm.copyTo(copy, kN32_SkColorType); } else { copy = new SkBitmap(bm); } diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp index cca291a4e9..8f6b96f0e1 100644 --- a/src/views/SkWindow.cpp +++ b/src/views/SkWindow.cpp @@ -53,7 +53,7 @@ SkWindow::SkWindow() : fFocusView(NULL) { #ifdef SK_BUILD_FOR_WINCE fColorType = kRGB_565_SkColorType; #else - fColorType = kPMColor_SkColorType; + fColorType = kN32_SkColorType; #endif fMatrix.reset(); diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm index 1014ffe04d..80bfd670ef 100644 --- a/src/views/mac/SkNSView.mm +++ b/src/views/mac/SkNSView.mm @@ -57,7 +57,7 @@ SK_COMPILE_ASSERT(SK_SUPPORT_GPU, not_implemented_for_non_gpu_build); size = [self convertSizeToBacking:self.frame.size]; #endif fWind->resize((int) size.width, (int) size.height, - kPMColor_SkColorType); + kN32_SkColorType); } } diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp index f734ad8356..74f4ac9d34 100644 --- a/tests/BitmapCopyTest.cpp +++ b/tests/BitmapCopyTest.cpp @@ -188,7 +188,7 @@ static const Pair gPairs[] = { { kIndex_8_SkColorType, "011101" }, { kRGB_565_SkColorType, "010101" }, { kARGB_4444_SkColorType, "010111" }, - { kPMColor_SkColorType, "010111" }, + { kN32_SkColorType, "010111" }, }; static const int W = 20; @@ -364,7 +364,7 @@ DEF_TEST(BitmapCopy, reporter) { } break; - case kPMColor_SkColorType: + case kN32_SkColorType: if (safeSize != 0x8E1BC9BF040000LL) { sizeFail = true; } diff --git a/tests/BitmapGetColorTest.cpp b/tests/BitmapGetColorTest.cpp index 28f3cb309d..bf6ebcb5cf 100644 --- a/tests/BitmapGetColorTest.cpp +++ b/tests/BitmapGetColorTest.cpp @@ -22,9 +22,9 @@ DEF_TEST(GetColor, reporter) { { kAlpha_8_SkColorType, 0, 0 }, { kRGB_565_SkColorType, 0xFF00FF00, 0xFF00FF00 }, { kRGB_565_SkColorType, 0xFFFF00FF, 0xFFFF00FF }, - { kPMColor_SkColorType, 0xFFFFFFFF, 0xFFFFFFFF }, - { kPMColor_SkColorType, 0, 0 }, - { kPMColor_SkColorType, 0xFF224466, 0xFF224466 }, + { kN32_SkColorType, 0xFFFFFFFF, 0xFFFFFFFF }, + { kN32_SkColorType, 0, 0 }, + { kN32_SkColorType, 0xFF224466, 0xFF224466 }, }; // specify an area that doesn't touch (0,0) and may extend beyond the diff --git a/tests/BitmapTest.cpp b/tests/BitmapTest.cpp index 0167d52d02..dce1069542 100644 --- a/tests/BitmapTest.cpp +++ b/tests/BitmapTest.cpp @@ -25,7 +25,7 @@ static void test_bigwidth(skiatest::Reporter* reporter) { // TODO: perhaps skia can relax this, and only require that rowBytes fit // in a uint32_t (or larger), but for now this is the constraint. - info.fColorType = kPMColor_SkColorType; + info.fColorType = kN32_SkColorType; REPORTER_ASSERT(reporter, !bm.setConfig(info)); } diff --git a/tests/BlitRowTest.cpp b/tests/BlitRowTest.cpp index b8ac0c06c7..911f2a0f40 100644 --- a/tests/BlitRowTest.cpp +++ b/tests/BlitRowTest.cpp @@ -63,7 +63,7 @@ static int proc_bad(const void*, int, uint32_t, uint32_t* bad) { static Proc find_proc(const SkBitmap& bm, SkPMColor expect32, uint16_t expect16, uint8_t expect8, uint32_t* expect) { switch (bm.colorType()) { - case kPMColor_SkColorType: + case kN32_SkColorType: *expect = expect32; return proc_32; case kARGB_4444_SkColorType: @@ -101,7 +101,7 @@ static void test_00_FF(skiatest::Reporter* reporter) { static const int W = 256; static const SkColorType gDstColorType[] = { - kPMColor_SkColorType, + kN32_SkColorType, kRGB_565_SkColorType, }; @@ -192,7 +192,7 @@ static void test_diagonal(skiatest::Reporter* reporter) { static const int H = W; static const SkColorType gDstColorType[] = { - kPMColor_SkColorType, + kN32_SkColorType, kRGB_565_SkColorType, }; diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp index b2ecb0f3ab..705f0666a4 100644 --- a/tests/CachedDecodingPixelRefTest.cpp +++ b/tests/CachedDecodingPixelRefTest.cpp @@ -189,7 +189,7 @@ public: } info->fWidth = TestImageGenerator::Width(); info->fHeight = TestImageGenerator::Height(); - info->fColorType = kPMColor_SkColorType; + info->fColorType = kN32_SkColorType; info->fAlphaType = kOpaque_SkAlphaType; return true; } @@ -202,7 +202,7 @@ public: REPORTER_ASSERT(fReporter, rowBytes >= minRowBytes); if ((NULL == pixels) || (fType != kSucceedGetPixels_TestType) - || (info.fColorType != kPMColor_SkColorType)) { + || (info.fColorType != kN32_SkColorType)) { return false; } char* bytePtr = static_cast<char*>(pixels); diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp index 212b14ab3e..5c7e4738c2 100644 --- a/tests/CanvasStateTest.cpp +++ b/tests/CanvasStateTest.cpp @@ -26,7 +26,7 @@ static void test_complex_layers(skiatest::Reporter* reporter) { SkIntToScalar((HEIGHT-(2*SPACER)) / 7)); const SkColorType colorTypes[] = { - kRGB_565_SkColorType, kPMColor_SkColorType + kRGB_565_SkColorType, kN32_SkColorType }; const int configCount = sizeof(colorTypes) / sizeof(SkBitmap::Config); diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index f778480bcb..9912643566 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -25,7 +25,7 @@ public: virtual bool getInfo(SkImageInfo* info) SK_OVERRIDE { info->fWidth = 100; info->fHeight = 100; - info->fColorType = kPMColor_SkColorType; + info->fColorType = kN32_SkColorType; info->fAlphaType = kPremul_SkAlphaType; return true; } diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp index 7b2f988ffc..5d52f906b2 100644 --- a/tests/ImageDecodingTest.cpp +++ b/tests/ImageDecodingTest.cpp @@ -395,7 +395,7 @@ static inline const char* SkColorType_to_string(SkColorType colorType) { case kAlpha_8_SkColorType: return "Alpha_8"; case kRGB_565_SkColorType: return "RGB_565"; case kARGB_4444_SkColorType: return "ARGB_4444"; - case kPMColor_SkColorType: return "PMColor"; + case kN32_SkColorType: return "N32"; case kBackwards_SkColorType: return "Backwards"; case kIndex_8_SkColorType: return "Index_8"; default: return "ERROR"; @@ -537,7 +537,7 @@ DEF_TEST(ImageDecoderOptions, reporter) { kAlpha_8_SkColorType, kRGB_565_SkColorType, kARGB_4444_SkColorType, // Most decoders will fail on 4444. - kPMColor_SkColorType + kN32_SkColorType // Note that indexed color is left out of the list. Lazy // decoding doesn't do indexed color. }; diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp index 0ed062e681..804a7c4abe 100644 --- a/tests/ReadPixelsTest.cpp +++ b/tests/ReadPixelsTest.cpp @@ -381,7 +381,7 @@ DEF_GPUTEST(ReadPixels, reporter, factory) { SkIRect clippedRect = DEV_RECT; if (clippedRect.intersect(srcRect)) { REPORTER_ASSERT(reporter, success); - REPORTER_ASSERT(reporter, kPMColor_SkColorType == wkbmp.colorType()); + REPORTER_ASSERT(reporter, kN32_SkColorType == wkbmp.colorType()); REPORTER_ASSERT(reporter, kPremul_SkAlphaType == wkbmp.alphaType()); checkRead(reporter, wkbmp, clippedRect.fLeft, clippedRect.fTop, true, false); diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp index dfc7afa4fc..a039e55d02 100644 --- a/tests/SerializationTest.cpp +++ b/tests/SerializationTest.cpp @@ -233,7 +233,7 @@ static void TestBitmapSerialization(const SkBitmap& validBitmap, static bool setup_bitmap_for_canvas(SkBitmap* bitmap) { SkImageInfo info = SkImageInfo::Make( - kBitmapSize, kBitmapSize, kPMColor_SkColorType, kPremul_SkAlphaType); + kBitmapSize, kBitmapSize, kN32_SkColorType, kPremul_SkAlphaType); return bitmap->allocPixels(info); } diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index 705ea14989..a3efd971d8 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -151,7 +151,7 @@ static void test_imagepeek(skiatest::Reporter* reporter) { if (success) { REPORTER_ASSERT(reporter, 10 == info.fWidth); REPORTER_ASSERT(reporter, 10 == info.fHeight); - REPORTER_ASSERT(reporter, kPMColor_SkColorType == info.fColorType); + REPORTER_ASSERT(reporter, kN32_SkColorType == info.fColorType); REPORTER_ASSERT(reporter, kPremul_SkAlphaType == info.fAlphaType || kOpaque_SkAlphaType == info.fAlphaType); REPORTER_ASSERT(reporter, info.minRowBytes() <= rowBytes); diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index a1c978d1b1..a0e3051680 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -213,7 +213,7 @@ static bool checkWrite(skiatest::Reporter* reporter, SkCanvas* canvas, const SkB if (canvasInfo.width() != DEV_W || canvasInfo.height() != DEV_H || - canvasInfo.colorType() != kPMColor_SkColorType) { + canvasInfo.colorType() != kN32_SkColorType) { return false; } diff --git a/tools/skdiff_utils.cpp b/tools/skdiff_utils.cpp index 2f052395c8..5ca3d8085d 100644 --- a/tools/skdiff_utils.cpp +++ b/tools/skdiff_utils.cpp @@ -85,7 +85,7 @@ static void force_all_opaque(const SkBitmap& bitmap) { bool write_bitmap(const SkString& path, const SkBitmap& bitmap) { SkBitmap copy; - bitmap.copyTo(©, kPMColor_SkColorType); + bitmap.copyTo(©, kN32_SkColorType); force_all_opaque(copy); return SkImageEncoder::EncodeFile(path.c_str(), copy, SkImageEncoder::kPNG_Type, 100); diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp index 5e5953e186..e5610ea569 100644 --- a/tools/skimage_main.cpp +++ b/tools/skimage_main.cpp @@ -164,7 +164,7 @@ static bool write_bitmap(const char outDir[], const char src[], return true; } - if (bm.colorType() == kPMColor_SkColorType) { + if (bm.colorType() == kN32_SkColorType) { // First attempt at encoding failed, and the bitmap was already 8888. Making // a copy is not going to help. return false; @@ -172,7 +172,7 @@ static bool write_bitmap(const char outDir[], const char src[], // Encoding failed. Copy to 8888 and try again. SkBitmap bm8888; - if (!bm.copyTo(&bm8888, kPMColor_SkColorType)) { + if (!bm.copyTo(&bm8888, kN32_SkColorType)) { return false; } return SkImageEncoder::EncodeFile(filename.c_str(), bm8888, SkImageEncoder::kPNG_Type, 100); diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp index b9c55c1fa7..6f0b09f082 100644 --- a/tools/skpdiff/SkDiffContext.cpp +++ b/tools/skpdiff/SkDiffContext.cpp @@ -122,7 +122,7 @@ void SkDiffContext::addDiff(const char* baselinePath, const char* testPath) { // compute the image diff and output it SkBitmap copy; - diffData.fResult.poiAlphaMask.copyTo(©, kPMColor_SkColorType); + diffData.fResult.poiAlphaMask.copyTo(©, kN32_SkColorType); SkImageEncoder::EncodeFile(newRecord->fDifferencePath.c_str(), copy, SkImageEncoder::kPNG_Type, 100); diff --git a/tools/skpdiff/SkPMetric.cpp b/tools/skpdiff/SkPMetric.cpp index ed807636b6..beba4974b7 100644 --- a/tools/skpdiff/SkPMetric.cpp +++ b/tools/skpdiff/SkPMetric.cpp @@ -125,8 +125,8 @@ static void adobergb_to_cielab(float r, float g, float b, LAB* lab) { /// Converts a 8888 bitmap to LAB color space and puts it into the output static bool bitmap_to_cielab(const SkBitmap* bitmap, ImageLAB* outImageLAB) { SkBitmap bm8888; - if (bitmap->colorType() != kPMColor_SkColorType) { - if (!bitmap->copyTo(&bm8888, kPMColor_SkColorType)) { + if (bitmap->colorType() != kN32_SkColorType) { + if (!bitmap->copyTo(&bm8888, kN32_SkColorType)) { return false; } bitmap = &bm8888; |