Skip to content

Commit

Permalink
cc: Rename DisplayListRasterSource to just RasterSource.
Browse files Browse the repository at this point in the history
DisplayListRasterSource used to derive from RasterSource and there was
another implementation. However, currently there's only one raster source
and it doesn't derive from any common interface. Rename it to just be
the RasterSource.

R=enne
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1837263005

Cr-Commit-Position: refs/heads/master@{#383887}
  • Loading branch information
vmpstr authored and Commit bot committed Mar 30, 2016
1 parent 792762d commit 41d68f8
Show file tree
Hide file tree
Showing 54 changed files with 684 additions and 749 deletions.
10 changes: 5 additions & 5 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ component("cc") {
"playback/display_item_list_settings.h",
"playback/display_item_proto_factory.cc",
"playback/display_item_proto_factory.h",
"playback/display_list_raster_source.cc",
"playback/display_list_raster_source.h",
"playback/display_list_recording_source.cc",
"playback/display_list_recording_source.h",
"playback/draw_image.cc",
Expand All @@ -309,6 +307,8 @@ component("cc") {
"playback/image_hijack_canvas.h",
"playback/largest_display_item.cc",
"playback/largest_display_item.h",
"playback/raster_source.cc",
"playback/raster_source.h",
"playback/skip_image_canvas.cc",
"playback/skip_image_canvas.h",
"playback/transform_display_item.cc",
Expand Down Expand Up @@ -586,8 +586,6 @@ source_set("test_support") {
"test/fake_channel_impl.h",
"test/fake_content_layer_client.cc",
"test/fake_content_layer_client.h",
"test/fake_display_list_raster_source.cc",
"test/fake_display_list_raster_source.h",
"test/fake_display_list_recording_source.cc",
"test/fake_display_list_recording_source.h",
"test/fake_external_begin_frame_source.cc",
Expand Down Expand Up @@ -619,6 +617,8 @@ source_set("test_support") {
"test/fake_picture_layer_tiling_client.h",
"test/fake_proxy.cc",
"test/fake_proxy.h",
"test/fake_raster_source.cc",
"test/fake_raster_source.h",
"test/fake_renderer_client.cc",
"test/fake_renderer_client.h",
"test/fake_rendering_stats_instrumentation.h",
Expand Down Expand Up @@ -833,8 +833,8 @@ test("cc_unittests") {
"output/texture_mailbox_deleter_unittest.cc",
"playback/discardable_image_map_unittest.cc",
"playback/display_item_list_unittest.cc",
"playback/display_list_raster_source_unittest.cc",
"playback/display_list_recording_source_unittest.cc",
"playback/raster_source_unittest.cc",
"proto/base_conversions_unittest.cc",
"proto/cc_conversions_unittest.cc",
"proto/gfx_conversions_unittest.cc",
Expand Down
4 changes: 2 additions & 2 deletions cc/cc.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@
'playback/display_item_list_settings.h',
'playback/display_item_proto_factory.cc',
'playback/display_item_proto_factory.h',
'playback/display_list_raster_source.cc',
'playback/display_list_raster_source.h',
'playback/display_list_recording_source.cc',
'playback/display_list_recording_source.h',
'playback/draw_image.cc',
Expand All @@ -371,6 +369,8 @@
'playback/image_hijack_canvas.h',
'playback/largest_display_item.cc',
'playback/largest_display_item.h',
'playback/raster_source.cc',
'playback/raster_source.h',
'playback/skip_image_canvas.cc',
'playback/skip_image_canvas.h',
'playback/transform_display_item.cc',
Expand Down
6 changes: 3 additions & 3 deletions cc/cc_tests.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
'output/texture_mailbox_deleter_unittest.cc',
'playback/discardable_image_map_unittest.cc',
'playback/display_item_list_unittest.cc',
'playback/display_list_raster_source_unittest.cc',
'playback/display_list_recording_source_unittest.cc',
'playback/raster_source_unittest.cc',
'proto/base_conversions_unittest.cc',
'proto/cc_conversions_unittest.cc',
'proto/gfx_conversions_unittest.cc',
Expand Down Expand Up @@ -183,8 +183,6 @@
'test/fake_channel_impl.h',
'test/fake_content_layer_client.cc',
'test/fake_content_layer_client.h',
'test/fake_display_list_raster_source.cc',
'test/fake_display_list_raster_source.h',
'test/fake_display_list_recording_source.cc',
'test/fake_display_list_recording_source.h',
'test/fake_external_begin_frame_source.cc',
Expand Down Expand Up @@ -216,6 +214,8 @@
'test/fake_picture_layer_tiling_client.h',
'test/fake_proxy.cc',
'test/fake_proxy.h',
'test/fake_raster_source.cc',
'test/fake_raster_source.h',
'test/fake_renderer_client.cc',
'test/fake_renderer_client.h',
'test/fake_rendering_stats_instrumentation.h',
Expand Down
6 changes: 3 additions & 3 deletions cc/debug/rasterize_and_record_benchmark_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace {

const int kDefaultRasterizeRepeatCount = 100;

void RunBenchmark(DisplayListRasterSource* raster_source,
void RunBenchmark(RasterSource* raster_source,
const gfx::Rect& content_rect,
float contents_scale,
size_t repeat_count,
Expand Down Expand Up @@ -179,7 +179,7 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
tiling_set->AddTiling(1.f, layer->GetRasterSource());
tiling->set_resolution(HIGH_RESOLUTION);
tiling->CreateAllTilesForTesting();
DisplayListRasterSource* raster_source = tiling->raster_source().get();
RasterSource* raster_source = tiling->raster_source().get();
for (PictureLayerTiling::CoverageIterator it(tiling, 1.f,
layer->visible_layer_rect());
it; ++it) {
Expand All @@ -204,7 +204,7 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
rasterize_results_.total_best_time += min_time;
}

const DisplayListRasterSource* layer_raster_source = layer->GetRasterSource();
const RasterSource* layer_raster_source = layer->GetRasterSource();
rasterize_results_.total_memory_usage +=
layer_raster_source->GetPictureMemoryUsage();
}
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/picture_image_layer_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include "base/thread_task_runner_handle.h"
#include "cc/layers/append_quads_data.h"
#include "cc/quads/draw_quad.h"
#include "cc/test/fake_display_list_raster_source.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_raster_source.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_task_graph_runner.h"
#include "cc/tiles/tile_priority.h"
Expand Down Expand Up @@ -71,7 +71,7 @@ class PictureImageLayerImplTest : public testing::Test {
}
TestablePictureImageLayerImpl* layer =
new TestablePictureImageLayerImpl(tree, id);
layer->raster_source_ = FakeDisplayListRasterSource::CreateInfiniteFilled();
layer->raster_source_ = FakeRasterSource::CreateInfiniteFilled();
layer->SetBounds(layer->raster_source_->GetSize());
return make_scoped_ptr(layer);
}
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/picture_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {

// Preserve lcd text settings from the current raster source.
bool can_use_lcd_text = layer_impl->RasterSourceUsesLCDText();
scoped_refptr<DisplayListRasterSource> raster_source =
scoped_refptr<RasterSource> raster_source =
recording_source_->CreateRasterSource(can_use_lcd_text);
layer_impl->set_gpu_raster_max_texture_size(
layer_tree_host()->device_viewport_size());
Expand Down Expand Up @@ -144,7 +144,7 @@ sk_sp<SkPicture> PictureLayer::GetPicture() const {
client_, &recording_invalidation, layer_size, gfx::Rect(layer_size),
update_source_frame_number_, DisplayListRecordingSource::RECORD_NORMALLY);

scoped_refptr<DisplayListRasterSource> raster_source =
scoped_refptr<RasterSource> raster_source =
recording_source->CreateRasterSource(false);

return raster_source->GetFlattenedPicture();
Expand Down
4 changes: 2 additions & 2 deletions cc/layers/picture_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ PictureLayerImpl* PictureLayerImpl::GetPendingOrActiveTwinLayer() const {
}

void PictureLayerImpl::UpdateRasterSource(
scoped_refptr<DisplayListRasterSource> raster_source,
scoped_refptr<RasterSource> raster_source,
Region* new_invalidation,
const PictureLayerTilingSet* pending_set) {
// The bounds and the pile size may differ if the pile wasn't updated (ie.
Expand Down Expand Up @@ -593,7 +593,7 @@ void PictureLayerImpl::UpdateCanUseLCDTextAfterCommit() {

// Raster sources are considered const, so in order to update the state
// a new one must be created and all tiles recreated.
scoped_refptr<DisplayListRasterSource> new_raster_source =
scoped_refptr<RasterSource> new_raster_source =
raster_source_->CreateCloneWithoutLCDText();
raster_source_.swap(new_raster_source);

Expand Down
8 changes: 3 additions & 5 deletions cc/layers/picture_layer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CC_EXPORT PictureLayerImpl
void set_gpu_raster_max_texture_size(gfx::Size gpu_raster_max_texture_size) {
gpu_raster_max_texture_size_ = gpu_raster_max_texture_size;
}
void UpdateRasterSource(scoped_refptr<DisplayListRasterSource> raster_source,
void UpdateRasterSource(scoped_refptr<RasterSource> raster_source,
Region* new_invalidation,
const PictureLayerTilingSet* pending_set);
bool UpdateTiles();
Expand All @@ -89,9 +89,7 @@ class CC_EXPORT PictureLayerImpl
bool IsOnActiveOrPendingTree() const;

// Used for benchmarking
DisplayListRasterSource* GetRasterSource() const {
return raster_source_.get();
}
RasterSource* GetRasterSource() const { return raster_source_.get(); }

protected:
friend class LayerRasterTileIterator;
Expand Down Expand Up @@ -127,7 +125,7 @@ class CC_EXPORT PictureLayerImpl
PictureLayerImpl* twin_layer_;

scoped_ptr<PictureLayerTilingSet> tilings_;
scoped_refptr<DisplayListRasterSource> raster_source_;
scoped_refptr<RasterSource> raster_source_;
Region invalidation_;

float ideal_page_scale_;
Expand Down
6 changes: 3 additions & 3 deletions cc/layers/picture_layer_impl_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#include "base/macros.h"
#include "base/thread_task_runner_handle.h"
#include "cc/debug/lap_timer.h"
#include "cc/test/fake_display_list_raster_source.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_raster_source.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_task_graph_runner.h"
#include "cc/tiles/tiling_set_raster_queue_all.h"
Expand Down Expand Up @@ -57,8 +57,8 @@ class PictureLayerImplPerfTest : public testing::Test {
}

void SetupPendingTree(const gfx::Size& layer_bounds) {
scoped_refptr<FakeDisplayListRasterSource> raster_source =
FakeDisplayListRasterSource::CreateFilled(layer_bounds);
scoped_refptr<FakeRasterSource> raster_source =
FakeRasterSource::CreateFilled(layer_bounds);
host_impl_.CreatePendingTree();
LayerTreeImpl* pending_tree = host_impl_.pending_tree();
pending_tree->ClearLayers();
Expand Down
Loading

0 comments on commit 41d68f8

Please sign in to comment.