diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-14 15:14:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-14 15:14:53 +0000 |
commit | bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0 (patch) | |
tree | 149a64e70ca634bd43019d639d9ae29ca6d45a9a /skia/ext/bitmap_platform_device_mac.h | |
parent | b39627f8eef41a2d4e1f4516bf905d6ad895e56b (diff) | |
download | chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.zip chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.tar.gz chromium_src-bd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0.tar.bz2 |
Refactor the PlatformContext layer to have only one class.
Previously we had three classes of PlatformCanvas*, one for each platform. Then
we had a typedef of PlatformContext to PlatformCanvas[Mac|Win|Linux] for the
specific platform.
This means that it was almost impossible to forward-declare PlatformCanvas and
there were a bunch of unnecessary includes of platform_canvas.h in header
files.
This change makes there be only one platform_canvas.h header with ifdefs, which
removes a decent amount of duplicated code. There is a platform-independent
file, and one platform-dependent file of platform_canvas for each platform.
I also renamed PlatformDevice[Mac|Win|Linux] to PlatformDevice, althouth in
this case I kept the separate headers since there was much less overlap.
I also broke out CanvasPaint into separate headers so this template doesn't
need to be included all over the project (only a couple of files actually need
it).
Review URL: http://codereview.chromium.org/125109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/bitmap_platform_device_mac.h')
-rw-r--r-- | skia/ext/bitmap_platform_device_mac.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.h b/skia/ext/bitmap_platform_device_mac.h index 0cf483f..6580302 100644 --- a/skia/ext/bitmap_platform_device_mac.h +++ b/skia/ext/bitmap_platform_device_mac.h @@ -11,7 +11,7 @@ namespace skia { // 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. BitmapPlatformDeviceMac creates a bitmap using +// write to. BitmapPlatformDevice creates a bitmap using // CGCreateBitmapContext() in a format that Skia supports and can then use this // to draw text into, etc. This pixel data is provided to the bitmap that the // device contains so that it can be shared. @@ -23,7 +23,7 @@ namespace skia { // For us, that other bitmap will become invalid as soon as the device becomes // invalid, which may lead to subtle bugs. Therefore, DO NOT ASSIGN THE // DEVICE'S PIXEL DATA TO ANOTHER BITMAP, make sure you copy instead. -class BitmapPlatformDeviceMac : public PlatformDeviceMac { +class BitmapPlatformDevice : public PlatformDevice { public: // Factory function. The screen DC is used to create the bitmap, and will not // be stored beyond this function. is_opaque should be set if the caller @@ -32,10 +32,10 @@ class BitmapPlatformDeviceMac : public PlatformDeviceMac { // The shared_section parameter is optional (pass NULL for default behavior). // If shared_section is non-null, then it must be a handle to a file-mapping // object returned by CreateFileMapping. See CreateDIBSection for details. - static BitmapPlatformDeviceMac* Create(CGContextRef context, - int width, - int height, - bool is_opaque); + static BitmapPlatformDevice* Create(CGContextRef context, + int width, + int height, + bool is_opaque); // Copy constructor. When copied, devices duplicate their internal data, so // stay linked. This is because their implementation is very heavyweight @@ -48,11 +48,11 @@ class BitmapPlatformDeviceMac : public PlatformDeviceMac { // // Copy constucting and "=" is designed for saving the device or passing it // around to another routine willing to deal with the bitmap data directly. - BitmapPlatformDeviceMac(const BitmapPlatformDeviceMac& other); - virtual ~BitmapPlatformDeviceMac(); + BitmapPlatformDevice(const BitmapPlatformDevice& other); + virtual ~BitmapPlatformDevice(); // See warning for copy constructor above. - BitmapPlatformDeviceMac& operator=(const BitmapPlatformDeviceMac& other); + BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other); virtual CGContextRef GetBitmapContext(); virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region); @@ -69,10 +69,10 @@ class BitmapPlatformDeviceMac : public PlatformDeviceMac { // Reference counted data that can be shared between multiple devices. This // allows copy constructors and operator= for devices to work properly. The // bitmaps used by the base device class are already refcounted and copyable. - class BitmapPlatformDeviceMacData; + class BitmapPlatformDeviceData; - BitmapPlatformDeviceMac(BitmapPlatformDeviceMacData* data, - const SkBitmap& bitmap); + BitmapPlatformDevice(BitmapPlatformDeviceData* data, + const SkBitmap& bitmap); // Flushes the CoreGraphics context so that the pixel data can be accessed // directly by Skia. Overridden from SkDevice, this is called when Skia @@ -85,7 +85,7 @@ class BitmapPlatformDeviceMac : public PlatformDeviceMac { // Data associated with this device, guaranteed non-null. We hold a reference // to this object. - BitmapPlatformDeviceMacData* data_; + BitmapPlatformDeviceData* data_; }; } // namespace skia |