diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-08 14:37:48 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-08 14:37:48 +0000 |
commit | 60c671ca9dc52bb7c6a0bac0773d526d9060e87a (patch) | |
tree | 24885879abfe576ff8fa1f1b70a3cee3a8b69623 /skia/ext/vector_canvas.h | |
parent | fb630c1cdb74e955d343272a1c9b6ac2968e3a0c (diff) | |
download | chromium_src-60c671ca9dc52bb7c6a0bac0773d526d9060e87a.zip chromium_src-60c671ca9dc52bb7c6a0bac0773d526d9060e87a.tar.gz chromium_src-60c671ca9dc52bb7c6a0bac0773d526d9060e87a.tar.bz2 |
Pass printing result to the browser.
The resulting PDF file will now be passed to the browser and be saved as "chromium_printing_test.pdf" under current directory.
BUG=9847
TEST=printing on linux should now generate chromium_printing_test.pdf in download directory. Printing on Windows should still work.
Patch contributed by minyu.huang@gmail.com
Review URL: http://codereview.chromium.org/172115
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/vector_canvas.h')
-rw-r--r-- | skia/ext/vector_canvas.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/skia/ext/vector_canvas.h b/skia/ext/vector_canvas.h index 27f7598..d4f76f8 100644 --- a/skia/ext/vector_canvas.h +++ b/skia/ext/vector_canvas.h @@ -8,6 +8,10 @@ #include "skia/ext/platform_canvas.h" #include "skia/ext/vector_platform_device.h" +#if defined(__linux__) +typedef struct _cairo cairo_t; +#endif + namespace skia { // This class is a specialization of the regular PlatformCanvas. It is designed @@ -20,7 +24,8 @@ class VectorCanvas : public PlatformCanvas { #if defined(WIN32) VectorCanvas(HDC dc, int width, int height); #elif defined(__linux__) - VectorCanvas(int width, int height); + // Caller owns |context|. Ownership is not transferred. + VectorCanvas(cairo_t* context, int width, int height); #endif virtual ~VectorCanvas(); @@ -28,10 +33,11 @@ class VectorCanvas : public PlatformCanvas { #if defined(WIN32) bool initialize(HDC context, int width, int height); #elif defined(__linux__) - bool initialize(int width, int height); + // Ownership of |context| is not transferred. + bool initialize(cairo_t* context, int width, int height); #endif - virtual SkBounder* setBounder(SkBounder*); + virtual SkBounder* setBounder(SkBounder* bounder); #if defined(WIN32) || defined(__linux__) virtual SkDevice* createDevice(SkBitmap::Config config, int width, int height, @@ -40,12 +46,15 @@ class VectorCanvas : public PlatformCanvas { virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter); private: - // |is_opaque| is unused. |shared_section| is in fact the HDC used for output. #if defined(WIN32) + // |shared_section| is in fact the HDC used for output. |is_opaque| is unused. virtual SkDevice* createPlatformDevice(int width, int height, bool is_opaque, HANDLE shared_section); #elif defined(__linux__) - virtual SkDevice* createPlatformDevice(int width, int height, bool is_opaque); + // Ownership of |context| is not transferred. |is_opaque| is unused. + virtual SkDevice* createPlatformDevice(cairo_t* context, + int width, int height, + bool is_opaque); #endif // Returns true if the top device is vector based and not bitmap based. |