Index: skia/ext/platform_device_win.h |
=================================================================== |
--- skia/ext/platform_device_win.h (revision 97282) |
+++ skia/ext/platform_device_win.h (working copy) |
@@ -21,12 +21,15 @@ |
// Initializes the default settings and colors in a device context. |
SK_API void InitializeDC(HDC context); |
-// A device is basically a wrapper around SkBitmap that provides a surface for |
-// SkCanvas to draw into. Our device provides a surface Windows can also write |
-// to. It also provides functionality to play well with GDI drawing functions. |
-// This class is abstract and must be subclassed. It provides the basic |
+// A SkDevice is basically a wrapper around SkBitmap that provides a surface for |
+// SkCanvas to draw into. PlatformDevice provides a surface Windows can also |
+// write to. It also provides functionality to play well with GDI drawing |
+// functions. This class is abstract and must be subclassed. It provides the basic |
// interface to implement it either with or without a bitmap backend. |
-class SK_API PlatformDevice : public SkDevice { |
+// |
+// PlatformDevice provides an interface which sub-classes of SkDevice can also |
+// provide to allow for drawing by the native platform into the device. |
+class SK_API PlatformDevice { |
public: |
typedef HDC PlatformSurface; |
@@ -57,6 +60,9 @@ |
// Used by the printing subclasses. See |VectorPlatformDeviceEmf|. |
virtual bool AlphaBlendUsed() const { return false; } |
+ // Return the SkDevice instance which is associated with this PlatformDevice. |
+ SkDevice* GetOwningDevice() const { return device_; } |
+ |
// Loads a SkPath into the GDI context. The path can there after be used for |
// clipping or as a stroke. Returns false if the path failed to be loaded. |
static bool LoadPathToDC(HDC context, const SkPath& path); |
@@ -73,8 +79,7 @@ |
typedef std::vector<CubicPoints> CubicPath; |
typedef std::vector<CubicPath> CubicPaths; |
- // Forwards |bitmap| to SkDevice's constructor. |
- PlatformDevice(const SkBitmap& bitmap); |
+ explicit PlatformDevice(SkDevice* device); |
// Loads the specified Skia transform into the device context, excluding |
// perspective (which GDI doesn't support). |
@@ -82,9 +87,11 @@ |
// Transforms SkPath's paths into a series of cubic path. |
static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); |
+ |
+ // The device to which the PlatformDevice interface is bound. |
+ SkDevice* device_; |
}; |
} // namespace skia |
#endif // SKIA_EXT_PLATFORM_DEVICE_WIN_H_ |
- |