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

Side by Side Diff: gm/complexclip3.cpp

Issue 2357333002: allow clip calls w/o op param, remove unnecessary kReplace ops (Closed)
Patch Set: Created 4 years, 3 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 | « gm/complexclip.cpp ('k') | gm/distantclip.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "gm.h" 7 #include "gm.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 bool doAAA = SkToBool(aaBits & 1); 77 bool doAAA = SkToBool(aaBits & 1);
78 bool doAAB = SkToBool(aaBits & 2); 78 bool doAAB = SkToBool(aaBits & 2);
79 bool doInvA = SkToBool(invA); 79 bool doInvA = SkToBool(invA);
80 bool doInvB = SkToBool(invB); 80 bool doInvB = SkToBool(invB);
81 canvas->save(); 81 canvas->save();
82 // set clip 82 // set clip
83 firstClip->setFillType(doInvA ? SkPath::kInverseEvenOdd_ FillType : 83 firstClip->setFillType(doInvA ? SkPath::kInverseEvenOdd_ FillType :
84 SkPath::kEvenOdd_FillType); 84 SkPath::kEvenOdd_FillType);
85 secondClip->setFillType(doInvB ? SkPath::kInverseEvenOdd _FillType : 85 secondClip->setFillType(doInvB ? SkPath::kInverseEvenOdd _FillType :
86 SkPath::kEvenOdd_FillType); 86 SkPath::kEvenOdd_FillType);
87 canvas->clipPath(*firstClip, SkCanvas::kIntersect_Op, do AAA); 87 canvas->clipPath(*firstClip, doAAA);
88 canvas->clipPath(*secondClip, gOps[op].fOp, doAAB); 88 canvas->clipPath(*secondClip, gOps[op].fOp, doAAB);
89 89
90 // draw rect clipped 90 // draw rect clipped
91 SkRect r = { 0, 0, 100, 100 }; 91 SkRect r = { 0, 0, 100, 100 };
92 canvas->drawRect(r, pathPaint); 92 canvas->drawRect(r, pathPaint);
93 canvas->restore(); 93 canvas->restore();
94 94
95 95
96 SkScalar txtX = SkIntToScalar(10); 96 SkScalar txtX = SkIntToScalar(10);
97 paint.setColor(SK_ColorBLACK); 97 paint.setColor(SK_ColorBLACK);
(...skipping 25 matching lines...) Expand all
123 typedef GM INHERITED; 123 typedef GM INHERITED;
124 }; 124 };
125 125
126 ////////////////////////////////////////////////////////////////////////////// 126 //////////////////////////////////////////////////////////////////////////////
127 127
128 // Simple clip first 128 // Simple clip first
129 DEF_GM( return new ComplexClip3GM(true); ) 129 DEF_GM( return new ComplexClip3GM(true); )
130 // Complex clip first 130 // Complex clip first
131 DEF_GM( return new ComplexClip3GM(false); ) 131 DEF_GM( return new ComplexClip3GM(false); )
132 } 132 }
OLDNEW
« no previous file with comments | « gm/complexclip.cpp ('k') | gm/distantclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698