diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 18:07:56 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 18:07:56 +0000 |
commit | c09b65412f771fecbbe24c6f7e6232c9edbe5022 (patch) | |
tree | 7bebfa16d1b1fb280b952d122c1bccada8c916bd /base/gfx/bitmap_platform_device_linux.h | |
parent | 87221b1b14635992cbdeb95b6680fcacf626dfb4 (diff) | |
download | chromium_src-c09b65412f771fecbbe24c6f7e6232c9edbe5022.zip chromium_src-c09b65412f771fecbbe24c6f7e6232c9edbe5022.tar.gz chromium_src-c09b65412f771fecbbe24c6f7e6232c9edbe5022.tar.bz2 |
Start writing the GTK code for test_shell.
Review URL: http://codereview.chromium.org/8000
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/gfx/bitmap_platform_device_linux.h')
-rw-r--r-- | base/gfx/bitmap_platform_device_linux.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/base/gfx/bitmap_platform_device_linux.h b/base/gfx/bitmap_platform_device_linux.h index 3059c2c..96a640c 100644 --- a/base/gfx/bitmap_platform_device_linux.h +++ b/base/gfx/bitmap_platform_device_linux.h @@ -8,10 +8,22 @@ #include "base/gfx/platform_device_linux.h" #include "base/ref_counted.h" +#include "gdk-pixbuf/gdk-pixbuf.h" + namespace gfx { -// I'm trying to get away with defining as little as possible on this. Right -// now, we don't do anything. +// ----------------------------------------------------------------------------- +// This is the Linux bitmap backing for Skia. It's a GdkPixbuf of the correct +// size and we implement a SkPixelRef in order that Skia can write directly to +// the pixel memory backing the Pixbuf. +// +// We then provide an accessor for getting the pixbuf object and that can be +// drawn to a GDK drawing area to display the rendering result. +// +// This is all quite ok for test_shell. In the future we will want to use +// shared memory between the renderer and the main process at least. In this +// case we'll probably create the pixbuf from a precreated region of memory. +// ----------------------------------------------------------------------------- class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { public: /// Static constructor. I don't understand this, it's just a copy of the mac @@ -22,7 +34,7 @@ class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { /// you should probably be using Create(). This may become private later if /// we ever have to share state between some native drawing UI and Skia, like /// the Windows and Mac versions of this class do. - BitmapPlatformDeviceLinux(const SkBitmap& other); + BitmapPlatformDeviceLinux(const SkBitmap& other, GdkPixbuf* pixbuf); virtual ~BitmapPlatformDeviceLinux(); // A stub copy constructor. Needs to be properly implemented. @@ -30,6 +42,11 @@ class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { // Bitmaps aren't vector graphics. virtual bool IsVectorial() { return false; } + + GdkPixbuf* pixbuf() const { return pixbuf_; } + + private: + GdkPixbuf* pixbuf_; }; } // namespace gfx |