| 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" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 PlatformSurface PlatformDevice::BeginPlatformPaint() { | 54 PlatformSurface PlatformDevice::BeginPlatformPaint() { |
| 55 return 0; | 55 return 0; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void PlatformDevice::EndPlatformPaint() { | 58 void PlatformDevice::EndPlatformPaint() { |
| 59 // We don't clear the DC here since it will be likely to be used again. | 59 // We don't clear the DC here since it will be likely to be used again. |
| 60 // Flushing will be done in onAccessBitmap. | 60 // Flushing will be done in onAccessBitmap. |
| 61 } | 61 } |
| 62 | 62 |
| 63 void PlatformDevice::DrawToNativeContext(PlatformSurface surface, int x, int y, | |
| 64 const PlatformRect* src_rect) { | |
| 65 } | |
| 66 | |
| 67 // static | 63 // static |
| 68 bool PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) { | 64 bool PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) { |
| 69 switch (path.getFillType()) { | 65 switch (path.getFillType()) { |
| 70 case SkPath::kWinding_FillType: { | 66 case SkPath::kWinding_FillType: { |
| 71 int res = SetPolyFillMode(context, WINDING); | 67 int res = SetPolyFillMode(context, WINDING); |
| 72 SkASSERT(res != 0); | 68 SkASSERT(res != 0); |
| 73 break; | 69 break; |
| 74 } | 70 } |
| 75 case SkPath::kEvenOdd_FillType: { | 71 case SkPath::kEvenOdd_FillType: { |
| 76 int res = SetPolyFillMode(context, ALTERNATE); | 72 int res = SetPolyFillMode(context, ALTERNATE); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 LoadPathToDC(context, path); | 224 LoadPathToDC(context, path); |
| 229 hrgn = PathToRegion(context); | 225 hrgn = PathToRegion(context); |
| 230 } | 226 } |
| 231 int result = SelectClipRgn(context, hrgn); | 227 int result = SelectClipRgn(context, hrgn); |
| 232 SkASSERT(result != ERROR); | 228 SkASSERT(result != ERROR); |
| 233 result = DeleteObject(hrgn); | 229 result = DeleteObject(hrgn); |
| 234 SkASSERT(result != 0); | 230 SkASSERT(result != 0); |
| 235 } | 231 } |
| 236 | 232 |
| 237 } // namespace skia | 233 } // namespace skia |
| OLD | NEW |