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

Side by Side Diff: gm/circles.cpp

Issue 761593006: Do circle anti-aliasing in normalized space to avoid precision issues with half-floats on Adreno. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add ignored tests 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 | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrOvalRenderer.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 2012 Intel Inc. 3 * Copyright 2012 Intel 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurDrawLooper.h" 9 #include "SkBlurDrawLooper.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 { 151 {
152 SkMatrix m; 152 SkMatrix m;
153 m.setRotate(SkIntToScalar(30)); 153 m.setRotate(SkIntToScalar(30));
154 fMatrices.push_back(m); 154 fMatrices.push_back(m);
155 } 155 }
156 } 156 }
157 157
158 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 158 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
159 SkLCGRandom rand; 159 SkLCGRandom rand;
160 // Draw a giant AA circle as the background.
161 SkISize size = this->getISize();
162 SkScalar giantRadius = SkTMin(SkIntToScalar(size.fWidth),
163 SkIntToScalar(size.fHeight)) / 2.f;
164 SkPoint giantCenter = SkPoint::Make(SkIntToScalar(size.fWidth/2),
165 SkIntToScalar(size.fHeight/2));
166 SkPaint giantPaint;
167 giantPaint.setAntiAlias(true);
168 giantPaint.setColor(0x80808080);
169 canvas->drawCircle(giantCenter.fX, giantCenter.fY, giantRadius, giantPai nt);
170
160 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); 171 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1);
161 int i; 172 int i;
162 for (i = 0; i < fPaints.count(); ++i) { 173 for (i = 0; i < fPaints.count(); ++i) {
163 canvas->save(); 174 canvas->save();
164 // position the path, and make it at off-integer coords. 175 // position the path, and make it at off-integer coords.
165 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, 176 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4,
166 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4); 177 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4);
167 SkColor color = rand.nextU(); 178 SkColor color = rand.nextU();
168 color |= 0xff000000; 179 color |= 0xff000000;
169 fPaints[i].setColor(color); 180 fPaints[i].setColor(color);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 SkTArray<SkPaint> fPaints; 213 SkTArray<SkPaint> fPaints;
203 SkTArray<SkMatrix> fMatrices; 214 SkTArray<SkMatrix> fMatrices;
204 }; 215 };
205 216
206 ////////////////////////////////////////////////////////////////////////////// 217 //////////////////////////////////////////////////////////////////////////////
207 218
208 static GM* MyFactory(void*) { return new CircleGM; } 219 static GM* MyFactory(void*) { return new CircleGM; }
209 static GMRegistry reg(MyFactory); 220 static GMRegistry reg(MyFactory);
210 221
211 } 222 }
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698