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

Unified Diff: skia/ext/pixel_ref_utils_unittest.cc

Issue 1279843004: cc: Plumb more details about pixel refs to tile manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 | « skia/ext/pixel_ref_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/pixel_ref_utils_unittest.cc
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc
index 2e1fa245050a84b5d3593a5daa39f1b78216c8e6..50691f3dd0a4f6735b21c6eaab58d17df91a9003 100644
--- a/skia/ext/pixel_ref_utils_unittest.cc
+++ b/skia/ext/pixel_ref_utils_unittest.cc
@@ -183,7 +183,7 @@ TEST(PixelRefUtilsTest, DrawPoints) {
canvas->save();
canvas->clipRect(SkRect::MakeWH(50, 50));
- // (10, 10, 40, 40).
+ // (10, 10, 90, 90).
canvas->drawPoints(SkCanvas::kPolygon_PointMode, 3, points, second_paint);
canvas->restore();
@@ -205,7 +205,7 @@ TEST(PixelRefUtilsTest, DrawPoints) {
gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[0].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[0].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90),
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
@@ -246,7 +246,7 @@ TEST(PixelRefUtilsTest, DrawRect) {
canvas->clipRect(SkRect::MakeXYWH(50, 50, 50, 50));
canvas->translate(20, 20);
- // (50, 50, 50, 50)
+ // (20, 20, 100, 100)
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), third_paint);
skia::RefPtr<SkPicture> picture =
@@ -264,7 +264,7 @@ TEST(PixelRefUtilsTest, DrawRect) {
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 50, 50, 50),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(20, 20, 100, 100),
gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[2].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[2].filter_quality);
@@ -306,7 +306,7 @@ TEST(PixelRefUtilsTest, DrawRRect) {
canvas->clipRect(SkRect::MakeXYWH(50, 50, 50, 50));
canvas->translate(20, 20);
rrect.setRect(SkRect::MakeXYWH(0, 0, 100, 100));
- // (50, 50, 50, 50)
+ // (20, 20, 100, 100)
canvas->drawRRect(rrect, third_paint);
skia::RefPtr<SkPicture> picture =
@@ -324,7 +324,7 @@ TEST(PixelRefUtilsTest, DrawRRect) {
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 50, 50, 50),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(20, 20, 100, 100),
gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[2].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[2].filter_quality);
@@ -365,7 +365,7 @@ TEST(PixelRefUtilsTest, DrawOval) {
canvas->clipRect(SkRect::MakeXYWH(50, 50, 50, 50));
canvas->translate(20, 20);
- // (50, 50, 50, 50)
+ // (20, 20, 100, 100).
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), third_paint);
skia::RefPtr<SkPicture> picture =
@@ -383,7 +383,7 @@ TEST(PixelRefUtilsTest, DrawOval) {
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(50, 50, 50, 50),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(20, 20, 100, 100),
gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[2].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[2].filter_quality);
@@ -414,7 +414,8 @@ TEST(PixelRefUtilsTest, DrawPath) {
canvas->save();
canvas->clipRect(SkRect::MakeWH(50, 50));
- // (12, 13, 38, 37).
+ // (12, 13, 38, 88), since clips are ignored as long as the shape is in the
+ // clip.
canvas->drawPath(path, second_paint);
canvas->restore();
@@ -430,7 +431,7 @@ TEST(PixelRefUtilsTest, DrawPath) {
gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[0].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[0].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(12, 13, 38, 37),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(12, 13, 38, 88),
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
@@ -517,7 +518,7 @@ TEST(PixelRefUtilsTest, DrawBitmap) {
gfx::SkRectToRectF(pixel_refs[4].pixel_ref_rect));
VerifyScales(5.f, 6.f, pixel_refs[4].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[4].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 29.403214f, 18.545712f),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(-1.8159621f, 0, 31.219175f, 18.545712f),
gfx::SkRectToRectF(pixel_refs[5].pixel_ref_rect));
VerifyScales(3.3f, 0.4f, pixel_refs[5].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[5].filter_quality);
@@ -737,7 +738,8 @@ TEST(PixelRefUtilsTest, DrawVertices) {
canvas->save();
canvas->clipRect(SkRect::MakeWH(50, 50));
- // (10, 10, 40, 40).
+ // (10, 10, 90, 90), since clips are ignored as long as the draw object is
+ // within clip.
canvas->drawVertices(SkCanvas::kTriangles_VertexMode,
3,
points,
@@ -775,7 +777,7 @@ TEST(PixelRefUtilsTest, DrawVertices) {
gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[0].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[0].filter_quality);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 40, 40),
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90),
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
« no previous file with comments | « skia/ext/pixel_ref_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698