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

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 2857363004: Add buffer_to_texture_target_map to LayerTreeSettings (Closed)
Patch Set: Address comments in CompositorImpl Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « cc/test/pixel_test.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 ~SynchronousSimpleTaskRunner() override = default; 80 ~SynchronousSimpleTaskRunner() override = default;
81 81
82 bool run_tasks_synchronously_ = false; 82 bool run_tasks_synchronously_ = false;
83 }; 83 };
84 84
85 class TileManagerTilePriorityQueueTest : public TestLayerTreeHostBase { 85 class TileManagerTilePriorityQueueTest : public TestLayerTreeHostBase {
86 public: 86 public:
87 LayerTreeSettings CreateSettings() override { 87 LayerTreeSettings CreateSettings() override {
88 LayerTreeSettings settings; 88 LayerTreeSettings settings;
89 settings.create_low_res_tiling = true; 89 settings.create_low_res_tiling = true;
90 settings.renderer_settings.buffer_to_texture_target_map = 90 settings.buffer_to_texture_target_map =
91 DefaultBufferToTextureTargetMapForTesting(); 91 DefaultBufferToTextureTargetMapForTesting();
92 return settings; 92 return settings;
93 } 93 }
94 94
95 TileManager* tile_manager() { return host_impl()->tile_manager(); } 95 TileManager* tile_manager() { return host_impl()->tile_manager(); }
96 }; 96 };
97 97
98 TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) { 98 TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
99 const gfx::Size layer_bounds(1000, 1000); 99 const gfx::Size layer_bounds(1000, 1000);
100 host_impl()->SetViewportSize(layer_bounds); 100 host_impl()->SetViewportSize(layer_bounds);
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 for (int j = 0; j < 100; ++j) { 2048 for (int j = 0; j < 100; ++j) {
2049 recording_source_->add_draw_rect_with_flags( 2049 recording_source_->add_draw_rect_with_flags(
2050 gfx::Rect(10 * i, 10 * j, 5, 5), non_solid_flags); 2050 gfx::Rect(10 * i, 10 * j, 5, 5), non_solid_flags);
2051 } 2051 }
2052 } 2052 }
2053 recording_source_->Rerecord(); 2053 recording_source_->Rerecord();
2054 } 2054 }
2055 2055
2056 LayerTreeSettings CreateSettings() override { 2056 LayerTreeSettings CreateSettings() override {
2057 LayerTreeSettings settings; 2057 LayerTreeSettings settings;
2058 settings.renderer_settings.buffer_to_texture_target_map = 2058 settings.buffer_to_texture_target_map =
2059 DefaultBufferToTextureTargetMapForTesting(); 2059 DefaultBufferToTextureTargetMapForTesting();
2060 return settings; 2060 return settings;
2061 } 2061 }
2062 2062
2063 void SetupTreesWithActiveTreeTiles() { 2063 void SetupTreesWithActiveTreeTiles() {
2064 scoped_refptr<RasterSource> active_tree_raster_source = 2064 scoped_refptr<RasterSource> active_tree_raster_source =
2065 RasterSource::CreateFromRecordingSource(recording_source_.get(), false); 2065 RasterSource::CreateFromRecordingSource(recording_source_.get(), false);
2066 scoped_refptr<RasterSource> pending_tree_raster_source = 2066 scoped_refptr<RasterSource> pending_tree_raster_source =
2067 RasterSource::CreateFromRecordingSource( 2067 RasterSource::CreateFromRecordingSource(
2068 solid_color_recording_source_.get(), false); 2068 solid_color_recording_source_.get(), false);
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2327 2327
2328 void TearDown() override { 2328 void TearDown() override {
2329 // Allow all tasks on the image worker to run now. Any scheduled decodes 2329 // Allow all tasks on the image worker to run now. Any scheduled decodes
2330 // will be aborted. 2330 // will be aborted.
2331 task_runner_->set_run_tasks_synchronously(true); 2331 task_runner_->set_run_tasks_synchronously(true);
2332 } 2332 }
2333 2333
2334 LayerTreeSettings CreateSettings() override { 2334 LayerTreeSettings CreateSettings() override {
2335 LayerTreeSettings settings; 2335 LayerTreeSettings settings;
2336 settings.enable_checker_imaging = true; 2336 settings.enable_checker_imaging = true;
2337 settings.renderer_settings.buffer_to_texture_target_map = 2337 settings.buffer_to_texture_target_map =
2338 DefaultBufferToTextureTargetMapForTesting(); 2338 DefaultBufferToTextureTargetMapForTesting();
2339 return settings; 2339 return settings;
2340 } 2340 }
2341 2341
2342 std::unique_ptr<FakeLayerTreeHostImpl> CreateHostImpl( 2342 std::unique_ptr<FakeLayerTreeHostImpl> CreateHostImpl(
2343 const LayerTreeSettings& settings, 2343 const LayerTreeSettings& settings,
2344 TaskRunnerProvider* task_runner_provider, 2344 TaskRunnerProvider* task_runner_provider,
2345 TaskGraphRunner* task_graph_runner) override { 2345 TaskGraphRunner* task_graph_runner) override {
2346 task_runner_ = make_scoped_refptr(new SynchronousSimpleTaskRunner); 2346 task_runner_ = make_scoped_refptr(new SynchronousSimpleTaskRunner);
2347 return base::MakeUnique<FakeLayerTreeHostImpl>( 2347 return base::MakeUnique<FakeLayerTreeHostImpl>(
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 EXPECT_TRUE(tile); 2648 EXPECT_TRUE(tile);
2649 else 2649 else
2650 EXPECT_FALSE(tile); 2650 EXPECT_FALSE(tile);
2651 } 2651 }
2652 } 2652 }
2653 host_impl()->client()->reset_did_request_impl_side_invalidation(); 2653 host_impl()->client()->reset_did_request_impl_side_invalidation();
2654 } 2654 }
2655 2655
2656 } // namespace 2656 } // namespace
2657 } // namespace cc 2657 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/pixel_test.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698