| Index: cc/playback/raster_source_unittest.cc
|
| diff --git a/cc/playback/display_list_raster_source_unittest.cc b/cc/playback/raster_source_unittest.cc
|
| similarity index 88%
|
| rename from cc/playback/display_list_raster_source_unittest.cc
|
| rename to cc/playback/raster_source_unittest.cc
|
| index ffaf892cc3bfb203fca856f5b33457e41b49438a..7b972d37af6b20728b1f2cf577f6089d833483fa 100644
|
| --- a/cc/playback/display_list_raster_source_unittest.cc
|
| +++ b/cc/playback/raster_source_unittest.cc
|
| @@ -5,7 +5,7 @@
|
| #include <stddef.h>
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "cc/playback/display_list_raster_source.h"
|
| +#include "cc/playback/raster_source.h"
|
| #include "cc/test/fake_display_list_recording_source.h"
|
| #include "cc/test/skia_common.h"
|
| #include "skia/ext/refptr.h"
|
| @@ -18,7 +18,7 @@
|
| namespace cc {
|
| namespace {
|
|
|
| -TEST(DisplayListRasterSourceTest, AnalyzeIsSolidUnscaled) {
|
| +TEST(RasterSourceTest, AnalyzeIsSolidUnscaled) {
|
| gfx::Size layer_bounds(400, 400);
|
|
|
| scoped_ptr<FakeDisplayListRecordingSource> recording_source =
|
| @@ -38,9 +38,9 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidUnscaled) {
|
| solid_paint);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| // Ensure everything is solid.
|
| for (int y = 0; y <= 300; y += 100) {
|
| @@ -56,7 +56,7 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidUnscaled) {
|
| recording_source->add_draw_rect_with_paint(gfx::Rect(50, 50, 1, 1),
|
| non_solid_paint);
|
| recording_source->Rerecord();
|
| - raster = DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| + raster = RasterSource::CreateFromDisplayListRecordingSource(
|
| recording_source.get(), false);
|
|
|
| color = SK_ColorTRANSPARENT;
|
| @@ -90,7 +90,7 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidUnscaled) {
|
| EXPECT_EQ(solid_color, color);
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, AnalyzeIsSolidScaled) {
|
| +TEST(RasterSourceTest, AnalyzeIsSolidScaled) {
|
| gfx::Size layer_bounds(400, 400);
|
|
|
| scoped_ptr<FakeDisplayListRecordingSource> recording_source =
|
| @@ -110,9 +110,9 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidScaled) {
|
| solid_paint);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| // Ensure everything is solid.
|
| for (int y = 0; y <= 30; y += 10) {
|
| @@ -128,7 +128,7 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidScaled) {
|
| recording_source->add_draw_rect_with_paint(gfx::Rect(50, 50, 1, 1),
|
| non_solid_paint);
|
| recording_source->Rerecord();
|
| - raster = DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| + raster = RasterSource::CreateFromDisplayListRecordingSource(
|
| recording_source.get(), false);
|
|
|
| color = SK_ColorTRANSPARENT;
|
| @@ -162,16 +162,16 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidScaled) {
|
| EXPECT_EQ(color, solid_color);
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, AnalyzeIsSolidEmpty) {
|
| +TEST(RasterSourceTest, AnalyzeIsSolidEmpty) {
|
| gfx::Size layer_bounds(400, 400);
|
|
|
| scoped_ptr<FakeDisplayListRecordingSource> recording_source =
|
| FakeDisplayListRecordingSource::CreateFilledRecordingSource(layer_bounds);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| SkColor color = SK_ColorTRANSPARENT;
|
| bool is_solid_color =
|
| @@ -181,7 +181,7 @@ TEST(DisplayListRasterSourceTest, AnalyzeIsSolidEmpty) {
|
| EXPECT_EQ(color, SkColorSetARGB(0, 0, 0, 0));
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, PixelRefIteratorDiscardableRefsOneTile) {
|
| +TEST(RasterSourceTest, PixelRefIteratorDiscardableRefsOneTile) {
|
| gfx::Size layer_bounds(512, 512);
|
|
|
| scoped_ptr<FakeDisplayListRecordingSource> recording_source =
|
| @@ -207,9 +207,9 @@ TEST(DisplayListRasterSourceTest, PixelRefIteratorDiscardableRefsOneTile) {
|
| recording_source->SetGenerateDiscardableImagesMetadata(true);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| // Tile sized iterators. These should find only one pixel ref.
|
| {
|
| @@ -244,7 +244,7 @@ TEST(DisplayListRasterSourceTest, PixelRefIteratorDiscardableRefsOneTile) {
|
| }
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, RasterFullContents) {
|
| +TEST(RasterSourceTest, RasterFullContents) {
|
| gfx::Size layer_bounds(3, 5);
|
| float contents_scale = 1.5f;
|
| float raster_divisions = 2.f;
|
| @@ -262,9 +262,9 @@ TEST(DisplayListRasterSourceTest, RasterFullContents) {
|
| white_paint);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| gfx::Size content_bounds(
|
| gfx::ScaleToCeiledSize(layer_bounds, contents_scale));
|
| @@ -312,7 +312,7 @@ TEST(DisplayListRasterSourceTest, RasterFullContents) {
|
| }
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, RasterPartialContents) {
|
| +TEST(RasterSourceTest, RasterPartialContents) {
|
| gfx::Size layer_bounds(3, 5);
|
| float contents_scale = 1.5f;
|
|
|
| @@ -328,9 +328,9 @@ TEST(DisplayListRasterSourceTest, RasterPartialContents) {
|
| white_paint);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| gfx::Size content_bounds(
|
| gfx::ScaleToCeiledSize(layer_bounds, contents_scale));
|
| @@ -368,8 +368,8 @@ TEST(DisplayListRasterSourceTest, RasterPartialContents) {
|
| black_paint);
|
| recording_source->Rerecord();
|
|
|
| - // Make a new DisplayListRasterSource from the new recording.
|
| - raster = DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| + // Make a new RasterSource from the new recording.
|
| + raster = RasterSource::CreateFromDisplayListRecordingSource(
|
| recording_source.get(), false);
|
|
|
| // We're going to playback from "everything is black" into a smaller area,
|
| @@ -405,7 +405,7 @@ TEST(DisplayListRasterSourceTest, RasterPartialContents) {
|
| EXPECT_GT(num_white, 0);
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, RasterPartialClear) {
|
| +TEST(RasterSourceTest, RasterPartialClear) {
|
| gfx::Size layer_bounds(3, 5);
|
| gfx::Size partial_bounds(2, 4);
|
| float contents_scale = 1.5f;
|
| @@ -425,9 +425,9 @@ TEST(DisplayListRasterSourceTest, RasterPartialClear) {
|
| white_paint);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
|
|
| gfx::Size content_bounds(
|
| gfx::ScaleToCeiledSize(layer_bounds, contents_scale));
|
| @@ -471,8 +471,8 @@ TEST(DisplayListRasterSourceTest, RasterPartialClear) {
|
| white_paint);
|
| recording_source_light->Rerecord();
|
|
|
| - // Make a new DisplayListRasterSource from the new recording.
|
| - raster = DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| + // Make a new RasterSource from the new recording.
|
| + raster = RasterSource::CreateFromDisplayListRecordingSource(
|
| recording_source_light.get(), false);
|
|
|
| // We're going to playback from alpha(18) white rectangle into a smaller area
|
| @@ -497,7 +497,7 @@ TEST(DisplayListRasterSourceTest, RasterPartialClear) {
|
| }
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest, RasterContentsTransparent) {
|
| +TEST(RasterSourceTest, RasterContentsTransparent) {
|
| gfx::Size layer_bounds(5, 3);
|
| float contents_scale = 0.5f;
|
|
|
| @@ -508,9 +508,9 @@ TEST(DisplayListRasterSourceTest, RasterContentsTransparent) {
|
| recording_source->SetClearCanvasWithDebugColor(false);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
| gfx::Size content_bounds(
|
| gfx::ScaleToCeiledSize(layer_bounds, contents_scale));
|
|
|
| @@ -532,8 +532,7 @@ TEST(DisplayListRasterSourceTest, RasterContentsTransparent) {
|
| }
|
| }
|
|
|
| -TEST(DisplayListRasterSourceTest,
|
| - GetPictureMemoryUsageIncludesClientReportedMemory) {
|
| +TEST(RasterSourceTest, GetPictureMemoryUsageIncludesClientReportedMemory) {
|
| const size_t kReportedMemoryUsageInBytes = 100 * 1024 * 1024;
|
| gfx::Size layer_bounds(5, 3);
|
| scoped_ptr<FakeDisplayListRecordingSource> recording_source =
|
| @@ -541,9 +540,9 @@ TEST(DisplayListRasterSourceTest,
|
| recording_source->set_reported_memory_usage(kReportedMemoryUsageInBytes);
|
| recording_source->Rerecord();
|
|
|
| - scoped_refptr<DisplayListRasterSource> raster =
|
| - DisplayListRasterSource::CreateFromDisplayListRecordingSource(
|
| - recording_source.get(), false);
|
| + scoped_refptr<RasterSource> raster =
|
| + RasterSource::CreateFromDisplayListRecordingSource(recording_source.get(),
|
| + false);
|
| size_t total_memory_usage = raster->GetPictureMemoryUsage();
|
| EXPECT_GE(total_memory_usage, kReportedMemoryUsageInBytes);
|
| EXPECT_LT(total_memory_usage, 2 * kReportedMemoryUsageInBytes);
|
|
|