summaryrefslogtreecommitdiffstats
path: root/skia/ext
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2015-04-30 08:58:57 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 15:59:24 +0000
commit98b640c172675a91819b165d946ad074478c0eb3 (patch)
treebe2c9d9b2487215cccfb8fbcce668dfd4b455a97 /skia/ext
parent46a4afb3bab8b7660ccecbe6e9ce1104d6141fd5 (diff)
downloadchromium_src-98b640c172675a91819b165d946ad074478c0eb3.zip
chromium_src-98b640c172675a91819b165d946ad074478c0eb3.tar.gz
chromium_src-98b640c172675a91819b165d946ad074478c0eb3.tar.bz2
skia/ext: Add matrix and filter quality to gather pixel refs.
This patch adds extra information returned to gather pixel refs caller. Specifically it adds filter quality from the paint and the transformation matrix. R=enne, reed1 Review URL: https://codereview.chromium.org/1103783002 Cr-Commit-Position: refs/heads/master@{#327721}
Diffstat (limited to 'skia/ext')
-rw-r--r--skia/ext/pixel_ref_utils.cc40
-rw-r--r--skia/ext/pixel_ref_utils.h2
-rw-r--r--skia/ext/pixel_ref_utils_unittest.cc118
3 files changed, 142 insertions, 18 deletions
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc
index 7029d46..86e2c09 100644
--- a/skia/ext/pixel_ref_utils.cc
+++ b/skia/ext/pixel_ref_utils.cc
@@ -30,13 +30,18 @@ class DiscardablePixelRefSet {
std::vector<PixelRefUtils::PositionPixelRef>* pixel_refs)
: pixel_refs_(pixel_refs) {}
- void Add(SkPixelRef* pixel_ref, const SkRect& rect) {
+ void Add(SkPixelRef* pixel_ref,
+ const SkRect& rect,
+ const SkMatrix& matrix,
+ SkFilterQuality filter_quality) {
// Only save discardable pixel refs.
if (pixel_ref->getURI() &&
!strcmp(pixel_ref->getURI(), kLabelDiscardable)) {
PixelRefUtils::PositionPixelRef position_pixel_ref;
position_pixel_ref.pixel_ref = pixel_ref;
position_pixel_ref.pixel_ref_rect = rect;
+ position_pixel_ref.matrix = matrix;
+ position_pixel_ref.filter_quality = filter_quality;
pixel_refs_->push_back(position_pixel_ref);
}
}
@@ -55,7 +60,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
SkBitmap bitmap;
if (GetBitmapFromPaint(paint, &bitmap)) {
SkRect clip_rect = SkRect::Make(draw.fRC->getBounds());
- AddBitmap(bitmap, clip_rect);
+ AddBitmap(bitmap, clip_rect, *draw.fMatrix, paint.getFilterQuality());
}
}
@@ -93,8 +98,9 @@ class GatherPixelRefDevice : public SkBitmapDevice {
if (GetBitmapFromPaint(paint, &bitmap)) {
SkRect mapped_rect;
draw.fMatrix->mapRect(&mapped_rect, rect);
- if (mapped_rect.intersect(SkRect::Make(draw.fRC->getBounds())))
- AddBitmap(bitmap, mapped_rect);
+ if (mapped_rect.intersect(SkRect::Make(draw.fRC->getBounds()))) {
+ AddBitmap(bitmap, mapped_rect, *draw.fMatrix, paint.getFilterQuality());
+ }
}
}
void drawOval(const SkDraw& draw,
@@ -135,11 +141,13 @@ class GatherPixelRefDevice : public SkBitmapDevice {
SkRect bitmap_rect = SkRect::MakeWH(bitmap.width(), bitmap.height());
SkRect mapped_rect;
total_matrix.mapRect(&mapped_rect, bitmap_rect);
- AddBitmap(bitmap, mapped_rect);
+ AddBitmap(bitmap, mapped_rect, total_matrix, paint.getFilterQuality());
SkBitmap paint_bitmap;
- if (GetBitmapFromPaint(paint, &paint_bitmap))
- AddBitmap(paint_bitmap, mapped_rect);
+ if (GetBitmapFromPaint(paint, &paint_bitmap)) {
+ AddBitmap(paint_bitmap, mapped_rect, total_matrix,
+ paint.getFilterQuality());
+ }
}
void drawBitmapRect(const SkDraw& draw,
const SkBitmap& bitmap,
@@ -165,10 +173,13 @@ class GatherPixelRefDevice : public SkBitmapDevice {
SkRect mapped_rect;
matrix.mapRect(&mapped_rect, bitmap_rect);
- AddBitmap(bitmap, mapped_rect);
+ SkMatrix identity;
+ identity.setIdentity();
+ // Sprites aren't affected by current matrix, so use the identity matrix.
+ AddBitmap(bitmap, mapped_rect, identity, paint.getFilterQuality());
SkBitmap paint_bitmap;
if (GetBitmapFromPaint(paint, &paint_bitmap))
- AddBitmap(paint_bitmap, mapped_rect);
+ AddBitmap(paint_bitmap, mapped_rect, identity, paint.getFilterQuality());
}
void drawText(const SkDraw& draw,
const void* text,
@@ -324,11 +335,16 @@ class GatherPixelRefDevice : public SkBitmapDevice {
private:
DiscardablePixelRefSet* pixel_ref_set_;
- void AddBitmap(const SkBitmap& bm, const SkRect& rect) {
+ void AddBitmap(const SkBitmap& bm,
+ const SkRect& rect,
+ const SkMatrix& matrix,
+ SkFilterQuality filter_quality) {
SkRect canvas_rect = SkRect::MakeWH(width(), height());
SkRect paint_rect = SkRect::MakeEmpty();
- if (paint_rect.intersect(rect, canvas_rect))
- pixel_ref_set_->Add(bm.pixelRef(), paint_rect);
+ if (paint_rect.intersect(rect, canvas_rect)) {
+ pixel_ref_set_->Add(bm.pixelRef(), paint_rect, matrix,
+ filter_quality);
+ }
}
bool GetBitmapFromPaint(const SkPaint& paint, SkBitmap* bm) {
diff --git a/skia/ext/pixel_ref_utils.h b/skia/ext/pixel_ref_utils.h
index 2b36dfc..f8de4b6 100644
--- a/skia/ext/pixel_ref_utils.h
+++ b/skia/ext/pixel_ref_utils.h
@@ -18,6 +18,8 @@ class SK_API PixelRefUtils {
struct PositionPixelRef {
SkPixelRef* pixel_ref;
SkRect pixel_ref_rect;
+ SkMatrix matrix;
+ SkFilterQuality filter_quality;
};
static void GatherDiscardablePixelRefs(
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc
index 1e8f6ee..6ab2f62 100644
--- a/skia/ext/pixel_ref_utils_unittest.cc
+++ b/skia/ext/pixel_ref_utils_unittest.cc
@@ -90,6 +90,17 @@ SkPicture* StopRecording(SkPictureRecorder* recorder, SkCanvas* canvas) {
} // namespace
+void VerifyScales(SkScalar x_scale,
+ SkScalar y_scale,
+ const SkMatrix& matrix,
+ int source_line) {
+ SkSize scales;
+ bool success = matrix.decomposeScale(&scales);
+ EXPECT_TRUE(success) << "line: " << source_line;
+ EXPECT_FLOAT_EQ(x_scale, scales.width()) << "line: " << source_line;
+ EXPECT_FLOAT_EQ(y_scale, scales.height()) << "line: " << source_line;
+}
+
TEST(PixelRefUtilsTest, DrawPaint) {
gfx::Rect layer_rect(0, 0, 256, 256);
@@ -111,6 +122,12 @@ TEST(PixelRefUtilsTest, DrawPaint) {
canvas->drawPaint(first_paint);
canvas->clipRect(SkRect::MakeXYWH(34, 45, 56, 67));
canvas->drawPaint(second_paint);
+
+ canvas->save();
+ canvas->scale(2.f, 3.f);
+ canvas->drawPaint(second_paint);
+ canvas->restore();
+
// Total clip is now (34, 45, 56, 55)
canvas->clipRect(SkRect::MakeWH(100, 100));
canvas->drawPaint(third_paint);
@@ -121,13 +138,22 @@ TEST(PixelRefUtilsTest, DrawPaint) {
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
- EXPECT_EQ(3u, pixel_refs.size());
+ EXPECT_EQ(4u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 256, 256),
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(34, 45, 56, 67),
+ gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
+ VerifyScales(1.f, 1.f, pixel_refs[1].matrix, __LINE__);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(34, 45, 56, 67),
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
+ VerifyScales(2.f, 3.f, pixel_refs[2].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[2].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(34, 45, 56, 55),
- gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
+ gfx::SkRectToRectF(pixel_refs[3].pixel_ref_rect));
+ VerifyScales(1.f, 1.f, pixel_refs[3].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[3].filter_quality);
}
TEST(PixelRefUtilsTest, DrawPoints) {
@@ -178,10 +204,16 @@ TEST(PixelRefUtilsTest, DrawPoints) {
EXPECT_EQ(3u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90),
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),
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, 55, 150, 145),
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);
}
TEST(PixelRefUtilsTest, DrawRect) {
@@ -227,10 +259,16 @@ TEST(PixelRefUtilsTest, DrawRect) {
EXPECT_EQ(3u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 20, 30, 40),
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(5, 50, 25, 35),
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),
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);
}
TEST(PixelRefUtilsTest, DrawRRect) {
@@ -281,10 +319,16 @@ TEST(PixelRefUtilsTest, DrawRRect) {
EXPECT_EQ(3u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 20, 30, 40),
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(5, 50, 25, 35),
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),
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);
}
TEST(PixelRefUtilsTest, DrawOval) {
@@ -307,7 +351,7 @@ TEST(PixelRefUtilsTest, DrawOval) {
canvas->save();
- canvas->scale(2, 0.5);
+ canvas->scale(2.f, 0.5f);
// (20, 10, 60, 20).
canvas->drawOval(SkRect::MakeXYWH(10, 20, 30, 40), first_paint);
@@ -334,10 +378,16 @@ TEST(PixelRefUtilsTest, DrawOval) {
EXPECT_EQ(3u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(20, 10, 60, 20),
gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
+ VerifyScales(2.f, 0.5f, pixel_refs[0].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[0].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(1, 35, 25, 35),
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),
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);
}
TEST(PixelRefUtilsTest, DrawPath) {
@@ -379,8 +429,12 @@ TEST(PixelRefUtilsTest, DrawPath) {
EXPECT_EQ(2u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(12, 13, 38, 88),
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),
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);
}
TEST(PixelRefUtilsTest, DrawBitmap) {
@@ -399,6 +453,8 @@ TEST(PixelRefUtilsTest, DrawBitmap) {
CreateBitmap(gfx::Size(50, 1), "discardable", &fourth);
SkBitmap fifth;
CreateBitmap(gfx::Size(10, 10), "discardable", &fifth);
+ SkBitmap sixth;
+ CreateBitmap(gfx::Size(10, 10), "discardable", &sixth);
canvas->save();
@@ -420,28 +476,52 @@ TEST(PixelRefUtilsTest, DrawBitmap) {
canvas->drawBitmap(fourth, 0, 0);
canvas->restore();
+ canvas->save();
- canvas->scale(5, 6);
+ canvas->scale(5.f, 6.f);
// At (0, 0), scaled by 5 and 6
canvas->drawBitmap(fifth, 0, 0);
+ canvas->restore();
+
+ canvas->rotate(27);
+ canvas->scale(3.3f, 0.4f);
+
+ canvas->drawBitmap(sixth, 0, 0);
+
+ canvas->restore();
+
skia::RefPtr<SkPicture> picture =
skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
- EXPECT_EQ(5u, pixel_refs.size());
+ EXPECT_EQ(6u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 50, 50),
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(25, 0, 50, 50),
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),
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);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 1, 50),
gfx::SkRectToRectF(pixel_refs[3].pixel_ref_rect));
+ VerifyScales(1.f, 1.f, pixel_refs[3].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[3].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 50, 60),
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),
+ 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);
}
TEST(PixelRefUtilsTest, DrawBitmapRect) {
@@ -488,12 +568,20 @@ TEST(PixelRefUtilsTest, DrawBitmapRect) {
EXPECT_EQ(4u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 100, 100),
gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect));
+ VerifyScales(2.f, 2.f, pixel_refs[0].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[0].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(75, 50, 10, 10),
gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect));
+ VerifyScales(0.2f, 0.2f, pixel_refs[1].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[1].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 30, 100, 100),
gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect));
+ VerifyScales(2.f, 2.f, pixel_refs[2].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[2].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 30, 100, 100),
gfx::SkRectToRectF(pixel_refs[3].pixel_ref_rect));
+ VerifyScales(2.f, 2.f, pixel_refs[3].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[3].filter_quality);
}
TEST(PixelRefUtilsTest, DrawSprite) {
@@ -539,7 +627,7 @@ TEST(PixelRefUtilsTest, DrawSprite) {
SkPaint first_paint;
first_paint.setShader(&first_shader);
- canvas->scale(5, 6);
+ canvas->scale(5.f, 6.f);
// (100, 100, 50, 50).
canvas->drawSprite(fifth, 100, 100, &first_paint);
@@ -552,16 +640,28 @@ TEST(PixelRefUtilsTest, DrawSprite) {
EXPECT_EQ(6u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 50, 50),
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, 0, 50, 50),
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(25, 0, 50, 50),
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);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 50, 50),
gfx::SkRectToRectF(pixel_refs[3].pixel_ref_rect));
+ VerifyScales(1.f, 1.f, pixel_refs[3].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[3].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(100, 100, 50, 50),
gfx::SkRectToRectF(pixel_refs[4].pixel_ref_rect));
+ VerifyScales(1.f, 1.f, pixel_refs[4].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[4].filter_quality);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(100, 100, 50, 50),
gfx::SkRectToRectF(pixel_refs[5].pixel_ref_rect));
+ VerifyScales(1.f, 1.f, pixel_refs[5].matrix, __LINE__);
+ EXPECT_EQ(kNone_SkFilterQuality, pixel_refs[5].filter_quality);
}
TEST(PixelRefUtilsTest, DrawText) {
@@ -674,10 +774,16 @@ TEST(PixelRefUtilsTest, DrawVertices) {
EXPECT_EQ(3u, pixel_refs.size());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(10, 10, 90, 90),
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),
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, 55, 150, 145),
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);
}
} // namespace skia