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

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

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit+rebase Created 8 years 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/vector_canvas_unittest.cc ('k') | skia/ext/vector_platform_device_skia.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) 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/vector_platform_device_emf_win.h" 5 #include "skia/ext/vector_platform_device_emf_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // Draw a path instead. 183 // Draw a path instead.
184 SkPath path_orginal; 184 SkPath path_orginal;
185 path_orginal.addRect(rect); 185 path_orginal.addRect(rect);
186 186
187 // Apply the path effect to the rect. 187 // Apply the path effect to the rect.
188 SkPath path_modified; 188 SkPath path_modified;
189 paint.getFillPath(path_orginal, &path_modified); 189 paint.getFillPath(path_orginal, &path_modified);
190 190
191 // Removes the path effect from the temporary SkPaint object. 191 // Removes the path effect from the temporary SkPaint object.
192 SkPaint paint_no_effet(paint); 192 SkPaint paint_no_effet(paint);
193 SkSafeUnref(paint_no_effet.setPathEffect(NULL)); 193 paint_no_effet.setPathEffect(NULL);
194 194
195 // Draw the calculated path. 195 // Draw the calculated path.
196 drawPath(draw, path_modified, paint_no_effet); 196 drawPath(draw, path_modified, paint_no_effet);
197 return; 197 return;
198 } 198 }
199 199
200 if (!ApplyPaint(paint)) { 200 if (!ApplyPaint(paint)) {
201 return; 201 return;
202 } 202 }
203 HDC dc = BeginPlatformPaint(); 203 HDC dc = BeginPlatformPaint();
(...skipping 13 matching lines...) Expand all
217 const SkMatrix* prePathMatrix, 217 const SkMatrix* prePathMatrix,
218 bool pathIsMutable) { 218 bool pathIsMutable) {
219 CHECK_FOR_NODRAW_ANNOTATION(paint); 219 CHECK_FOR_NODRAW_ANNOTATION(paint);
220 if (paint.getPathEffect()) { 220 if (paint.getPathEffect()) {
221 // Apply the path effect forehand. 221 // Apply the path effect forehand.
222 SkPath path_modified; 222 SkPath path_modified;
223 paint.getFillPath(path, &path_modified); 223 paint.getFillPath(path, &path_modified);
224 224
225 // Removes the path effect from the temporary SkPaint object. 225 // Removes the path effect from the temporary SkPaint object.
226 SkPaint paint_no_effet(paint); 226 SkPaint paint_no_effet(paint);
227 SkSafeUnref(paint_no_effet.setPathEffect(NULL)); 227 paint_no_effet.setPathEffect(NULL);
228 228
229 // Draw the calculated path. 229 // Draw the calculated path.
230 drawPath(draw, path_modified, paint_no_effet); 230 drawPath(draw, path_modified, paint_no_effet);
231 return; 231 return;
232 } 232 }
233 233
234 if (!ApplyPaint(paint)) { 234 if (!ApplyPaint(paint)) {
235 return; 235 return;
236 } 236 }
237 HDC dc = BeginPlatformPaint(); 237 HDC dc = BeginPlatformPaint();
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 pixels, 921 pixels,
922 reinterpret_cast<const BITMAPINFO*>(&hdr), 922 reinterpret_cast<const BITMAPINFO*>(&hdr),
923 DIB_RGB_COLORS, 923 DIB_RGB_COLORS,
924 SRCCOPY); 924 SRCCOPY);
925 } 925 }
926 EndPlatformPaint(); 926 EndPlatformPaint();
927 Cleanup(); 927 Cleanup();
928 } 928 }
929 929
930 } // namespace skia 930 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/vector_canvas_unittest.cc ('k') | skia/ext/vector_platform_device_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698