From 99304a704db0fbb0f65dea844da7422a21763d58 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Tue, 14 Oct 2008 21:15:23 +0000 Subject: get webframe_impl.cc to compile on linux Includes changes from http://codereview.chromium.org/7244 by icefox (Torchmobile Inc.) Review URL: http://codereview.chromium.org/7319 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3366 0039d316-1c4b-4281-b951-d872f2087c98 --- base/gfx/bitmap_platform_device_linux.cc | 6 ++++++ base/gfx/bitmap_platform_device_linux.h | 3 +++ base/gfx/rect.cc | 15 +++++++++++++++ base/gfx/rect.h | 8 ++++++++ 4 files changed, 32 insertions(+) (limited to 'base') diff --git a/base/gfx/bitmap_platform_device_linux.cc b/base/gfx/bitmap_platform_device_linux.cc index 1211a15..171f6b9 100644 --- a/base/gfx/bitmap_platform_device_linux.cc +++ b/base/gfx/bitmap_platform_device_linux.cc @@ -38,6 +38,12 @@ BitmapPlatformDeviceLinux::BitmapPlatformDeviceLinux(const SkBitmap& bitmap) : PlatformDeviceLinux(bitmap) { } +BitmapPlatformDeviceLinux::BitmapPlatformDeviceLinux( + const BitmapPlatformDeviceLinux& other) + : PlatformDeviceLinux(const_cast( + other).accessBitmap(true)) { +} + BitmapPlatformDeviceLinux::~BitmapPlatformDeviceLinux() { } diff --git a/base/gfx/bitmap_platform_device_linux.h b/base/gfx/bitmap_platform_device_linux.h index 2bb5a24..f459d42 100644 --- a/base/gfx/bitmap_platform_device_linux.h +++ b/base/gfx/bitmap_platform_device_linux.h @@ -24,6 +24,9 @@ class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { /// the Windows and Mac versions of this class do. BitmapPlatformDeviceLinux(const SkBitmap& other); virtual ~BitmapPlatformDeviceLinux(); + + // A stub copy constructor. Needs to be properly implemented. + BitmapPlatformDeviceLinux(const BitmapPlatformDeviceLinux& other); }; } // namespace gfx diff --git a/base/gfx/rect.cc b/base/gfx/rect.cc index b7e2942..0f9708c 100644 --- a/base/gfx/rect.cc +++ b/base/gfx/rect.cc @@ -8,6 +8,8 @@ #include #elif defined(OS_MACOSX) #include +#elif defined(OS_LINUX) +#include #endif #include "base/logging.h" @@ -68,6 +70,19 @@ Rect& Rect::operator=(const CGRect& r) { set_height(r.size.height); return *this; } +#elif defined(OS_LINUX) +Rect::Rect(const GdkRectangle& r) + : origin_(r.x, r.y) { + set_width(r.width); + set_height(r.height); +} + +Rect& Rect::operator=(const GdkRectangle& r) { + origin_.SetPoint(r.x, r.y); + set_width(r.width); + set_height(r.height); + return *this; +} #endif void Rect::set_width(int width) { diff --git a/base/gfx/rect.h b/base/gfx/rect.h index 963470a..a7a3d9c 100644 --- a/base/gfx/rect.h +++ b/base/gfx/rect.h @@ -17,6 +17,10 @@ #if defined(OS_WIN) typedef struct tagRECT RECT; +#elif defined(OS_LINUX) +// It's wrong to hide GDK stuff behind OS_LINUX, but until we have a different +// linux target, this is less complex. +typedef struct _GdkRectangle GdkRectangle; #endif namespace gfx { @@ -30,6 +34,8 @@ class Rect { explicit Rect(const RECT& r); #elif defined(OS_MACOSX) explicit Rect(const CGRect& r); +#elif defined(OS_LINUX) + explicit Rect(const GdkRectangle& r); #endif Rect(const gfx::Point& origin, const gfx::Size& size); @@ -39,6 +45,8 @@ class Rect { Rect& operator=(const RECT& r); #elif defined(OS_MACOSX) Rect& operator=(const CGRect& r); +#elif defined(OS_LINUX) + Rect& operator=(const GdkRectangle& r); #endif int x() const { return origin_.x(); } -- cgit v1.1