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

Side by Side Diff: gm/blurs.cpp

Issue 730673002: update gm to place inner rect on fractional boundary (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | 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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return SkISize::Make(700, 500); 112 return SkISize::Make(700, 500);
113 } 113 }
114 114
115 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 115 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
116 SkPaint paint; 116 SkPaint paint;
117 117
118 paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 118 paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
119 2.3f))->unref(); 119 2.3f))->unref();
120 120
121 SkRect outer = SkRect::MakeXYWH(10.125f, 10.125f, 100, 100); 121 SkRect outer = SkRect::MakeXYWH(10.125f, 10.125f, 100, 100);
122 SkRect inner = SkRect::MakeXYWH(20, 20, 80, 80); 122 SkRect inner = SkRect::MakeXYWH(20.125f, 20.125f, 80, 80);
123 SkPath path; 123 SkPath path;
124 path.addRect(outer, SkPath::kCW_Direction); 124 path.addRect(outer, SkPath::kCW_Direction);
125 path.addRect(inner, SkPath::kCCW_Direction); 125 path.addRect(inner, SkPath::kCCW_Direction);
126 126
127 canvas->drawPath(path, paint); 127 canvas->drawPath(path, paint);
128 // important to translate by a factional amount (.25) to exercise a diff erent "phase" 128 // important to translate by a factional amount to exercise a different "phase"
129 // of the same path w.r.t. the pixel grid 129 // of the same path w.r.t. the pixel grid
130 canvas->translate(SkScalarRoundToScalar(path.getBounds().width()) + 14 + 0.25f, 0); 130 SkScalar dx = SkScalarRoundToScalar(path.getBounds().width()) + 14 + 0.1 25f;
131 canvas->translate(dx, 0);
131 canvas->drawPath(path, paint); 132 canvas->drawPath(path, paint);
132 } 133 }
133 }; 134 };
134 DEF_GM( return new Blur2RectsGM; ) 135 DEF_GM( return new Blur2RectsGM; )
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698