summaryrefslogtreecommitdiffstats
path: root/skia/ext/platform_device_win.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-14 15:14:53 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-14 15:14:53 +0000
commitbd63dc9cdf640a6d1e833ce0b5ed7ed9090973b0 (patch)
tree149a64e70ca634bd43019d639d9ae29ca6d45a9a /skia/ext/platform_device_win.cc
parentb39627f8eef41a2d4e1f4516bf905d6ad895e56b (diff)
downloadchromium_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/platform_device_win.cc')
-rw-r--r--skia/ext/platform_device_win.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/skia/ext/platform_device_win.cc b/skia/ext/platform_device_win.cc
index d58b14a..7bb5bd9 100644
--- a/skia/ext/platform_device_win.cc
+++ b/skia/ext/platform_device_win.cc
@@ -12,12 +12,12 @@
namespace skia {
-PlatformDeviceWin::PlatformDeviceWin(const SkBitmap& bitmap)
+PlatformDevice::PlatformDevice(const SkBitmap& bitmap)
: SkDevice(bitmap) {
}
// static
-void PlatformDeviceWin::InitializeDC(HDC context) {
+void PlatformDevice::InitializeDC(HDC context) {
// Enables world transformation.
// If the GM_ADVANCED graphics mode is set, GDI always draws arcs in the
// counterclockwise direction in logical space. This is equivalent to the
@@ -57,7 +57,7 @@ void PlatformDeviceWin::InitializeDC(HDC context) {
}
// static
-void PlatformDeviceWin::LoadPathToDC(HDC context, const SkPath& path) {
+void PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) {
switch (path.getFillType()) {
case SkPath::kWinding_FillType: {
int res = SetPolyFillMode(context, WINDING);
@@ -117,7 +117,7 @@ void PlatformDeviceWin::LoadPathToDC(HDC context, const SkPath& path) {
}
// static
-void PlatformDeviceWin::LoadTransformToDC(HDC dc, const SkMatrix& matrix) {
+void PlatformDevice::LoadTransformToDC(HDC dc, const SkMatrix& matrix) {
XFORM xf;
xf.eM11 = matrix[SkMatrix::kMScaleX];
xf.eM21 = matrix[SkMatrix::kMSkewX];
@@ -129,8 +129,8 @@ void PlatformDeviceWin::LoadTransformToDC(HDC dc, const SkMatrix& matrix) {
}
// static
-bool PlatformDeviceWin::SkPathToCubicPaths(CubicPaths* paths,
- const SkPath& skpath) {
+bool PlatformDevice::SkPathToCubicPaths(CubicPaths* paths,
+ const SkPath& skpath) {
paths->clear();
CubicPath* current_path = NULL;
SkPoint current_points[4];
@@ -192,9 +192,9 @@ bool PlatformDeviceWin::SkPathToCubicPaths(CubicPaths* paths,
}
// static
-void PlatformDeviceWin::LoadClippingRegionToDC(HDC context,
- const SkRegion& region,
- const SkMatrix& transformation) {
+void PlatformDevice::LoadClippingRegionToDC(HDC context,
+ const SkRegion& region,
+ const SkMatrix& transformation) {
HRGN hrgn;
if (region.isEmpty()) {
// region can be empty, in which case everything will be clipped.