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

Unified Diff: include/core/SkCanvas.h

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 | « include/core/SkBitmapDevice.h ('k') | include/core/SkDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 0d8fd463fe2f5648a31f0d4b9f27fefef9e6dbf5..23319317b74a27c2dbd258b4efe1716b8ca1c43c 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -18,14 +18,6 @@
#include "SkRegion.h"
#include "SkXfermode.h"
-//#define SK_SUPPORT_LEGACY_READPIXELSCONFIG
-
-#ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG
- #ifndef SK_SUPPORT_LEGACY_CONFIG8888
- #define SK_SUPPORT_LEGACY_CONFIG8888
- #endif
-#endif
-
// if not defined, we always assume ClipToLayer for saveLayer()
//#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
@@ -237,83 +229,6 @@ public:
*/
const void* peekPixels(SkImageInfo* info, size_t* rowBytes);
-#ifdef SK_SUPPORT_LEGACY_CONFIG8888
- /**
- * This enum can be used with read/writePixels to perform a pixel ops to or
- * from an 8888 config other than Skia's native config (SkPMColor). There
- * are three byte orders supported: native, BGRA, and RGBA. Each has a
- * premultiplied and unpremultiplied variant.
- *
- * Components of a 8888 pixel can be packed/unpacked from a 32bit word using
- * either byte offsets or shift values. Byte offsets are endian-invariant
- * while shifts are not. BGRA and RGBA configs are defined by byte
- * orderings. The native config is defined by shift values (SK_A32_SHIFT,
- * ..., SK_B32_SHIFT).
- */
- enum Config8888 {
- /**
- * Skia's native order specified by:
- * SK_A32_SHIFT, SK_R32_SHIFT, SK_G32_SHIFT, and SK_B32_SHIFT
- *
- * kNative_Premul_Config8888 is equivalent to SkPMColor
- * kNative_Unpremul_Config8888 has the same component order as SkPMColor
- * but is not premultiplied.
- */
- kNative_Premul_Config8888,
- kNative_Unpremul_Config8888,
- /**
- * low byte to high byte: B, G, R, A.
- */
- kBGRA_Premul_Config8888,
- kBGRA_Unpremul_Config8888,
- /**
- * low byte to high byte: R, G, B, A.
- */
- kRGBA_Premul_Config8888,
- kRGBA_Unpremul_Config8888
- };
-#endif
-
-#ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG
- /**
- * On success (returns true), copy the canvas pixels into the bitmap.
- * On failure, the bitmap parameter is left unchanged and false is
- * returned.
- *
- * The canvas' pixels are converted to the bitmap's config. The only
- * supported config is kARGB_8888_Config, though this is likely to be
- * relaxed in the future. The meaning of config kARGB_8888_Config is
- * modified by the enum param config8888. The default value interprets
- * kARGB_8888_Config as SkPMColor
- *
- * If the bitmap has pixels already allocated, the canvas pixels will be
- * written there. If not, bitmap->allocPixels() will be called
- * automatically. If the bitmap is backed by a texture readPixels will
- * fail.
- *
- * The actual pixels written is the intersection of the canvas' bounds, and
- * the rectangle formed by the bitmap's width,height and the specified x,y.
- * If bitmap pixels extend outside of that intersection, they will not be
- * modified.
- *
- * Other failure conditions:
- * * If the canvas is backed by a non-raster device (e.g. PDF) then
- * readPixels will fail.
- * * If bitmap is texture-backed then readPixels will fail. (This may be
- * relaxed in the future.)
- *
- * Example that reads the entire canvas into a bitmap using the native
- * SkPMColor:
- * SkISize size = canvas->getDeviceSize();
- * bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
- * size.fHeight);
- * if (canvas->readPixels(bitmap, 0, 0)) {
- * // use the pixels
- * }
- */
- bool readPixels(SkBitmap* bitmap, int x, int y, Config8888 config8888);
-#endif
-
/**
* Copy the pixels from the base-layer into the specified buffer (pixels + rowBytes),
* converting them into the requested format (SkImageInfo). The base-layer pixels are read
@@ -846,7 +761,7 @@ public:
width/height will be the edge color replicated.
If a shader is present on the paint it will be ignored, except in the
- case where the bitmap is kA8_Config. In that case, the color is
+ case where the bitmap is kAlpha_8_SkColorType. In that case, the color is
generated by the shader.
@param bitmap The bitmap to be drawn
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698