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

Unified Diff: tests/LayerDrawLooperTest.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 | « tests/ImageFilterTest.cpp ('k') | tests/MathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/LayerDrawLooperTest.cpp
diff --git a/tests/LayerDrawLooperTest.cpp b/tests/LayerDrawLooperTest.cpp
index 80f986f867e342901873886043eb781170c1c95e..11ac48869f556ddd87d7afe68af1a38299995198 100644
--- a/tests/LayerDrawLooperTest.cpp
+++ b/tests/LayerDrawLooperTest.cpp
@@ -42,7 +42,7 @@ static void test_frontToBack(skiatest::Reporter* reporter) {
(void)looper->addLayer(layerInfo);
// Add the back layer, with some layer info set.
- layerInfo.fOffset.set(SkFloatToScalar(10.0f), SkFloatToScalar(20.0f));
+ layerInfo.fOffset.set(10.0f, 20.0f);
layerInfo.fPaintBits |= SkLayerDrawLooper::kXfermode_Bit;
SkPaint* layerPaint = looper->addLayer(layerInfo);
layerPaint->setXfermodeMode(SkXfermode::kSrc_Mode);
@@ -55,17 +55,17 @@ static void test_frontToBack(skiatest::Reporter* reporter) {
// The back layer should come first.
REPORTER_ASSERT(reporter, looper->next(&canvas, &paint));
REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrc_Mode));
- canvas.drawRect(SkRect::MakeWH(SkFloatToScalar(50.0f), SkFloatToScalar(50.0f)), paint);
- REPORTER_ASSERT(reporter, SkFloatToScalar(10.0f) == device.fLastMatrix.getTranslateX());
- REPORTER_ASSERT(reporter, SkFloatToScalar(20.0f) == device.fLastMatrix.getTranslateY());
+ canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
+ REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX());
+ REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY());
paint.reset();
// Then the front layer.
REPORTER_ASSERT(reporter, looper->next(&canvas, &paint));
REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode));
- canvas.drawRect(SkRect::MakeWH(SkFloatToScalar(50.0f), SkFloatToScalar(50.0f)), paint);
- REPORTER_ASSERT(reporter, SkFloatToScalar(0.0f) == device.fLastMatrix.getTranslateX());
- REPORTER_ASSERT(reporter, SkFloatToScalar(0.0f) == device.fLastMatrix.getTranslateY());
+ canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
+ REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateX());
+ REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateY());
// Only two layers were added, so that should be the end.
REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint));
@@ -79,7 +79,7 @@ static void test_backToFront(skiatest::Reporter* reporter) {
(void)looper->addLayerOnTop(layerInfo);
// Add the front layer, with some layer info set.
- layerInfo.fOffset.set(SkFloatToScalar(10.0f), SkFloatToScalar(20.0f));
+ layerInfo.fOffset.set(10.0f, 20.0f);
layerInfo.fPaintBits |= SkLayerDrawLooper::kXfermode_Bit;
SkPaint* layerPaint = looper->addLayerOnTop(layerInfo);
layerPaint->setXfermodeMode(SkXfermode::kSrc_Mode);
@@ -92,17 +92,17 @@ static void test_backToFront(skiatest::Reporter* reporter) {
// The back layer should come first.
REPORTER_ASSERT(reporter, looper->next(&canvas, &paint));
REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode));
- canvas.drawRect(SkRect::MakeWH(SkFloatToScalar(50.0f), SkFloatToScalar(50.0f)), paint);
- REPORTER_ASSERT(reporter, SkFloatToScalar(0.0f) == device.fLastMatrix.getTranslateX());
- REPORTER_ASSERT(reporter, SkFloatToScalar(0.0f) == device.fLastMatrix.getTranslateY());
+ canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
+ REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateX());
+ REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateY());
paint.reset();
// Then the front layer.
REPORTER_ASSERT(reporter, looper->next(&canvas, &paint));
REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrc_Mode));
- canvas.drawRect(SkRect::MakeWH(SkFloatToScalar(50.0f), SkFloatToScalar(50.0f)), paint);
- REPORTER_ASSERT(reporter, SkFloatToScalar(10.0f) == device.fLastMatrix.getTranslateX());
- REPORTER_ASSERT(reporter, SkFloatToScalar(20.0f) == device.fLastMatrix.getTranslateY());
+ canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
+ REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX());
+ REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY());
// Only two layers were added, so that should be the end.
REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint));
@@ -116,7 +116,7 @@ static void test_mixed(skiatest::Reporter* reporter) {
(void)looper->addLayer(layerInfo);
// Add the front layer, with some layer info set.
- layerInfo.fOffset.set(SkFloatToScalar(10.0f), SkFloatToScalar(20.0f));
+ layerInfo.fOffset.set(10.0f, 20.0f);
layerInfo.fPaintBits |= SkLayerDrawLooper::kXfermode_Bit;
SkPaint* layerPaint = looper->addLayerOnTop(layerInfo);
layerPaint->setXfermodeMode(SkXfermode::kSrc_Mode);
@@ -129,17 +129,17 @@ static void test_mixed(skiatest::Reporter* reporter) {
// The back layer should come first.
REPORTER_ASSERT(reporter, looper->next(&canvas, &paint));
REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode));
- canvas.drawRect(SkRect::MakeWH(SkFloatToScalar(50.0f), SkFloatToScalar(50.0f)), paint);
- REPORTER_ASSERT(reporter, SkFloatToScalar(0.0f) == device.fLastMatrix.getTranslateX());
- REPORTER_ASSERT(reporter, SkFloatToScalar(0.0f) == device.fLastMatrix.getTranslateY());
+ canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
+ REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateX());
+ REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateY());
paint.reset();
// Then the front layer.
REPORTER_ASSERT(reporter, looper->next(&canvas, &paint));
REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrc_Mode));
- canvas.drawRect(SkRect::MakeWH(SkFloatToScalar(50.0f), SkFloatToScalar(50.0f)), paint);
- REPORTER_ASSERT(reporter, SkFloatToScalar(10.0f) == device.fLastMatrix.getTranslateX());
- REPORTER_ASSERT(reporter, SkFloatToScalar(20.0f) == device.fLastMatrix.getTranslateY());
+ canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
+ REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX());
+ REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY());
// Only two layers were added, so that should be the end.
REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint));
« no previous file with comments | « tests/ImageFilterTest.cpp ('k') | tests/MathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698