OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "skia/ext/platform_device.h" |
6 | 6 |
7 #include "skia/ext/skia_utils_win.h" | 7 #include "skia/ext/skia_utils_win.h" |
8 #include "third_party/skia/include/core/SkMatrix.h" | 8 #include "third_party/skia/include/core/SkMatrix.h" |
9 #include "third_party/skia/include/core/SkPath.h" | 9 #include "third_party/skia/include/core/SkPath.h" |
10 #include "third_party/skia/include/core/SkRegion.h" | 10 #include "third_party/skia/include/core/SkRegion.h" |
11 | 11 |
12 namespace skia { | 12 namespace skia { |
13 | 13 |
14 PlatformSurface PlatformDevice::BeginPlatformPaint() { | 14 PlatformSurface PlatformDevice::BeginPlatformPaint() { |
15 return 0; | 15 return 0; |
16 } | 16 } |
17 | 17 |
18 void PlatformDevice::EndPlatformPaint() { | |
19 // We don't clear the DC here since it will be likely to be used again. | |
20 // Flushing will be done in onAccessBitmap. | |
21 } | |
22 | |
23 // static | 18 // static |
24 bool PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) { | 19 bool PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) { |
25 switch (path.getFillType()) { | 20 switch (path.getFillType()) { |
26 case SkPath::kWinding_FillType: { | 21 case SkPath::kWinding_FillType: { |
27 int res = SetPolyFillMode(context, WINDING); | 22 int res = SetPolyFillMode(context, WINDING); |
28 SkASSERT(res != 0); | 23 SkASSERT(res != 0); |
29 break; | 24 break; |
30 } | 25 } |
31 case SkPath::kEvenOdd_FillType: { | 26 case SkPath::kEvenOdd_FillType: { |
32 int res = SetPolyFillMode(context, ALTERNATE); | 27 int res = SetPolyFillMode(context, ALTERNATE); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 LoadPathToDC(context, path); | 179 LoadPathToDC(context, path); |
185 hrgn = PathToRegion(context); | 180 hrgn = PathToRegion(context); |
186 } | 181 } |
187 int result = SelectClipRgn(context, hrgn); | 182 int result = SelectClipRgn(context, hrgn); |
188 SkASSERT(result != ERROR); | 183 SkASSERT(result != ERROR); |
189 result = DeleteObject(hrgn); | 184 result = DeleteObject(hrgn); |
190 SkASSERT(result != 0); | 185 SkASSERT(result != 0); |
191 } | 186 } |
192 | 187 |
193 } // namespace skia | 188 } // namespace skia |
OLD | NEW |