diff options
author | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-28 16:51:31 +0000 |
---|---|---|
committer | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-28 16:51:31 +0000 |
commit | 8ebe83a40a7a025bce3a69b46a696311bdade196 (patch) | |
tree | 42e55bd04422d08ba37670719f44bb84e1b1b5d8 /skia/ext/vector_platform_device_emf_win.cc | |
parent | 96e636f2a301cf9c17ff4118eb16adc3b431c8be (diff) | |
download | chromium_src-8ebe83a40a7a025bce3a69b46a696311bdade196.zip chromium_src-8ebe83a40a7a025bce3a69b46a696311bdade196.tar.gz chromium_src-8ebe83a40a7a025bce3a69b46a696311bdade196.tar.bz2 |
CL removing inheritance of SkDevice from PlatformDevice.
PlatformDevice is now a base interface, which is implemented by the various flavours of BitmapPlatformDevice, and VectorPlatformDevice. The BitmapPlatformDevice and VectorPlatformDevice classes now inherit directly from SkDevice, or SkPDFDevice, as appropriate.
PlatformDevice helper functions access the PlatformDevice interface attached to a SkDevice via meta-data on the SkDevice.
BUG=none
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98230
Review URL: http://codereview.chromium.org/7633040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/vector_platform_device_emf_win.cc')
-rw-r--r-- | skia/ext/vector_platform_device_emf_win.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/skia/ext/vector_platform_device_emf_win.cc b/skia/ext/vector_platform_device_emf_win.cc index eac7977..9741a83 100644 --- a/skia/ext/vector_platform_device_emf_win.cc +++ b/skia/ext/vector_platform_device_emf_win.cc @@ -15,9 +15,8 @@ namespace skia { //static -PlatformDevice* VectorPlatformDeviceEmf::CreateDevice(int width, int height, - bool is_opaque, - HANDLE shared_section) { +SkDevice* VectorPlatformDeviceEmf::CreateDevice( + int width, int height, bool is_opaque, HANDLE shared_section) { if (!is_opaque) { // TODO(maruel): http://crbug.com/18382 When restoring a semi-transparent // layer, i.e. merging it, we need to rasterize it because GDI doesn't @@ -40,7 +39,7 @@ PlatformDevice* VectorPlatformDeviceEmf::CreateDevice(int width, int height, // SkScalarRound(value) as SkScalarRound(value * 10). Safari is already // doing the same for text rendering. SkASSERT(shared_section); - PlatformDevice* device = VectorPlatformDeviceEmf::create( + SkDevice* device = VectorPlatformDeviceEmf::create( reinterpret_cast<HDC>(shared_section), width, height); return device; } @@ -59,9 +58,7 @@ static void FillBitmapInfoHeader(int width, int height, BITMAPINFOHEADER* hdr) { hdr->biClrImportant = 0; } -VectorPlatformDeviceEmf* VectorPlatformDeviceEmf::create(HDC dc, - int width, - int height) { +SkDevice* VectorPlatformDeviceEmf::create(HDC dc, int width, int height) { InitializeDC(dc); // Link the SkBitmap to the current selected bitmap in the device context. @@ -96,12 +93,13 @@ VectorPlatformDeviceEmf* VectorPlatformDeviceEmf::create(HDC dc, } VectorPlatformDeviceEmf::VectorPlatformDeviceEmf(HDC dc, const SkBitmap& bitmap) - : PlatformDevice(bitmap), + : SkDevice(bitmap), hdc_(dc), previous_brush_(NULL), previous_pen_(NULL), alpha_blend_used_(false) { transform_.reset(); + SetPlatformDevice(this, this); } VectorPlatformDeviceEmf::~VectorPlatformDeviceEmf() { @@ -865,4 +863,3 @@ void VectorPlatformDeviceEmf::InternalDrawBitmap(const SkBitmap& bitmap, } } // namespace skia - |