diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-28 17:49:06 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-28 17:49:06 +0000 |
commit | 7d562b202c9e62d35430d4bce4b1421acdcb99c8 (patch) | |
tree | 9942d5b0d1e1bb592f34338bd206337fdc29e589 /base | |
parent | 4a056cba8eb1076db6f4f61e225d3bbbe4f7aea2 (diff) | |
download | chromium_src-7d562b202c9e62d35430d4bce4b1421acdcb99c8.zip chromium_src-7d562b202c9e62d35430d4bce4b1421acdcb99c8.tar.gz chromium_src-7d562b202c9e62d35430d4bce4b1421acdcb99c8.tar.bz2 |
* Revert "Start writing the GTK code for test_shell."
This reverts commit 54dfed3ab933cea7492ae1ed2f35cdbfe822e8a4.
Review URL: http://codereview.chromium.org/8839
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/gfx/bitmap_platform_device_linux.cc | 36 | ||||
-rw-r--r-- | base/gfx/bitmap_platform_device_linux.h | 23 | ||||
-rw-r--r-- | base/gfx/platform_canvas_linux.cc | 1 |
3 files changed, 12 insertions, 48 deletions
diff --git a/base/gfx/bitmap_platform_device_linux.cc b/base/gfx/bitmap_platform_device_linux.cc index 0569609..171f6b9 100644 --- a/base/gfx/bitmap_platform_device_linux.cc +++ b/base/gfx/bitmap_platform_device_linux.cc @@ -6,8 +6,7 @@ #include "base/logging.h" -#include "gdk/gdk.h" -#include "gdk-pixbuf/gdk-pixbuf.h" +#include <time.h> namespace gfx { @@ -17,39 +16,26 @@ namespace gfx { // data. BitmapPlatformDeviceLinux* BitmapPlatformDeviceLinux::Create( int width, int height, bool is_opaque) { - GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, width, height); - if (!pixbuf) - return NULL; - - DCHECK_EQ(gdk_pixbuf_get_colorspace(pixbuf), GDK_COLORSPACE_RGB); - DCHECK_EQ(gdk_pixbuf_get_bits_per_sample(pixbuf), 8); - DCHECK(gdk_pixbuf_get_has_alpha(pixbuf)); - DCHECK_EQ(gdk_pixbuf_get_n_channels(pixbuf), 4); - DCHECK_EQ(gdk_pixbuf_get_width(pixbuf), width); - DCHECK_EQ(gdk_pixbuf_get_height(pixbuf), height); - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, - gdk_pixbuf_get_rowstride(pixbuf)); - bitmap.setPixels(gdk_pixbuf_get_pixels(pixbuf)); + bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); bitmap.setIsOpaque(is_opaque); -#ifndef NDEBUG if (is_opaque) { +#ifndef NDEBUG + // To aid in finding bugs, we set the background color to something + // obviously wrong so it will be noticable when it is not cleared bitmap.eraseARGB(255, 0, 255, 128); // bright bluish green - } #endif + } // The device object will take ownership of the graphics context. - return new BitmapPlatformDeviceLinux(bitmap, pixbuf); + return new BitmapPlatformDeviceLinux(bitmap); } // The device will own the bitmap, which corresponds to also owning the pixel // data. Therefore, we do not transfer ownership to the SkDevice's bitmap. -BitmapPlatformDeviceLinux::BitmapPlatformDeviceLinux(const SkBitmap& bitmap, - GdkPixbuf* pixbuf) - : PlatformDeviceLinux(bitmap), - pixbuf_(pixbuf) { +BitmapPlatformDeviceLinux::BitmapPlatformDeviceLinux(const SkBitmap& bitmap) + : PlatformDeviceLinux(bitmap) { } BitmapPlatformDeviceLinux::BitmapPlatformDeviceLinux( @@ -59,10 +45,6 @@ BitmapPlatformDeviceLinux::BitmapPlatformDeviceLinux( } BitmapPlatformDeviceLinux::~BitmapPlatformDeviceLinux() { - if (pixbuf_) { - g_object_unref(pixbuf_); - pixbuf_ = NULL; - } } } // namespace gfx diff --git a/base/gfx/bitmap_platform_device_linux.h b/base/gfx/bitmap_platform_device_linux.h index 96a640c..3059c2c 100644 --- a/base/gfx/bitmap_platform_device_linux.h +++ b/base/gfx/bitmap_platform_device_linux.h @@ -8,22 +8,10 @@ #include "base/gfx/platform_device_linux.h" #include "base/ref_counted.h" -#include "gdk-pixbuf/gdk-pixbuf.h" - namespace gfx { -// ----------------------------------------------------------------------------- -// 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. -// ----------------------------------------------------------------------------- +// I'm trying to get away with defining as little as possible on this. Right +// now, we don't do anything. class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { public: /// Static constructor. I don't understand this, it's just a copy of the mac @@ -34,7 +22,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, GdkPixbuf* pixbuf); + BitmapPlatformDeviceLinux(const SkBitmap& other); virtual ~BitmapPlatformDeviceLinux(); // A stub copy constructor. Needs to be properly implemented. @@ -42,11 +30,6 @@ class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { // Bitmaps aren't vector graphics. virtual bool IsVectorial() { return false; } - - GdkPixbuf* pixbuf() const { return pixbuf_; } - - private: - GdkPixbuf* pixbuf_; }; } // namespace gfx diff --git a/base/gfx/platform_canvas_linux.cc b/base/gfx/platform_canvas_linux.cc index 63ed3c2..71bc8f08 100644 --- a/base/gfx/platform_canvas_linux.cc +++ b/base/gfx/platform_canvas_linux.cc @@ -4,7 +4,6 @@ #include "base/gfx/platform_canvas_linux.h" -#include "base/gfx/platform_device_linux.h" #include "base/gfx/bitmap_platform_device_linux.h" #include "base/logging.h" |