diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-13 22:18:58 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-13 22:18:58 +0000 |
commit | a2d489b22f9e3f361adeaf7a09ae88510a2bb1e3 (patch) | |
tree | ff3dd61a3278c60286a820e9f07952e4571743e5 /skia | |
parent | 16ead307a2b27b7d02bae66792eaf3c2f904b9c0 (diff) | |
download | chromium_src-a2d489b22f9e3f361adeaf7a09ae88510a2bb1e3.zip chromium_src-a2d489b22f9e3f361adeaf7a09ae88510a2bb1e3.tar.gz chromium_src-a2d489b22f9e3f361adeaf7a09ae88510a2bb1e3.tar.bz2 |
Basic windowless plugins, try 2.
In response to Dean's comment on http://codereview.chromium.org/39105,
I redid that patch to put the X munging into the plugin implementation. This
won't work for multiproc, but it's near the correct place and many things will
need to be changed for multiproc.
Review URL: http://codereview.chromium.org/42056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11674 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/bitmap_platform_device_linux.h | 4 | ||||
-rw-r--r-- | skia/ext/platform_canvas_linux.cc | 4 | ||||
-rw-r--r-- | skia/ext/platform_canvas_linux.h | 7 | ||||
-rw-r--r-- | skia/ext/platform_device_linux.h | 4 |
4 files changed, 19 insertions, 0 deletions
diff --git a/skia/ext/bitmap_platform_device_linux.h b/skia/ext/bitmap_platform_device_linux.h index d26c50d..bb261bd 100644 --- a/skia/ext/bitmap_platform_device_linux.h +++ b/skia/ext/bitmap_platform_device_linux.h @@ -85,6 +85,10 @@ class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { // Bitmaps aren't vector graphics. virtual bool IsVectorial() { return false; } + // If someone wants to paint on a Cairo surface version of our + // buffer, then give them the surface we're already using. + virtual cairo_surface_t* beginPlatformPaint() { return surface(); } + cairo_surface_t* surface() const; private: diff --git a/skia/ext/platform_canvas_linux.cc b/skia/ext/platform_canvas_linux.cc index 422693c..a4e080f 100644 --- a/skia/ext/platform_canvas_linux.cc +++ b/skia/ext/platform_canvas_linux.cc @@ -53,6 +53,10 @@ bool PlatformCanvasLinux::initialize(int width, int height, bool is_opaque, return true; } +cairo_surface_t* PlatformCanvasLinux::beginPlatformPaint() { + return getTopPlatformDevice().beginPlatformPaint(); +} + PlatformDeviceLinux& PlatformCanvasLinux::getTopPlatformDevice() const { // All of our devices should be our special PlatformDevice. SkCanvas::LayerIter iter(const_cast<PlatformCanvasLinux*>(this), false); diff --git a/skia/ext/platform_canvas_linux.h b/skia/ext/platform_canvas_linux.h index 1cf87a8..a1cd1ab 100644 --- a/skia/ext/platform_canvas_linux.h +++ b/skia/ext/platform_canvas_linux.h @@ -32,6 +32,13 @@ class PlatformCanvasLinux : public SkCanvas { bool initialize(int width, int height, bool is_opaque); bool initialize(int width, int height, bool is_opaque, uint8_t* data); + // These calls should surround calls to platform-specific drawing routines. + // The cairo_surface_t* returned by beginPlatformPaint represents the + // memory that can be used to draw into. + // endPlatformPaint is a no-op; it is used for symmetry with Windows. + cairo_surface_t* beginPlatformPaint(); + void endPlatformPaint() {} + // Returns the platform device pointer of the topmost rect with a non-empty // clip. Both the windows and mac versions have an equivalent of this method; // a Linux version is added for compatibility. diff --git a/skia/ext/platform_device_linux.h b/skia/ext/platform_device_linux.h index 5c16c08..eae8965 100644 --- a/skia/ext/platform_device_linux.h +++ b/skia/ext/platform_device_linux.h @@ -7,6 +7,8 @@ #include "SkDevice.h" +typedef struct _cairo_surface cairo_surface_t; + namespace skia { // Blindly copying the mac hierarchy. @@ -15,6 +17,8 @@ class PlatformDeviceLinux : public SkDevice { // Returns if the preferred rendering engine is vectorial or bitmap based. virtual bool IsVectorial() = 0; + virtual cairo_surface_t* beginPlatformPaint() = 0; + protected: // Forwards |bitmap| to SkDevice's constructor. PlatformDeviceLinux(const SkBitmap& bitmap); |