summaryrefslogtreecommitdiffstats
path: root/base/gfx/platform_device_mac.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-19 18:52:38 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-19 18:52:38 +0000
commit6165b4070b7e3a2fd33efd0eb66043c86f61d8b2 (patch)
treed2f7f195c13274ca524d264dc34639e276805325 /base/gfx/platform_device_mac.h
parent941ac7fca4afc89cb28ffa760f5a4a4ca077912c (diff)
downloadchromium_src-6165b4070b7e3a2fd33efd0eb66043c86f61d8b2.zip
chromium_src-6165b4070b7e3a2fd33efd0eb66043c86f61d8b2.tar.gz
chromium_src-6165b4070b7e3a2fd33efd0eb66043c86f61d8b2.tar.bz2
Move PlatformCanvas and PlatformDevice from base/gfx to webkit/port. I left header files in the original locations that include the ones in the new location so I don't have to change all the includes in Chrome at once. These will be removed later.
I kept the names, indenting, and the namespaces the same for now. I will also be cleaning this up in separate passes. Review URL: http://codereview.chromium.org/11244 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/gfx/platform_device_mac.h')
-rwxr-xr-xbase/gfx/platform_device_mac.h79
1 files changed, 3 insertions, 76 deletions
diff --git a/base/gfx/platform_device_mac.h b/base/gfx/platform_device_mac.h
index 79a14be..f7b1bd0 100755
--- a/base/gfx/platform_device_mac.h
+++ b/base/gfx/platform_device_mac.h
@@ -5,82 +5,9 @@
#ifndef BASE_GFX_PLATFORM_DEVICE_MAC_H__
#define BASE_GFX_PLATFORM_DEVICE_MAC_H__
-#import <ApplicationServices/ApplicationServices.h>
-#include "SkDevice.h"
-
-class SkMatrix;
-class SkPath;
-class SkRegion;
-
-namespace gfx {
-
-// A device is basically a wrapper around SkBitmap that provides a surface for
-// SkCanvas to draw into. Our device provides a surface CoreGraphics can also
-// write to. It also provides functionality to play well with CG drawing
-// functions.
-// This class is abstract and must be subclassed. It provides the basic
-// interface to implement it either with or without a bitmap backend.
-class PlatformDeviceMac : public SkDevice {
- public:
- // The CGContext that corresponds to the bitmap, used for CoreGraphics
- // operations drawing into the bitmap. This is possibly heavyweight, so it
- // should exist only during one pass of rendering.
- virtual CGContextRef GetBitmapContext() = 0;
-
- // Draws to the given graphics context. If the bitmap context doesn't exist,
- // this will temporarily create it. However, if you have created the bitmap
- // context, it will be more efficient if you don't free it until after this
- // call so it doesn't have to be created twice. If src_rect is null, then
- // the entirety of the source device will be copied.
- virtual void DrawToContext(CGContextRef context, int x, int y,
- const CGRect* src_rect) = 0;
-
- // Sets the opacity of each pixel in the specified region to be opaque.
- void makeOpaque(int x, int y, int width, int height);
-
- // 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);
-
- // Loads a SkPath into the CG context. The path can there after be used for
- // clipping or as a stroke.
- static void LoadPathToCGContext(CGContextRef context, const SkPath& path);
-
- // Loads a SkRegion into the CG context.
- static void LoadClippingRegionToCGContext(CGContextRef context,
- const SkRegion& region,
- const SkMatrix& transformation);
-
- protected:
- // Forwards |bitmap| to SkDevice's constructor.
- PlatformDeviceMac(const SkBitmap& bitmap);
-
- // Loads the specified Skia transform into the device context
- static void LoadTransformToCGContext(CGContextRef context,
- const SkMatrix& matrix);
-
- // Function pointer used by the processPixels method for setting the alpha
- // value of a particular pixel.
- typedef void (*adjustAlpha)(uint32_t* pixel);
-
- // Loops through each of the pixels in the specified range, invoking
- // adjustor for the alpha value of each pixel.
- virtual void processPixels(int x,
- int y,
- int width,
- int height,
- adjustAlpha adjustor) = 0;
-};
-
-} // namespace gfx
+// TODO(brettw) this file should be removed and the includes changed to this
+// new location.
+#include "webkit/port/platform/graphics/skia/public/PlatformDeviceMac.h"
#endif // BASE_GFX_PLATFORM_DEVICE_MAC_H__