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

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

Issue 2537683002: cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: test fix 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(TileManagerClient* client, 345 TileManager::TileManager(
346 base::SequencedTaskRunner* task_runner, 346 TileManagerClient* client,
347 size_t scheduled_raster_task_limit, 347 base::SequencedTaskRunner* origin_task_runner,
348 bool use_partial_raster, 348 scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner,
349 bool check_tile_priority_inversion) 349 size_t scheduled_raster_task_limit,
350 bool use_partial_raster,
351 bool check_tile_priority_inversion)
350 : client_(client), 352 : client_(client),
351 task_runner_(task_runner), 353 task_runner_(origin_task_runner),
352 resource_pool_(nullptr), 354 resource_pool_(nullptr),
353 tile_task_manager_(nullptr), 355 tile_task_manager_(nullptr),
354 scheduled_raster_task_limit_(scheduled_raster_task_limit), 356 scheduled_raster_task_limit_(scheduled_raster_task_limit),
355 use_partial_raster_(use_partial_raster), 357 use_partial_raster_(use_partial_raster),
356 use_gpu_rasterization_(false), 358 use_gpu_rasterization_(false),
357 all_tiles_that_need_to_be_rasterized_are_scheduled_(true), 359 all_tiles_that_need_to_be_rasterized_are_scheduled_(true),
358 did_check_for_completed_tasks_since_last_schedule_tasks_(true), 360 did_check_for_completed_tasks_since_last_schedule_tasks_(true),
359 did_oom_on_last_assign_(false), 361 did_oom_on_last_assign_(false),
362 image_controller_(origin_task_runner,
363 std::move(image_worker_task_runner)),
360 more_tiles_need_prepare_check_notifier_( 364 more_tiles_need_prepare_check_notifier_(
361 task_runner_, 365 task_runner_,
362 base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared, 366 base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared,
363 base::Unretained(this))), 367 base::Unretained(this))),
364 signals_check_notifier_(task_runner_, 368 signals_check_notifier_(task_runner_,
365 base::Bind(&TileManager::CheckAndIssueSignals, 369 base::Bind(&TileManager::CheckAndIssueSignals,
366 base::Unretained(this))), 370 base::Unretained(this))),
367 has_scheduled_tile_tasks_(false), 371 has_scheduled_tile_tasks_(false),
368 prepare_tiles_count_(0u), 372 prepare_tiles_count_(0u),
369 next_tile_id_(0u), 373 next_tile_id_(0u),
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 TileDrawInfo& draw_info = tile->draw_info(); 1061 TileDrawInfo& draw_info = tile->draw_info();
1058 draw_info.set_use_resource(); 1062 draw_info.set_use_resource();
1059 draw_info.resource_ = resource; 1063 draw_info.resource_ = resource;
1060 draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); 1064 draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile);
1061 1065
1062 DCHECK(draw_info.IsReadyToDraw()); 1066 DCHECK(draw_info.IsReadyToDraw());
1063 draw_info.set_was_ever_ready_to_draw(); 1067 draw_info.set_was_ever_ready_to_draw();
1064 client_->NotifyTileStateChanged(tile); 1068 client_->NotifyTileStateChanged(tile);
1065 } 1069 }
1066 1070
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
1067 std::unique_ptr<Tile> TileManager::CreateTile(const Tile::CreateInfo& info, 1078 std::unique_ptr<Tile> TileManager::CreateTile(const Tile::CreateInfo& info,
1068 int layer_id, 1079 int layer_id,
1069 int source_frame_number, 1080 int source_frame_number,
1070 int flags) { 1081 int flags) {
1071 // We need to have a tile task worker pool to do anything meaningful with 1082 // We need to have a tile task worker pool to do anything meaningful with
1072 // tiles. 1083 // tiles.
1073 DCHECK(tile_task_manager_); 1084 DCHECK(tile_task_manager_);
1074 std::unique_ptr<Tile> tile( 1085 std::unique_ptr<Tile> tile(
1075 new Tile(this, info, layer_id, source_frame_number, flags)); 1086 new Tile(this, info, layer_id, source_frame_number, flags));
1076 DCHECK(tiles_.find(tile->id()) == tiles_.end()); 1087 DCHECK(tiles_.find(tile->id()) == tiles_.end());
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 all_tile_tasks_completed = false; 1371 all_tile_tasks_completed = false;
1361 did_notify_all_tile_tasks_completed = false; 1372 did_notify_all_tile_tasks_completed = false;
1362 } 1373 }
1363 1374
1364 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; 1375 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default;
1365 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( 1376 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule(
1366 PrioritizedWorkToSchedule&& other) = default; 1377 PrioritizedWorkToSchedule&& other) = default;
1367 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; 1378 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default;
1368 1379
1369 } // namespace cc 1380 } // 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