OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 7 |
8 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 void drawPathsOped(SkCanvas* canvas, SkRegion::Op op, SkColor color) { | 98 void drawPathsOped(SkCanvas* canvas, SkRegion::Op op, SkColor color) { |
99 | 99 |
100 this->drawOrig(canvas); | 100 this->drawOrig(canvas); |
101 | 101 |
102 canvas->save(); | 102 canvas->save(); |
103 | 103 |
104 // create the clip mask with the supplied boolean op | 104 // create the clip mask with the supplied boolean op |
105 if (kPath_GeomType == fGeomType) { | 105 if (kPath_GeomType == fGeomType) { |
106 // path-based case | 106 // path-based case |
107 canvas->clipPath(fBasePath, SkRegion::kReplace_Op, true); | 107 canvas->legacyClipPath(fBasePath, SkRegion::kReplace_Op, true); |
108 canvas->clipPath(fRectPath, op, true); | 108 canvas->legacyClipPath(fRectPath, op, true); |
109 } else { | 109 } else { |
110 // rect-based case | 110 // rect-based case |
111 canvas->clipRect(fBase, SkRegion::kReplace_Op, true); | 111 canvas->legacyClipRect(fBase, SkRegion::kReplace_Op, true); |
112 canvas->clipRect(fRect, op, true); | 112 canvas->legacyClipRect(fRect, op, true); |
113 } | 113 } |
114 | 114 |
115 // draw a rect that will entirely cover the clip mask area | 115 // draw a rect that will entirely cover the clip mask area |
116 SkPaint paint; | 116 SkPaint paint; |
117 paint.setColor(color); | 117 paint.setColor(color); |
118 | 118 |
119 SkRect r = SkRect::MakeLTRB(SkIntToScalar(90), SkIntToScalar(90), | 119 SkRect r = SkRect::MakeLTRB(SkIntToScalar(90), SkIntToScalar(90), |
120 SkIntToScalar(180), SkIntToScalar(180)); | 120 SkIntToScalar(180), SkIntToScalar(180)); |
121 | 121 |
122 canvas->drawRect(r, paint); | 122 canvas->drawRect(r, paint); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 }; | 192 }; |
193 | 193 |
194 ////////////////////////////////////////////////////////////////////////////// | 194 ////////////////////////////////////////////////////////////////////////////// |
195 | 195 |
196 // rects | 196 // rects |
197 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) | 197 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) |
198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) | 198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) |
199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) | 199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) |
200 | 200 |
201 } | 201 } |
OLD | NEW |