OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkDrawCommand.h" | 10 #include "SkDrawCommand.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 fPath = path; | 196 fPath = path; |
197 fOp = op; | 197 fOp = op; |
198 fDoAA = doAA; | 198 fDoAA = doAA; |
199 | 199 |
200 fInfo.push(SkObjectParser::PathToString(path)); | 200 fInfo.push(SkObjectParser::PathToString(path)); |
201 fInfo.push(SkObjectParser::RegionOpToString(op)); | 201 fInfo.push(SkObjectParser::RegionOpToString(op)); |
202 fInfo.push(SkObjectParser::BoolToString(doAA)); | 202 fInfo.push(SkObjectParser::BoolToString(doAA)); |
203 } | 203 } |
204 | 204 |
205 void SkClipPathCommand::execute(SkCanvas* canvas) const { | 205 void SkClipPathCommand::execute(SkCanvas* canvas) const { |
206 canvas->clipPath(fPath, fOp, fDoAA); | 206 canvas->legacyClipPath(fPath, fOp, fDoAA); |
207 } | 207 } |
208 | 208 |
209 bool SkClipPathCommand::render(SkCanvas* canvas) const { | 209 bool SkClipPathCommand::render(SkCanvas* canvas) const { |
210 render_path(canvas, fPath); | 210 render_path(canvas, fPath); |
211 return true; | 211 return true; |
212 } | 212 } |
213 | 213 |
214 SkClipRegionCommand::SkClipRegionCommand(const SkRegion& region, SkRegion::Op op
) | 214 SkClipRegionCommand::SkClipRegionCommand(const SkRegion& region, SkRegion::Op op
) |
215 : INHERITED(CLIP_REGION) { | 215 : INHERITED(CLIP_REGION) { |
216 fRegion = region; | 216 fRegion = region; |
217 fOp = op; | 217 fOp = op; |
218 | 218 |
219 fInfo.push(SkObjectParser::RegionToString(region)); | 219 fInfo.push(SkObjectParser::RegionToString(region)); |
220 fInfo.push(SkObjectParser::RegionOpToString(op)); | 220 fInfo.push(SkObjectParser::RegionOpToString(op)); |
221 } | 221 } |
222 | 222 |
223 void SkClipRegionCommand::execute(SkCanvas* canvas) const { | 223 void SkClipRegionCommand::execute(SkCanvas* canvas) const { |
224 canvas->clipRegion(fRegion, fOp); | 224 canvas->legacyClipRegion(fRegion, fOp); |
225 } | 225 } |
226 | 226 |
227 SkClipRectCommand::SkClipRectCommand(const SkRect& rect, SkRegion::Op op, bool d
oAA) | 227 SkClipRectCommand::SkClipRectCommand(const SkRect& rect, SkRegion::Op op, bool d
oAA) |
228 : INHERITED(CLIP_RECT) { | 228 : INHERITED(CLIP_RECT) { |
229 fRect = rect; | 229 fRect = rect; |
230 fOp = op; | 230 fOp = op; |
231 fDoAA = doAA; | 231 fDoAA = doAA; |
232 | 232 |
233 fInfo.push(SkObjectParser::RectToString(rect)); | 233 fInfo.push(SkObjectParser::RectToString(rect)); |
234 fInfo.push(SkObjectParser::RegionOpToString(op)); | 234 fInfo.push(SkObjectParser::RegionOpToString(op)); |
235 fInfo.push(SkObjectParser::BoolToString(doAA)); | 235 fInfo.push(SkObjectParser::BoolToString(doAA)); |
236 } | 236 } |
237 | 237 |
238 void SkClipRectCommand::execute(SkCanvas* canvas) const { | 238 void SkClipRectCommand::execute(SkCanvas* canvas) const { |
239 canvas->clipRect(fRect, fOp, fDoAA); | 239 canvas->legacyClipRect(fRect, fOp, fDoAA); |
240 } | 240 } |
241 | 241 |
242 SkClipRRectCommand::SkClipRRectCommand(const SkRRect& rrect, SkRegion::Op op, bo
ol doAA) | 242 SkClipRRectCommand::SkClipRRectCommand(const SkRRect& rrect, SkRegion::Op op, bo
ol doAA) |
243 : INHERITED(CLIP_RRECT) { | 243 : INHERITED(CLIP_RRECT) { |
244 fRRect = rrect; | 244 fRRect = rrect; |
245 fOp = op; | 245 fOp = op; |
246 fDoAA = doAA; | 246 fDoAA = doAA; |
247 | 247 |
248 fInfo.push(SkObjectParser::RRectToString(rrect)); | 248 fInfo.push(SkObjectParser::RRectToString(rrect)); |
249 fInfo.push(SkObjectParser::RegionOpToString(op)); | 249 fInfo.push(SkObjectParser::RegionOpToString(op)); |
250 fInfo.push(SkObjectParser::BoolToString(doAA)); | 250 fInfo.push(SkObjectParser::BoolToString(doAA)); |
251 } | 251 } |
252 | 252 |
253 void SkClipRRectCommand::execute(SkCanvas* canvas) const { | 253 void SkClipRRectCommand::execute(SkCanvas* canvas) const { |
254 canvas->clipRRect(fRRect, fOp, fDoAA); | 254 canvas->legacyClipRRect(fRRect, fOp, fDoAA); |
255 } | 255 } |
256 | 256 |
257 bool SkClipRRectCommand::render(SkCanvas* canvas) const { | 257 bool SkClipRRectCommand::render(SkCanvas* canvas) const { |
258 render_rrect(canvas, fRRect); | 258 render_rrect(canvas, fRRect); |
259 return true; | 259 return true; |
260 } | 260 } |
261 | 261 |
262 SkConcatCommand::SkConcatCommand(const SkMatrix& matrix) | 262 SkConcatCommand::SkConcatCommand(const SkMatrix& matrix) |
263 : INHERITED(CONCAT) { | 263 : INHERITED(CONCAT) { |
264 fMatrix = matrix; | 264 fMatrix = matrix; |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 p.setColor(SK_ColorCYAN); | 1017 p.setColor(SK_ColorCYAN); |
1018 p.setStyle(SkPaint::kStroke_Style); | 1018 p.setStyle(SkPaint::kStroke_Style); |
1019 canvas->drawRect(fCullRect, p); | 1019 canvas->drawRect(fCullRect, p); |
1020 } | 1020 } |
1021 | 1021 |
1022 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } | 1022 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } |
1023 | 1023 |
1024 void SkPopCullCommand::execute(SkCanvas* canvas) const { | 1024 void SkPopCullCommand::execute(SkCanvas* canvas) const { |
1025 canvas->popCull(); | 1025 canvas->popCull(); |
1026 } | 1026 } |
OLD | NEW |