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

Unified Diff: include/core/SkBitmapDevice.h

Issue 168653002: Change device factories to take SkImageInfo instead of SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix PdfViewer Created 6 years, 10 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 | « experimental/PdfViewer/SkTrackDevice.h ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkBitmapDevice.h
diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h
index be98c958829e2344b492ee7c96ea4219a0cd8d63..1d181555e0bd882652e5c199e2a8b34c4c30d540 100644
--- a/include/core/SkBitmapDevice.h
+++ b/include/core/SkBitmapDevice.h
@@ -30,6 +30,7 @@ public:
*/
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 @@ public:
*/
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 @@ protected:
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 @@ private:
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.
*/
« no previous file with comments | « experimental/PdfViewer/SkTrackDevice.h ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698