summaryrefslogtreecommitdiffstats
path: root/base/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'base/gfx')
-rw-r--r--base/gfx/SConscript2
-rw-r--r--base/gfx/bitmap_platform_device.h13
-rwxr-xr-xbase/gfx/bitmap_platform_device_mac.h3
-rw-r--r--base/gfx/platform_canvas.h18
-rwxr-xr-xbase/gfx/platform_canvas_mac.cc5
-rw-r--r--base/gfx/platform_canvas_unittest.c (renamed from base/gfx/platform_canvas_unittest_win.cc)0
-rw-r--r--base/gfx/platform_device.h15
-rwxr-xr-xbase/gfx/platform_device_mac.h6
8 files changed, 46 insertions, 16 deletions
diff --git a/base/gfx/SConscript b/base/gfx/SConscript
index b9e0d4a..57e61be 100644
--- a/base/gfx/SConscript
+++ b/base/gfx/SConscript
@@ -62,7 +62,7 @@ if env['PLATFORM'] == 'win32':
if env['PLATFORM'] == 'win32':
input_files.extend([
- 'bitmap_platform_device_win.cc',
+ 'bitmap_platform_device.cc',
'platform_canvas_win.cc',
'platform_device_win.cc',
])
diff --git a/base/gfx/bitmap_platform_device.h b/base/gfx/bitmap_platform_device.h
index 83b74df..1efa65c 100644
--- a/base/gfx/bitmap_platform_device.h
+++ b/base/gfx/bitmap_platform_device.h
@@ -6,17 +6,22 @@
// that can be used by upper-level classes that just need to pass a reference
// around.
+#if defined(OS_WIN)
+#include "base/gfx/bitmap_platform_device_win.h"
+#elif defined(OS_MACOSX)
+#include "base/gfx/bitmap_platform_device_mac.h"
+#elif defined(OS_LINUX)
+#include "base/gfx/bitmap_platform_device_linux.h"
+#endif
+
namespace gfx {
#if defined(OS_WIN)
-class BitmapPlatformDeviceWin;
typedef BitmapPlatformDeviceWin BitmapPlatformDevice;
#elif defined(OS_MACOSX)
-class BitmapPlatformDeviceMac;
typedef BitmapPlatformDeviceMac BitmapPlatformDevice;
#elif defined(OS_LINUX)
-class BitmapPlatformDeviceLinux;
typedef BitmapPlatformDeviceLinux BitmapPlatformDevice;
#endif
-} // namespace gfx
+}
diff --git a/base/gfx/bitmap_platform_device_mac.h b/base/gfx/bitmap_platform_device_mac.h
index 11e1133..a22483e 100755
--- a/base/gfx/bitmap_platform_device_mac.h
+++ b/base/gfx/bitmap_platform_device_mac.h
@@ -65,7 +65,8 @@ class BitmapPlatformDeviceMac : public PlatformDeviceMac {
virtual void DrawToContext(CGContextRef context, int x, int y,
const CGRect* src_rect);
virtual bool IsVectorial() { return false; }
-
+ virtual void fixupAlphaBeforeCompositing() { };
+
// Returns the color value at the specified location. This does not
// consider any transforms that may be set on the device.
SkColor GetColorAt(int x, int y);
diff --git a/base/gfx/platform_canvas.h b/base/gfx/platform_canvas.h
index d7433cd..d7442cc 100644
--- a/base/gfx/platform_canvas.h
+++ b/base/gfx/platform_canvas.h
@@ -8,17 +8,25 @@
#include "build/build_config.h"
+#if defined(OS_WIN)
+#include "base/gfx/platform_canvas_win.h"
namespace gfx {
-#if defined(OS_WIN)
-class PlatformCanvasWin;
typedef PlatformCanvasWin PlatformCanvas;
+
+} // namespace gfx
#elif defined(OS_MACOSX)
-class PlatformCanvasMac;
+#include "base/gfx/platform_canvas_mac.h"
+namespace gfx {
+
typedef PlatformCanvasMac PlatformCanvas;
+
+} // namespace gfx
#elif defined(OS_LINUX)
-class PlatformCanvasLinux;
+#include "base/gfx/platform_canvas_linux.h"
+namespace gfx {
+
typedef PlatformCanvasLinux PlatformCanvas;
-#endif
} // namespace gfx
+#endif
diff --git a/base/gfx/platform_canvas_mac.cc b/base/gfx/platform_canvas_mac.cc
index afd5203..f8f0970 100755
--- a/base/gfx/platform_canvas_mac.cc
+++ b/base/gfx/platform_canvas_mac.cc
@@ -141,5 +141,10 @@ SkDevice* PlatformCanvasMac::createPlatformDevice(int width,
return device;
}
+SkDevice* PlatformCanvasMac::setBitmapDevice(const SkBitmap&) {
+ NOTREACHED();
+ return NULL;
+}
+
} // namespace gfx
diff --git a/base/gfx/platform_canvas_unittest_win.cc b/base/gfx/platform_canvas_unittest.c
index a9cf2ae..a9cf2ae 100644
--- a/base/gfx/platform_canvas_unittest_win.cc
+++ b/base/gfx/platform_canvas_unittest.c
diff --git a/base/gfx/platform_device.h b/base/gfx/platform_device.h
index 796eec8..f1c890c 100644
--- a/base/gfx/platform_device.h
+++ b/base/gfx/platform_device.h
@@ -6,17 +6,22 @@
// that can be used by upper-level classes that just need to pass a reference
// around.
-namespace gfx {
+#if defined(OS_WIN)
+#include "base/gfx/platform_device_win.h"
+#elif defined(OS_MACOSX)
+#include "base/gfx/platform_device_mac.h"
+#elif defined(OS_LINUX)
+#include "base/gfx/platform_device_linux.h"
+#endif
+namespace gfx {
+
#if defined(OS_WIN)
-class PlatformDeviceWin;
typedef PlatformDeviceWin PlatformDevice;
#elif defined(OS_MACOSX)
-class PlatformDeviceMac;
typedef PlatformDeviceMac PlatformDevice;
#elif defined(OS_LINUX)
-class PlatformDeviceLinux;
typedef PlatformDeviceLinux PlatformDevice;
#endif
-
+
} // namespace gfx
diff --git a/base/gfx/platform_device_mac.h b/base/gfx/platform_device_mac.h
index 8cd2251..69eac95 100755
--- a/base/gfx/platform_device_mac.h
+++ b/base/gfx/platform_device_mac.h
@@ -59,6 +59,12 @@ class PlatformDeviceMac : public SkDevice {
// Returns if the preferred rendering engine is vectorial or bitmap based.
virtual bool IsVectorial() = 0;
+ // On platforms where the native rendering API does not support rendering
+ // into bitmaps with a premultiplied alpha channel, this call is responsible
+ // for doing any fixup necessary. It is not used on the Mac, since
+ // CoreGraphics can handle premultiplied alpha just fine.
+ virtual void fixupAlphaBeforeCompositing() = 0;
+
// Initializes the default settings and colors in a device context.
static void InitializeCGContext(CGContextRef context);