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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/circles.cpp
diff --git a/gm/circles.cpp b/gm/circles.cpp
index 734fcb5a0bbe3287e4e5b2fbd369fd55463590c1..2c9368be92fc7b01eb6f67e89eace17c7162c4f7 100644
--- a/gm/circles.cpp
+++ b/gm/circles.cpp
@@ -157,6 +157,17 @@ protected:
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkLCGRandom rand;
+ // Draw a giant AA circle as the background.
+ SkISize size = this->getISize();
+ SkScalar giantRadius = SkTMin(SkIntToScalar(size.fWidth),
+ SkIntToScalar(size.fHeight)) / 2.f;
+ SkPoint giantCenter = SkPoint::Make(SkIntToScalar(size.fWidth/2),
+ SkIntToScalar(size.fHeight/2));
+ SkPaint giantPaint;
+ giantPaint.setAntiAlias(true);
+ giantPaint.setColor(0x80808080);
+ canvas->drawCircle(giantCenter.fX, giantCenter.fY, giantRadius, giantPaint);
+
canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1);
int i;
for (i = 0; i < fPaints.count(); ++i) {
« 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