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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 211043002: remove all references to legacy Config8888 (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | « src/device/xps/SkXPSDevice.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 2a1b980aa96d43c62a5b9df5cece0ebe2132b571..a849c84e4ec71ba2e713ef3f4ab5c77a0dfa64bd 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -343,59 +343,6 @@ void SkGpuDevice::makeRenderTargetCurrent() {
///////////////////////////////////////////////////////////////////////////////
-#ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG
-namespace {
-GrPixelConfig config8888_to_grconfig_and_flags(SkCanvas::Config8888 config8888, uint32_t* flags) {
- switch (config8888) {
- case SkCanvas::kNative_Premul_Config8888:
- *flags = 0;
- return kSkia8888_GrPixelConfig;
- case SkCanvas::kNative_Unpremul_Config8888:
- *flags = GrContext::kUnpremul_PixelOpsFlag;
- return kSkia8888_GrPixelConfig;
- case SkCanvas::kBGRA_Premul_Config8888:
- *flags = 0;
- return kBGRA_8888_GrPixelConfig;
- case SkCanvas::kBGRA_Unpremul_Config8888:
- *flags = GrContext::kUnpremul_PixelOpsFlag;
- return kBGRA_8888_GrPixelConfig;
- case SkCanvas::kRGBA_Premul_Config8888:
- *flags = 0;
- return kRGBA_8888_GrPixelConfig;
- case SkCanvas::kRGBA_Unpremul_Config8888:
- *flags = GrContext::kUnpremul_PixelOpsFlag;
- return kRGBA_8888_GrPixelConfig;
- default:
- GrCrash("Unexpected Config8888.");
- *flags = 0; // suppress warning
- return kSkia8888_GrPixelConfig;
- }
-}
-}
-
-bool SkGpuDevice::onReadPixels(const SkBitmap& bitmap,
- int x, int y,
- SkCanvas::Config8888 config8888) {
- DO_DEFERRED_CLEAR();
- SkASSERT(SkBitmap::kARGB_8888_Config == bitmap.config());
- SkASSERT(!bitmap.isNull());
- SkASSERT(SkIRect::MakeWH(this->width(), this->height()).contains(SkIRect::MakeXYWH(x, y, bitmap.width(), bitmap.height())));
-
- SkAutoLockPixels alp(bitmap);
- GrPixelConfig config;
- uint32_t flags;
- config = config8888_to_grconfig_and_flags(config8888, &flags);
- return fContext->readRenderTargetPixels(fRenderTarget,
- x, y,
- bitmap.width(),
- bitmap.height(),
- config,
- bitmap.getPixels(),
- bitmap.rowBytes(),
- flags);
-}
-#endif
-
bool SkGpuDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
int x, int y) {
DO_DEFERRED_CLEAR();
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698