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

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

Issue 2400873002: keep only one typedef for the native drawing context (Closed)
Patch Set: native_drawing_context.h Created 4 years, 2 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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "skia/ext/platform_device.h" 9 #include "skia/ext/platform_device.h"
10 #include "third_party/skia/include/core/SkMetaData.h" 10 #include "third_party/skia/include/core/SkMetaData.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return platform_device ? 98 return platform_device ?
99 platform_device->GetBitmapContext( 99 platform_device->GetBitmapContext(
100 canvas.getTotalMatrix(), clip_bounds) : 100 canvas.getTotalMatrix(), clip_bounds) :
101 nullptr; 101 nullptr;
102 } 102 }
103 103
104 #endif 104 #endif
105 105
106 ScopedPlatformPaint::ScopedPlatformPaint(SkCanvas* canvas) : 106 ScopedPlatformPaint::ScopedPlatformPaint(SkCanvas* canvas) :
107 canvas_(canvas), 107 canvas_(canvas),
108 platform_surface_(nullptr) { 108 native_drawing_context_(nullptr) {
109 // TODO(tomhudson) we're assuming non-null canvas? 109 // TODO(tomhudson) we're assuming non-null canvas?
110 PlatformDevice* platform_device = GetPlatformDevice(canvas->getTopDevice(true) ); 110 PlatformDevice* platform_device = GetPlatformDevice(canvas->getTopDevice(true) );
111 if (platform_device) { 111 if (platform_device) {
112 // Compensate for drawing to a layer rather than the entire canvas 112 // Compensate for drawing to a layer rather than the entire canvas
113 SkMatrix ctm; 113 SkMatrix ctm;
114 SkIRect clip_bounds; 114 SkIRect clip_bounds;
115 canvas->temporary_internal_describeTopLayer(&ctm, &clip_bounds); 115 canvas->temporary_internal_describeTopLayer(&ctm, &clip_bounds);
116 platform_surface_ = platform_device->BeginPlatformPaint(ctm, clip_bounds); 116 native_drawing_context_ = platform_device->BeginPlatformPaint(ctm, clip_boun ds);
117 } 117 }
118 } 118 }
119 119
120 } // namespace skia 120 } // 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