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

Side by Side Diff: skia/ext/platform_device.h

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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_unittest.cc ('k') | skia/ext/platform_device_mac.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) 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 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_ 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_
6 #define SKIA_EXT_PLATFORM_DEVICE_H_ 6 #define SKIA_EXT_PLATFORM_DEVICE_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Loads a SkRegion into the GDI context. 124 // Loads a SkRegion into the GDI context.
125 static void LoadClippingRegionToDC(HDC context, const SkRegion& region, 125 static void LoadClippingRegionToDC(HDC context, const SkRegion& region,
126 const SkMatrix& transformation); 126 const SkMatrix& transformation);
127 127
128 // Draws to the given screen DC, if the bitmap DC doesn't exist, this will 128 // Draws to the given screen DC, if the bitmap DC doesn't exist, this will
129 // temporarily create it. However, if you have created the bitmap DC, it will 129 // temporarily create it. However, if you have created the bitmap DC, it will
130 // be more efficient if you don't free it until after this call so it doesn't 130 // be more efficient if you don't free it until after this call so it doesn't
131 // have to be created twice. If src_rect is null, then the entirety of the 131 // have to be created twice. If src_rect is null, then the entirety of the
132 // source device will be copied. 132 // source device will be copied.
133 virtual void DrawToHDC(HDC, int x, int y, const RECT* src_rect); 133 virtual void DrawToHDC(HDC, int x, int y, const RECT* src_rect);
134
135 #elif defined(OS_MACOSX)
136 // Loads a SkPath into the CG context. The path can there after be used for
137 // clipping or as a stroke.
138 static void LoadPathToCGContext(CGContextRef context, const SkPath& path);
139
140 // Initializes the default settings and colors in a device context.
141 static void InitializeCGContext(CGContextRef context);
142
143 // Loads a SkRegion into the CG context.
144 static void LoadClippingRegionToCGContext(CGContextRef context,
145 const SkRegion& region,
146 const SkMatrix& transformation);
134 #endif 147 #endif
135 148
136 protected: 149 protected:
137 #if defined(OS_WIN) 150 #if defined(OS_WIN)
138 // Arrays must be inside structures. 151 // Arrays must be inside structures.
139 struct CubicPoints { 152 struct CubicPoints {
140 SkPoint p[4]; 153 SkPoint p[4];
141 }; 154 };
142 typedef std::vector<CubicPoints> CubicPath; 155 typedef std::vector<CubicPoints> CubicPath;
143 typedef std::vector<CubicPath> CubicPaths; 156 typedef std::vector<CubicPath> CubicPaths;
144 157
145 // Loads the specified Skia transform into the device context, excluding 158 // Loads the specified Skia transform into the device context, excluding
146 // perspective (which GDI doesn't support). 159 // perspective (which GDI doesn't support).
147 static void LoadTransformToDC(HDC dc, const SkMatrix& matrix); 160 static void LoadTransformToDC(HDC dc, const SkMatrix& matrix);
148 161
149 // Transforms SkPath's paths into a series of cubic path. 162 // Transforms SkPath's paths into a series of cubic path.
150 static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath); 163 static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath);
164 #elif defined(OS_MACOSX)
165 // Loads the specified Skia transform into the device context
166 static void LoadTransformToCGContext(CGContextRef context,
167 const SkMatrix& matrix);
151 #endif 168 #endif
152 }; 169 };
153 170
154 } // namespace skia 171 } // namespace skia
155 172
156 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ 173 #endif // SKIA_EXT_PLATFORM_DEVICE_H_
OLDNEW
« no previous file with comments | « skia/ext/platform_canvas_unittest.cc ('k') | skia/ext/platform_device_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698