| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "skia/ext/platform_device_win.h" | 5 #include "skia/ext/platform_device_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "skia/ext/skia_utils_win.h" | 8 #include "skia/ext/skia_utils_win.h" |
| 9 #include "SkMatrix.h" | 9 #include "SkMatrix.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| 11 #include "SkRegion.h" | 11 #include "SkRegion.h" |
| 12 #include "SkUtils.h" | 12 #include "SkUtils.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace skia { |
| 15 | |
| 16 // TODO(brettw) remove this when this file is moved into the Skia namespace. | |
| 17 using namespace skia; | |
| 18 | 15 |
| 19 PlatformDeviceWin::PlatformDeviceWin(const SkBitmap& bitmap) | 16 PlatformDeviceWin::PlatformDeviceWin(const SkBitmap& bitmap) |
| 20 : SkDevice(bitmap) { | 17 : SkDevice(bitmap) { |
| 21 } | 18 } |
| 22 | 19 |
| 23 // static | 20 // static |
| 24 void PlatformDeviceWin::InitializeDC(HDC context) { | 21 void PlatformDeviceWin::InitializeDC(HDC context) { |
| 25 // Enables world transformation. | 22 // Enables world transformation. |
| 26 // If the GM_ADVANCED graphics mode is set, GDI always draws arcs in the | 23 // If the GM_ADVANCED graphics mode is set, GDI always draws arcs in the |
| 27 // counterclockwise direction in logical space. This is equivalent to the | 24 // counterclockwise direction in logical space. This is equivalent to the |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 path.transform(transformation); | 218 path.transform(transformation); |
| 222 LoadPathToDC(context, path); | 219 LoadPathToDC(context, path); |
| 223 hrgn = PathToRegion(context); | 220 hrgn = PathToRegion(context); |
| 224 } | 221 } |
| 225 int result = SelectClipRgn(context, hrgn); | 222 int result = SelectClipRgn(context, hrgn); |
| 226 DCHECK_NE(result, ERROR); | 223 DCHECK_NE(result, ERROR); |
| 227 result = DeleteObject(hrgn); | 224 result = DeleteObject(hrgn); |
| 228 DCHECK_NE(result, 0); | 225 DCHECK_NE(result, 0); |
| 229 } | 226 } |
| 230 | 227 |
| 231 } // namespace gfx | 228 } // namespace skia |
| 232 | 229 |
| OLD | NEW |