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

Side by Side Diff: gm/aaclip.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 | « bench/AAClipBench.cpp ('k') | gm/bigblurs.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 2011 Google Inc. 2 * Copyright 2011 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 12 matching lines...) Expand all
23 SkPaint foregroundPaint; 23 SkPaint foregroundPaint;
24 foregroundPaint.setColor(SkColorSetRGB(0x0, 0x0, 0xDD)); 24 foregroundPaint.setColor(SkColorSetRGB(0x0, 0x0, 0xDD));
25 foregroundPaint.setAntiAlias(true); 25 foregroundPaint.setAntiAlias(true);
26 26
27 canvas->save(); 27 canvas->save();
28 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); 28 canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
29 target.inset(SkIntToScalar(-2), SkIntToScalar(-2)); 29 target.inset(SkIntToScalar(-2), SkIntToScalar(-2));
30 canvas->drawRect(target, borderPaint); 30 canvas->drawRect(target, borderPaint);
31 target.inset(SkIntToScalar(2), SkIntToScalar(2)); 31 target.inset(SkIntToScalar(2), SkIntToScalar(2));
32 canvas->drawRect(target, backgroundPaint); 32 canvas->drawRect(target, backgroundPaint);
33 canvas->clipRect(target, SkRegion::kIntersect_Op, true); 33 canvas->clipRect(target, kIntersect_SkClipOp, true);
34 target.inset(SkIntToScalar(-4), SkIntToScalar(-4)); 34 target.inset(SkIntToScalar(-4), SkIntToScalar(-4));
35 canvas->drawRect(target, foregroundPaint); 35 canvas->drawRect(target, foregroundPaint);
36 canvas->restore(); 36 canvas->restore();
37 } 37 }
38 38
39 static void draw_square(SkCanvas* canvas, int x, int y) { 39 static void draw_square(SkCanvas* canvas, int x, int y) {
40 SkRect target (SkRect::MakeWH(10 * SK_Scalar1, 10 * SK_Scalar1)); 40 SkRect target (SkRect::MakeWH(10 * SK_Scalar1, 10 * SK_Scalar1));
41 draw(canvas, target, x, y); 41 draw(canvas, target, x, y);
42 } 42 }
43 43
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipPipe_Flag; } 190 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipPipe_Flag; }
191 191
192 private: 192 private:
193 typedef skiagm::GM INHERITED; 193 typedef skiagm::GM INHERITED;
194 }; 194 };
195 195
196 #if 0 // Disabled pending fix from reed@ 196 #if 0 // Disabled pending fix from reed@
197 DEF_GM( return SkNEW(CGImageGM); ) 197 DEF_GM( return SkNEW(CGImageGM); )
198 #endif 198 #endif
199 #endif 199 #endif
OLDNEW
« no previous file with comments | « bench/AAClipBench.cpp ('k') | gm/bigblurs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698