Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Side by Side Diff: skia/ext/platform_device_win.cc

Issue 7633040: CL removing inheritance of SkDevice from PlatformDevice. Flavours of PlatformDevice classes now ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/ext/platform_device_win.h ('k') | skia/ext/vector_platform_device_cairo_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "third_party/skia/include/core/SkUtils.h" 11 #include "third_party/skia/include/core/SkUtils.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 res = SetDCPenColor(context, RGB(0, 0, 0)); 44 res = SetDCPenColor(context, RGB(0, 0, 0));
45 SkASSERT(res != CLR_INVALID); 45 SkASSERT(res != CLR_INVALID);
46 46
47 // Sets up default transparency. 47 // Sets up default transparency.
48 res = SetBkMode(context, OPAQUE); 48 res = SetBkMode(context, OPAQUE);
49 SkASSERT(res != 0); 49 SkASSERT(res != 0);
50 res = SetROP2(context, R2_COPYPEN); 50 res = SetROP2(context, R2_COPYPEN);
51 SkASSERT(res != 0); 51 SkASSERT(res != 0);
52 } 52 }
53 53
54 PlatformDevice::PlatformDevice(const SkBitmap& bitmap) 54 PlatformSurface PlatformDevice::BeginPlatformPaint() {
55 : SkDevice(bitmap) { 55 return 0;
56 SetPlatformDevice(this, this);
57 } 56 }
58 57
59 void PlatformDevice::EndPlatformPaint() { 58 void PlatformDevice::EndPlatformPaint() {
60 // 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.
61 // Flushing will be done in onAccessBitmap. 60 // Flushing will be done in onAccessBitmap.
62 } 61 }
63 62
63 void PlatformDevice::DrawToNativeContext(PlatformSurface surface, int x, int y,
64 const PlatformRect* src_rect) {
65 }
66
64 // static 67 // static
65 bool PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) { 68 bool PlatformDevice::LoadPathToDC(HDC context, const SkPath& path) {
66 switch (path.getFillType()) { 69 switch (path.getFillType()) {
67 case SkPath::kWinding_FillType: { 70 case SkPath::kWinding_FillType: {
68 int res = SetPolyFillMode(context, WINDING); 71 int res = SetPolyFillMode(context, WINDING);
69 SkASSERT(res != 0); 72 SkASSERT(res != 0);
70 break; 73 break;
71 } 74 }
72 case SkPath::kEvenOdd_FillType: { 75 case SkPath::kEvenOdd_FillType: {
73 int res = SetPolyFillMode(context, ALTERNATE); 76 int res = SetPolyFillMode(context, ALTERNATE);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 LoadPathToDC(context, path); 229 LoadPathToDC(context, path);
227 hrgn = PathToRegion(context); 230 hrgn = PathToRegion(context);
228 } 231 }
229 int result = SelectClipRgn(context, hrgn); 232 int result = SelectClipRgn(context, hrgn);
230 SkASSERT(result != ERROR); 233 SkASSERT(result != ERROR);
231 result = DeleteObject(hrgn); 234 result = DeleteObject(hrgn);
232 SkASSERT(result != 0); 235 SkASSERT(result != 0);
233 } 236 }
234 237
235 } // namespace skia 238 } // namespace skia
236
OLDNEW
« no previous file with comments | « skia/ext/platform_device_win.h ('k') | skia/ext/vector_platform_device_cairo_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698