summaryrefslogtreecommitdiffstats
path: root/skia/ext/vector_canvas.h
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 06:00:29 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 06:00:29 +0000
commit01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b (patch)
tree3e15937592d13ee16813323327439f07f24a879b /skia/ext/vector_canvas.h
parent6903090e8ee9ab8c67977d139c4b51369ed70bc7 (diff)
downloadchromium_src-01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b.zip
chromium_src-01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b.tar.gz
chromium_src-01cec0a407740bd2b5b92a80b1cbaef8e5ee8f9b.tar.bz2
Revert 78812 - Unfork VectorPlatformCanvas.
Unfork VectorPlatformCanvas by making NativeMetafile know how to create an appropriate VectorPlatformDevice. This will also be useful when we have multiple NativeMetafile implemenations (each requiring a different VectorPlatformDevices). BUG=NONE TEST=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78662 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=78663 Review URL: http://codereview.chromium.org/6665046 TBR=vandebo@chromium.org Review URL: http://codereview.chromium.org/6708046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/vector_canvas.h')
-rw-r--r--skia/ext/vector_canvas.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/skia/ext/vector_canvas.h b/skia/ext/vector_canvas.h
index 4b4419d..4f8bc7a 100644
--- a/skia/ext/vector_canvas.h
+++ b/skia/ext/vector_canvas.h
@@ -7,10 +7,13 @@
#pragma once
#include "skia/ext/platform_canvas.h"
+#include "skia/ext/vector_platform_device.h"
-namespace skia {
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+typedef struct _cairo cairo_t;
+#endif
-class PlatformDevice;
+namespace skia {
// This class is a specialization of the regular PlatformCanvas. It is designed
// to work with a VectorDevice to manage platform-specific drawing. It allows
@@ -18,10 +21,24 @@ class PlatformDevice;
// support reading back from the bitmap backstore since it is not used.
class SK_API VectorCanvas : public PlatformCanvas {
public:
- // Ownership of |device| is transfered to VectorCanvas.
- explicit VectorCanvas(PlatformDevice* device);
+ VectorCanvas();
+ explicit VectorCanvas(SkDeviceFactory* factory);
+#if defined(WIN32)
+ VectorCanvas(HDC dc, int width, int height);
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ // Caller owns |context|. Ownership is not transferred.
+ VectorCanvas(cairo_t* context, int width, int height);
+#endif
virtual ~VectorCanvas();
+ // For two-part init, call if you use the no-argument constructor above
+#if defined(WIN32)
+ bool initialize(HDC context, int width, int height);
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ // Ownership of |context| is not transferred.
+ bool initialize(cairo_t* context, int width, int height);
+#endif
+
virtual SkBounder* setBounder(SkBounder* bounder);
virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter);