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

Side by Side Diff: src/pipe/SkGPipeRead.cpp

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/utils/SkCanvasStack.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 245
246 /////////////////////////////////////////////////////////////////////////////// 246 ///////////////////////////////////////////////////////////////////////////////
247 /////////////////////////////////////////////////////////////////////////////// 247 ///////////////////////////////////////////////////////////////////////////////
248 248
249 static void clipPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 249 static void clipPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
250 SkGPipeState* state) { 250 SkGPipeState* state) {
251 SkPath path; 251 SkPath path;
252 reader->readPath(&path); 252 reader->readPath(&path);
253 bool doAA = SkToBool(DrawOp_unpackFlags(op32) & kClip_HasAntiAlias_DrawOpFla g); 253 bool doAA = SkToBool(DrawOp_unpackFlags(op32) & kClip_HasAntiAlias_DrawOpFla g);
254 canvas->clipPath(path, (SkRegion::Op)DrawOp_unpackData(op32), doAA); 254 canvas->legacyClipPath(path, (SkRegion::Op)DrawOp_unpackData(op32), doAA);
255 } 255 }
256 256
257 static void clipRegion_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 257 static void clipRegion_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
258 SkGPipeState* state) { 258 SkGPipeState* state) {
259 SkRegion rgn; 259 SkRegion rgn;
260 reader->readRegion(&rgn); 260 reader->readRegion(&rgn);
261 canvas->clipRegion(rgn, (SkRegion::Op)DrawOp_unpackData(op32)); 261 canvas->legacyClipRegion(rgn, (SkRegion::Op)DrawOp_unpackData(op32));
262 } 262 }
263 263
264 static void clipRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 264 static void clipRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
265 SkGPipeState* state) { 265 SkGPipeState* state) {
266 const SkRect* rect = skip<SkRect>(reader); 266 const SkRect* rect = skip<SkRect>(reader);
267 bool doAA = SkToBool(DrawOp_unpackFlags(op32) & kClip_HasAntiAlias_DrawOpFla g); 267 bool doAA = SkToBool(DrawOp_unpackFlags(op32) & kClip_HasAntiAlias_DrawOpFla g);
268 canvas->clipRect(*rect, (SkRegion::Op)DrawOp_unpackData(op32), doAA); 268 canvas->legacyClipRect(*rect, (SkRegion::Op)DrawOp_unpackData(op32), doAA);
269 } 269 }
270 270
271 static void clipRRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 271 static void clipRRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
272 SkGPipeState* state) { 272 SkGPipeState* state) {
273 SkRRect rrect; 273 SkRRect rrect;
274 reader->readRRect(&rrect); 274 reader->readRRect(&rrect);
275 bool doAA = SkToBool(DrawOp_unpackFlags(op32) & kClip_HasAntiAlias_DrawOpFla g); 275 bool doAA = SkToBool(DrawOp_unpackFlags(op32) & kClip_HasAntiAlias_DrawOpFla g);
276 canvas->clipRRect(rrect, (SkRegion::Op)DrawOp_unpackData(op32), doAA); 276 canvas->legacyClipRRect(rrect, (SkRegion::Op)DrawOp_unpackData(op32), doAA);
277 } 277 }
278 278
279 /////////////////////////////////////////////////////////////////////////////// 279 ///////////////////////////////////////////////////////////////////////////////
280 280
281 static void setMatrix_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 281 static void setMatrix_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
282 SkGPipeState* state) { 282 SkGPipeState* state) {
283 SkMatrix matrix; 283 SkMatrix matrix;
284 reader->readMatrix(&matrix); 284 reader->readMatrix(&matrix);
285 canvas->setMatrix(matrix); 285 canvas->setMatrix(matrix);
286 } 286 }
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 status = kReadAtom_Status; 957 status = kReadAtom_Status;
958 break; 958 break;
959 } 959 }
960 } 960 }
961 961
962 if (bytesRead) { 962 if (bytesRead) {
963 *bytesRead = reader.offset(); 963 *bytesRead = reader.offset();
964 } 964 }
965 return status; 965 return status;
966 } 966 }
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/utils/SkCanvasStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698