Change device factories to take SkImageInfo instead of SkBitmap::Config
patch from issue 167033002
BUG=skia:
R=reed@google.com
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/168653002
git-svn-id: http://skia.googlecode.com/svn/trunk@13463 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h
index be98c95..1d18155 100644
--- a/include/core/SkBitmapDevice.h
+++ b/include/core/SkBitmapDevice.h
@@ -30,6 +30,7 @@
*/
SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties& deviceProperties);
+#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
/**
* Create a new raster device and have the pixels be automatically
* allocated. The rowBytes of the device will be computed automatically
@@ -61,8 +62,9 @@
*/
SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque,
const SkDeviceProperties& deviceProperties);
-
- virtual ~SkBitmapDevice();
+#endif
+ static SkBitmapDevice* Create(const SkImageInfo&,
+ const SkDeviceProperties* = NULL);
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE { return 0; }
@@ -185,7 +187,7 @@
const uint16_t indices[], int indexCount,
const SkPaint& paint) SK_OVERRIDE;
/** The SkBaseDevice passed will be an SkBaseDevice which was returned by a call to
- onCreateCompatibleDevice on this device with kSaveLayer_Usage.
+ onCreateDevice on this device with kSaveLayer_Usage.
*/
virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
const SkPaint&) SK_OVERRIDE;
@@ -260,20 +262,17 @@
friend class SkSurface_Raster;
- void init(SkBitmap::Config config, int width, int height, bool isOpaque);
-
// used to change the backend's pixels (and possibly config/rowbytes)
// but cannot change the width/height, so there should be no change to
// any clip information.
virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRIDE;
- /**
- * Subclasses should override this to implement createCompatibleDevice.
- */
- virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config,
- int width, int height,
- bool isOpaque,
- Usage usage) SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
+ // in support of legacy constructors
+ void init(SkBitmap::Config config, int width, int height, bool isOpaque);
+#endif
+
+ virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
/** Causes any deferred drawing to the device to be completed.
*/