summaryrefslogtreecommitdiffstats
path: root/skia/ext/vector_platform_device_emf_win.cc
diff options
context:
space:
mode:
authortwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 15:02:23 +0000
committertwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 15:02:23 +0000
commita602d87983b0775ec00f7f0c073189723a02306d (patch)
tree5b98cd87f4e4f32006c7f7d01775cdd7c1461c25 /skia/ext/vector_platform_device_emf_win.cc
parent567ffeaa47098fd761d082c0f7b5d4b958260537 (diff)
downloadchromium_src-a602d87983b0775ec00f7f0c073189723a02306d.zip
chromium_src-a602d87983b0775ec00f7f0c073189723a02306d.tar.gz
chromium_src-a602d87983b0775ec00f7f0c073189723a02306d.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 Review URL: http://codereview.chromium.org/7633040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98230 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.cc15
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
-