diff options
author | pvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-23 01:37:15 +0000 |
---|---|---|
committer | pvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-23 01:37:15 +0000 |
commit | b05be39e20ae9d70bc54c7511d8199517294a2dd (patch) | |
tree | 24750b9f4e7ce4061740c08027cea3855572c1af /app/gfx | |
parent | 53adb9a6d5c506d8df8a08adc092acd524a79753 (diff) | |
download | chromium_src-b05be39e20ae9d70bc54c7511d8199517294a2dd.zip chromium_src-b05be39e20ae9d70bc54c7511d8199517294a2dd.tar.gz chromium_src-b05be39e20ae9d70bc54c7511d8199517294a2dd.tar.bz2 |
OpenBSD/FreeBSD ifdefs and GYP changes for app/ directory
- Use OS_POSIX && !OS_MACOSX defines to capture Linux/*BSD as they
have many similarities, use other defines instead of OS_LINUX
where sensible.
Based on original work by Sprewell and Ben Laurie on FreeBSD port
Review URL: http://codereview.chromium.org/548126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36931 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gfx')
-rw-r--r-- | app/gfx/blit.cc | 6 | ||||
-rw-r--r-- | app/gfx/canvas.h | 4 | ||||
-rw-r--r-- | app/gfx/font.h | 12 | ||||
-rw-r--r-- | app/gfx/insets.h | 4 |
4 files changed, 12 insertions, 14 deletions
diff --git a/app/gfx/blit.cc b/app/gfx/blit.cc index 359e142..99ac09f 100644 --- a/app/gfx/blit.cc +++ b/app/gfx/blit.cc @@ -4,7 +4,7 @@ #include "app/gfx/blit.h" -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) #include <cairo/cairo.h> #endif @@ -45,7 +45,7 @@ void BlitContextToContext(NativeDrawingContext dst_context, scoped_cftyperef<CGImageRef> src_sub_image( CGImageCreateWithImageInRect(src_image, src_rect.ToCGRect())); CGContextDrawImage(dst_context, dst_rect.ToCGRect(), src_sub_image); -#elif defined(OS_LINUX) +#else // Linux, BSD, others // Only translations in the source context are supported; more complex // source context transforms will be ignored. cairo_save(dst_context); @@ -69,7 +69,7 @@ static NativeDrawingContext GetContextFromCanvas( return device.getBitmapDC(); #elif defined(OS_MACOSX) return device.GetBitmapContext(); -#elif defined(OS_LINUX) +#else // Linux, BSD, others return device.beginPlatformPaint(); #endif } diff --git a/app/gfx/canvas.h b/app/gfx/canvas.h index e6b07a1..e59db16 100644 --- a/app/gfx/canvas.h +++ b/app/gfx/canvas.h @@ -14,7 +14,7 @@ #include "base/basictypes.h" #include "skia/ext/platform_canvas.h" -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) typedef struct _cairo cairo_t; typedef struct _GdkPixbuf GdkPixbuf; #endif @@ -192,7 +192,7 @@ class Canvas : public skia::PlatformCanvas { // Extracts a bitmap from the contents of this canvas. SkBitmap ExtractBitmap() const; -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) // Applies current matrix on the canvas to the cairo context. This should be // invoked anytime you plan on drawing directly to the cairo context. Be // sure and set the matrix back to the identity when done. diff --git a/app/gfx/font.h b/app/gfx/font.h index 6be42ee..f79f6d0 100644 --- a/app/gfx/font.h +++ b/app/gfx/font.h @@ -11,7 +11,7 @@ #if defined(OS_WIN) typedef struct HFONT__* HFONT; -#elif defined(OS_LINUX) +#elif !defined(OS_MACOSX) #include "third_party/skia/include/core/SkRefCnt.h" class SkPaint; class SkTypeface; @@ -26,12 +26,10 @@ typedef struct HFONT__* NativeFont; class NSFont; #endif typedef NSFont* NativeFont; -#elif defined(OS_LINUX) +#else typedef struct _PangoFontDescription PangoFontDescription; class SkTypeface; typedef SkTypeface* NativeFont; -#else // null port. -#error No known OS defined #endif #include "base/basictypes.h" @@ -127,7 +125,7 @@ class Font { int vertical_dlus_to_pixels(int dlus) { return dlus * font_ref_->height() / 8; } -#elif defined(OS_LINUX) +#elif !defined(OS_MACOSX) static Font CreateFont(PangoFontDescription* desc); // We need a copy constructor and assignment operator to deal with // the Skia reference counting. @@ -210,7 +208,7 @@ class Font { // Indirect reference to the HFontRef, which references the underlying HFONT. scoped_refptr<HFontRef> font_ref_; -#elif defined(OS_LINUX) +#elif !defined(OS_MACOSX) explicit Font(SkTypeface* typeface, const std::wstring& name, int size, int style); // Calculate and cache the font metrics. @@ -249,7 +247,7 @@ class Font { double avg_width_; double underline_position_; double underline_thickness_; -#elif defined(OS_MACOSX) +#else // OS_MACOSX explicit Font(const std::wstring& font_name, int font_size, int style); // Calculate and cache the font metrics. diff --git a/app/gfx/insets.h b/app/gfx/insets.h index 70b3683..9dddbbd 100644 --- a/app/gfx/insets.h +++ b/app/gfx/insets.h @@ -7,7 +7,7 @@ #include "build/build_config.h" -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) #include <gtk/gtkstyle.h> #endif @@ -28,7 +28,7 @@ class Insets { left_(left), bottom_(bottom), right_(right) {} -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) explicit Insets(const GtkBorder& border) : top_(border.top), left_(border.left), |