| Index: cc/playback/recording_source_unittest.cc
|
| diff --git a/cc/playback/recording_source_unittest.cc b/cc/playback/recording_source_unittest.cc
|
| index f1506e32ec83aee50c7923603875218a249de0ca..61f3b5ce12bee858014a9fa1303f2c6f79baf7b6 100644
|
| --- a/cc/playback/recording_source_unittest.cc
|
| +++ b/cc/playback/recording_source_unittest.cc
|
| @@ -80,7 +80,7 @@ TYPED_TEST(RecordingSourceTest, NoGatherPixelRefEmptyPixelRefs) {
|
| // If recording source do not gather pixel ref, raster source is not going to
|
| // get pixel refs.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(recorded_viewport, 1.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| @@ -100,51 +100,51 @@ TYPED_TEST(RecordingSourceTest, EmptyPixelRefs) {
|
|
|
| // Tile sized iterators.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 1.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 2.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 64, 64), 0.5, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| // Shifted tile sized iterators.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(140, 140, 128, 128), 1.0,
|
| &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(280, 280, 256, 256), 2.0,
|
| &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(70, 70, 64, 64), 0.5, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| // Layer sized iterators.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 1.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 512, 512), 2.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 0.5, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| @@ -183,51 +183,51 @@ TYPED_TEST(RecordingSourceTest, NoDiscardablePixelRefs) {
|
|
|
| // Tile sized iterators.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 1.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 2.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 64, 64), 0.5, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| // Shifted tile sized iterators.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(140, 140, 128, 128), 1.0,
|
| &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(280, 280, 256, 256), 2.0,
|
| &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(70, 70, 64, 64), 0.5, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| // Layer sized iterators.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 1.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 512, 512), 2.0, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 0.5, &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| @@ -264,55 +264,61 @@ TYPED_TEST(RecordingSourceTest, DiscardablePixelRefs) {
|
|
|
| // Tile sized iterators. These should find only one pixel ref.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 1.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 2.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 64, 64), 0.5, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
|
|
| // Shifted tile sized iterators. These should find only one pixel ref.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(140, 140, 128, 128), 1.0,
|
| &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(140, 140, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(280, 280, 256, 256), 2.0,
|
| &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(140, 140, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(70, 70, 64, 64), 0.5, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(140, 140, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
|
|
| // Ensure there's no discardable pixel refs in the empty cell
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(140, 0, 128, 128), 1.0,
|
| &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| @@ -320,31 +326,46 @@ TYPED_TEST(RecordingSourceTest, DiscardablePixelRefs) {
|
|
|
| // Layer sized iterators. These should find all 3 pixel refs.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 1.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[1][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(3u, pixel_refs.size());
|
| - }
|
| - {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[1].pixel_ref == discardable_bitmap[1][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[2].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(0, 130, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(140, 140, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect).ToString());
|
| + }
|
| + {
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 512, 512), 2.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[1][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(3u, pixel_refs.size());
|
| - }
|
| - {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[1].pixel_ref == discardable_bitmap[1][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[2].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(0, 130, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(140, 140, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect).ToString());
|
| + }
|
| + {
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 0.5, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[1][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(3u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[1].pixel_ref == discardable_bitmap[1][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[2].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(0, 130, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(140, 140, 32, 32).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect).ToString());
|
| }
|
| }
|
|
|
| @@ -384,86 +405,107 @@ TYPED_TEST(RecordingSourceTest, DiscardablePixelRefsBaseNonDiscardable) {
|
|
|
| // Tile sized iterators. These should find only one pixel ref.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 1.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 512, 512), 2.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 128, 128), 0.5, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| // Shifted tile sized iterators. These should find only one pixel ref.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(260, 260, 256, 256), 1.0,
|
| &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(260, 260, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(520, 520, 512, 512), 2.0,
|
| &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(260, 260, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(130, 130, 128, 128), 0.5,
|
| &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(1u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(260, 260, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| }
|
| // Ensure there's no discardable pixel refs in the empty cell
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 256, 256, 256), 1.0,
|
| &pixel_refs);
|
| EXPECT_TRUE(pixel_refs.empty());
|
| }
|
| // Layer sized iterators. These should find three pixel ref.
|
| {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 512, 512), 1.0, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[0][1].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(3u, pixel_refs.size());
|
| - }
|
| - {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[1].pixel_ref == discardable_bitmap[0][1].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[2].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(260, 0, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(260, 260, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect).ToString());
|
| + }
|
| + {
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 1024, 1024), 2.0,
|
| &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[0][1].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(3u, pixel_refs.size());
|
| - }
|
| - {
|
| - std::vector<SkPixelRef*> pixel_refs;
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[1].pixel_ref == discardable_bitmap[0][1].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[2].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(260, 0, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(260, 260, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect).ToString());
|
| + }
|
| + {
|
| + std::vector<skia::PositionPixelRef> pixel_refs;
|
| raster_source->GatherPixelRefs(gfx::Rect(0, 0, 256, 256), 0.5, &pixel_refs);
|
| - EXPECT_FALSE(pixel_refs.empty());
|
| - EXPECT_TRUE(pixel_refs[0] == discardable_bitmap[0][0].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[1] == discardable_bitmap[0][1].pixelRef());
|
| - EXPECT_TRUE(pixel_refs[2] == discardable_bitmap[1][1].pixelRef());
|
| EXPECT_EQ(3u, pixel_refs.size());
|
| + EXPECT_TRUE(pixel_refs[0].pixel_ref == discardable_bitmap[0][0].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[1].pixel_ref == discardable_bitmap[0][1].pixelRef());
|
| + EXPECT_TRUE(pixel_refs[2].pixel_ref == discardable_bitmap[1][1].pixelRef());
|
| + EXPECT_EQ(gfx::RectF(128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[0].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(260, 0, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[1].pixel_ref_rect).ToString());
|
| + EXPECT_EQ(gfx::RectF(260, 260, 128, 128).ToString(),
|
| + gfx::SkRectToRectF(pixel_refs[2].pixel_ref_rect).ToString());
|
| }
|
| }
|
|
|
|
|