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

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

Issue 2631453002: Revert of cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: Created 3 years, 11 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/tiles/tile_manager.h ('k') | cc/trees/layer_tree_host_impl.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/tiles/tile_manager.h" 5 #include "cc/tiles/tile_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats) { 335 RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats) {
336 std::unique_ptr<base::trace_event::TracedValue> state( 336 std::unique_ptr<base::trace_event::TracedValue> state(
337 new base::trace_event::TracedValue()); 337 new base::trace_event::TracedValue());
338 state->SetInteger("completed_count", 338 state->SetInteger("completed_count",
339 base::saturated_cast<int>(stats.completed_count)); 339 base::saturated_cast<int>(stats.completed_count));
340 state->SetInteger("canceled_count", 340 state->SetInteger("canceled_count",
341 base::saturated_cast<int>(stats.canceled_count)); 341 base::saturated_cast<int>(stats.canceled_count));
342 return std::move(state); 342 return std::move(state);
343 } 343 }
344 344
345 TileManager::TileManager( 345 TileManager::TileManager(TileManagerClient* client,
346 TileManagerClient* client, 346 base::SequencedTaskRunner* task_runner,
347 base::SequencedTaskRunner* origin_task_runner, 347 size_t scheduled_raster_task_limit,
348 scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner, 348 bool use_partial_raster,
349 size_t scheduled_raster_task_limit, 349 bool check_tile_priority_inversion)
350 bool use_partial_raster,
351 bool check_tile_priority_inversion)
352 : client_(client), 350 : client_(client),
353 task_runner_(origin_task_runner), 351 task_runner_(task_runner),
354 resource_pool_(nullptr), 352 resource_pool_(nullptr),
355 tile_task_manager_(nullptr), 353 tile_task_manager_(nullptr),
356 scheduled_raster_task_limit_(scheduled_raster_task_limit), 354 scheduled_raster_task_limit_(scheduled_raster_task_limit),
357 use_partial_raster_(use_partial_raster), 355 use_partial_raster_(use_partial_raster),
358 use_gpu_rasterization_(false), 356 use_gpu_rasterization_(false),
359 all_tiles_that_need_to_be_rasterized_are_scheduled_(true), 357 all_tiles_that_need_to_be_rasterized_are_scheduled_(true),
360 did_check_for_completed_tasks_since_last_schedule_tasks_(true), 358 did_check_for_completed_tasks_since_last_schedule_tasks_(true),
361 did_oom_on_last_assign_(false), 359 did_oom_on_last_assign_(false),
362 image_controller_(origin_task_runner,
363 std::move(image_worker_task_runner)),
364 more_tiles_need_prepare_check_notifier_( 360 more_tiles_need_prepare_check_notifier_(
365 task_runner_, 361 task_runner_,
366 base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared, 362 base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared,
367 base::Unretained(this))), 363 base::Unretained(this))),
368 signals_check_notifier_(task_runner_, 364 signals_check_notifier_(task_runner_,
369 base::Bind(&TileManager::CheckAndIssueSignals, 365 base::Bind(&TileManager::CheckAndIssueSignals,
370 base::Unretained(this))), 366 base::Unretained(this))),
371 has_scheduled_tile_tasks_(false), 367 has_scheduled_tile_tasks_(false),
372 prepare_tiles_count_(0u), 368 prepare_tiles_count_(0u),
373 next_tile_id_(0u), 369 next_tile_id_(0u),
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 TileDrawInfo& draw_info = tile->draw_info(); 1057 TileDrawInfo& draw_info = tile->draw_info();
1062 draw_info.set_use_resource(); 1058 draw_info.set_use_resource();
1063 draw_info.resource_ = resource; 1059 draw_info.resource_ = resource;
1064 draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); 1060 draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile);
1065 1061
1066 DCHECK(draw_info.IsReadyToDraw()); 1062 DCHECK(draw_info.IsReadyToDraw());
1067 draw_info.set_was_ever_ready_to_draw(); 1063 draw_info.set_was_ever_ready_to_draw();
1068 client_->NotifyTileStateChanged(tile); 1064 client_->NotifyTileStateChanged(tile);
1069 } 1065 }
1070 1066
1071 void TileManager::SetDecodedImageTracker(
1072 DecodedImageTracker* decoded_image_tracker) {
1073 // TODO(vmpstr): If the tile manager needs to request out-of-raster decodes,
1074 // it should retain and use |decoded_image_tracker| here.
1075 decoded_image_tracker->set_image_controller(&image_controller_);
1076 }
1077
1078 std::unique_ptr<Tile> TileManager::CreateTile(const Tile::CreateInfo& info, 1067 std::unique_ptr<Tile> TileManager::CreateTile(const Tile::CreateInfo& info,
1079 int layer_id, 1068 int layer_id,
1080 int source_frame_number, 1069 int source_frame_number,
1081 int flags) { 1070 int flags) {
1082 // We need to have a tile task worker pool to do anything meaningful with 1071 // We need to have a tile task worker pool to do anything meaningful with
1083 // tiles. 1072 // tiles.
1084 DCHECK(tile_task_manager_); 1073 DCHECK(tile_task_manager_);
1085 std::unique_ptr<Tile> tile( 1074 std::unique_ptr<Tile> tile(
1086 new Tile(this, info, layer_id, source_frame_number, flags)); 1075 new Tile(this, info, layer_id, source_frame_number, flags));
1087 DCHECK(tiles_.find(tile->id()) == tiles_.end()); 1076 DCHECK(tiles_.find(tile->id()) == tiles_.end());
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 all_tile_tasks_completed = false; 1360 all_tile_tasks_completed = false;
1372 did_notify_all_tile_tasks_completed = false; 1361 did_notify_all_tile_tasks_completed = false;
1373 } 1362 }
1374 1363
1375 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; 1364 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default;
1376 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( 1365 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule(
1377 PrioritizedWorkToSchedule&& other) = default; 1366 PrioritizedWorkToSchedule&& other) = default;
1378 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; 1367 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default;
1379 1368
1380 } // namespace cc 1369 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698