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

Unified Diff: samplecode/SampleAARects.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/ClockFaceView.cpp ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleAARects.cpp
diff --git a/samplecode/SampleAARects.cpp b/samplecode/SampleAARects.cpp
index 0f8490001012edde3e331a01c4abe83d2b10977b..e84c9664a0eee6a1c47e148608580b921aa125c5 100644
--- a/samplecode/SampleAARects.cpp
+++ b/samplecode/SampleAARects.cpp
@@ -85,95 +85,95 @@ protected:
paints[p].setAlpha(a > 1 ? 0x80 : 0xff);
canvas->save();
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.f),
- SkFloatToScalar(0.f),
- SkFloatToScalar(40.f),
- SkFloatToScalar(40.f));
+ rect = SkRect::MakeLTRB(0.f,
+ 0.f,
+ 40.f,
+ 40.f);
canvas->drawRect(rect, paints[p]);
canvas->translate(dx, 0);
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.5f),
- SkFloatToScalar(0.5f),
- SkFloatToScalar(40.5f),
- SkFloatToScalar(40.5f));
+ rect = SkRect::MakeLTRB(0.5f,
+ 0.5f,
+ 40.5f,
+ 40.5f);
canvas->drawRect(rect, paints[p]);
canvas->translate(dx, 0);
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.5f),
- SkFloatToScalar(0.5f),
- SkFloatToScalar(40.f),
- SkFloatToScalar(40.f));
+ rect = SkRect::MakeLTRB(0.5f,
+ 0.5f,
+ 40.f,
+ 40.f);
canvas->drawRect(rect, paints[p]);
canvas->translate(dx, 0);
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.75f),
- SkFloatToScalar(0.75f),
- SkFloatToScalar(40.75f),
- SkFloatToScalar(40.75f));
+ rect = SkRect::MakeLTRB(0.75f,
+ 0.75f,
+ 40.75f,
+ 40.75f);
canvas->drawRect(rect, paints[p]);
canvas->translate(dx, 0);
canvas->save();
- canvas->translate(SkFloatToScalar(.33f), SkFloatToScalar(.67f));
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.0f),
- SkFloatToScalar(0.0f),
- SkFloatToScalar(40.0f),
- SkFloatToScalar(40.0f));
+ canvas->translate(.33f, .67f);
+ rect = SkRect::MakeLTRB(0.0f,
+ 0.0f,
+ 40.0f,
+ 40.0f);
canvas->drawRect(rect, paints[p]);
canvas->restore();
canvas->translate(dx, 0);
canvas->save();
- matrix.setRotate(SkFloatToScalar(45.f));
+ matrix.setRotate(45.f);
canvas->concat(matrix);
- canvas->translate(SkFloatToScalar(20.0f / sqrtf(2.f)),
- SkFloatToScalar(20.0f / sqrtf(2.f)));
- rect = SkRect::MakeLTRB(SkFloatToScalar(-20.0f),
- SkFloatToScalar(-20.0f),
- SkFloatToScalar(20.0f),
- SkFloatToScalar(20.0f));
+ canvas->translate(20.0f / sqrtf(2.f),
+ 20.0f / sqrtf(2.f));
+ rect = SkRect::MakeLTRB(-20.0f,
+ -20.0f,
+ 20.0f,
+ 20.0f);
canvas->drawRect(rect, paints[p]);
canvas->restore();
canvas->translate(dx, 0);
canvas->save();
- canvas->rotate(SkFloatToScalar(90.f));
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.0f),
- SkFloatToScalar(0.0f),
- SkFloatToScalar(40.0f),
- SkFloatToScalar(-40.0f));
+ canvas->rotate(90.f);
+ rect = SkRect::MakeLTRB(0.0f,
+ 0.0f,
+ 40.0f,
+ -40.0f);
canvas->drawRect(rect, paints[p]);
canvas->restore();
canvas->translate(dx, 0);
canvas->save();
- canvas->rotate(SkFloatToScalar(90.f));
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.5f),
- SkFloatToScalar(0.5f),
- SkFloatToScalar(40.5f),
- SkFloatToScalar(-40.5f));
+ canvas->rotate(90.f);
+ rect = SkRect::MakeLTRB(0.5f,
+ 0.5f,
+ 40.5f,
+ -40.5f);
canvas->drawRect(rect, paints[p]);
canvas->restore();
canvas->translate(dx, 0);
canvas->save();
- matrix.setScale(SkFloatToScalar(-1.f), SkFloatToScalar(-1.f));
+ matrix.setScale(-1.f, -1.f);
canvas->concat(matrix);
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.5f),
- SkFloatToScalar(0.5f),
- SkFloatToScalar(-40.5f),
- SkFloatToScalar(-40.5f));
+ rect = SkRect::MakeLTRB(0.5f,
+ 0.5f,
+ -40.5f,
+ -40.5f);
canvas->drawRect(rect, paints[p]);
canvas->restore();
canvas->translate(dx, 0);
canvas->save();
- matrix.setScale(SkFloatToScalar(2.1f), SkFloatToScalar(4.1f));
+ matrix.setScale(2.1f, 4.1f);
canvas->concat(matrix);
- rect = SkRect::MakeLTRB(SkFloatToScalar(0.1f),
- SkFloatToScalar(0.1f),
- SkFloatToScalar(19.1f),
- SkFloatToScalar(9.1f));
+ rect = SkRect::MakeLTRB(0.1f,
+ 0.1f,
+ 19.1f,
+ 9.1f);
canvas->drawRect(rect, paints[p]);
canvas->restore();
canvas->translate(dx, 0);
« no previous file with comments | « samplecode/ClockFaceView.cpp ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698