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

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

Issue 2612863002: Make skia::GetNativeDrawingContext Windows-only (Closed)
Patch Set: more guarding Created 3 years, 11 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
« no previous file with comments | « skia/ext/platform_canvas.h ('k') | skia/ext/platform_canvas_unittest.cc » ('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) 2011 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_canvas.h" 5 #include "skia/ext/platform_canvas.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "skia/ext/platform_device.h" 10 #include "skia/ext/platform_device.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #if defined(OS_MACOSX) 79 #if defined(OS_MACOSX)
80 void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview) { 80 void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview) {
81 SetBoolMetaData(canvas, kIsPreviewMetafileKey, is_preview); 81 SetBoolMetaData(canvas, kIsPreviewMetafileKey, is_preview);
82 } 82 }
83 83
84 bool IsPreviewMetafile(const SkCanvas& canvas) { 84 bool IsPreviewMetafile(const SkCanvas& canvas) {
85 return GetBoolMetaData(canvas, kIsPreviewMetafileKey); 85 return GetBoolMetaData(canvas, kIsPreviewMetafileKey);
86 } 86 }
87 #endif 87 #endif
88 88
89 NativeDrawingContext GetNativeDrawingContext(SkCanvas* canvas) {
90 PlatformDevice* platform_device = GetPlatformDevice(canvas->getTopDevice(true) );
91 if (!platform_device)
92 return nullptr;
93
94 // Compensate for drawing to a layer rather than the entire canvas
95 SkMatrix ctm;
96 SkIRect clip_bounds;
97 canvas->temporary_internal_describeTopLayer(&ctm, &clip_bounds);
98
99 return platform_device->BeginPlatformPaint(ctm, clip_bounds);
100 }
101
102 } // namespace skia 89 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/platform_canvas.h ('k') | skia/ext/platform_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698