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

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

Issue 2317913002: cc: Change preraster/predecode split to be half of max skewport extent. (Closed)
Patch Set: compile fix Created 4 years, 3 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/tiles/tile_manager_unittest.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 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 state->SetInteger("completed_count", 301 state->SetInteger("completed_count",
302 base::saturated_cast<int>(stats.completed_count)); 302 base::saturated_cast<int>(stats.completed_count));
303 state->SetInteger("canceled_count", 303 state->SetInteger("canceled_count",
304 base::saturated_cast<int>(stats.canceled_count)); 304 base::saturated_cast<int>(stats.canceled_count));
305 return std::move(state); 305 return std::move(state);
306 } 306 }
307 307
308 TileManager::TileManager(TileManagerClient* client, 308 TileManager::TileManager(TileManagerClient* client,
309 base::SequencedTaskRunner* task_runner, 309 base::SequencedTaskRunner* task_runner,
310 size_t scheduled_raster_task_limit, 310 size_t scheduled_raster_task_limit,
311 bool use_partial_raster, 311 bool use_partial_raster)
312 int max_preraster_distance_in_screen_pixels)
313 : client_(client), 312 : client_(client),
314 task_runner_(task_runner), 313 task_runner_(task_runner),
315 resource_pool_(nullptr), 314 resource_pool_(nullptr),
316 tile_task_manager_(nullptr), 315 tile_task_manager_(nullptr),
317 scheduled_raster_task_limit_(scheduled_raster_task_limit), 316 scheduled_raster_task_limit_(scheduled_raster_task_limit),
318 use_partial_raster_(use_partial_raster), 317 use_partial_raster_(use_partial_raster),
319 use_gpu_rasterization_(false), 318 use_gpu_rasterization_(false),
320 all_tiles_that_need_to_be_rasterized_are_scheduled_(true), 319 all_tiles_that_need_to_be_rasterized_are_scheduled_(true),
321 did_check_for_completed_tasks_since_last_schedule_tasks_(true), 320 did_check_for_completed_tasks_since_last_schedule_tasks_(true),
322 did_oom_on_last_assign_(false), 321 did_oom_on_last_assign_(false),
323 more_tiles_need_prepare_check_notifier_( 322 more_tiles_need_prepare_check_notifier_(
324 task_runner_, 323 task_runner_,
325 base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared, 324 base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared,
326 base::Unretained(this))), 325 base::Unretained(this))),
327 signals_check_notifier_(task_runner_, 326 signals_check_notifier_(task_runner_,
328 base::Bind(&TileManager::CheckAndIssueSignals, 327 base::Bind(&TileManager::CheckAndIssueSignals,
329 base::Unretained(this))), 328 base::Unretained(this))),
330 has_scheduled_tile_tasks_(false), 329 has_scheduled_tile_tasks_(false),
331 prepare_tiles_count_(0u), 330 prepare_tiles_count_(0u),
332 next_tile_id_(0u), 331 next_tile_id_(0u),
333 max_preraster_distance_in_screen_pixels_(
334 max_preraster_distance_in_screen_pixels),
335 task_set_finished_weak_ptr_factory_(this) {} 332 task_set_finished_weak_ptr_factory_(this) {}
336 333
337 TileManager::~TileManager() { 334 TileManager::~TileManager() {
338 FinishTasksAndCleanUp(); 335 FinishTasksAndCleanUp();
339 } 336 }
340 337
341 void TileManager::FinishTasksAndCleanUp() { 338 void TileManager::FinishTasksAndCleanUp() {
342 if (!tile_task_manager_) 339 if (!tile_task_manager_)
343 return; 340 return;
344 341
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 tile->draw_info().set_was_ever_ready_to_draw(); 646 tile->draw_info().set_was_ever_ready_to_draw();
650 if (!tile_is_needed_now) 647 if (!tile_is_needed_now)
651 tile->draw_info().set_was_a_prepaint_tile(); 648 tile->draw_info().set_was_a_prepaint_tile();
652 client_->NotifyTileStateChanged(tile); 649 client_->NotifyTileStateChanged(tile);
653 continue; 650 continue;
654 } 651 }
655 } 652 }
656 653
657 // Prepaint tiles that are far away are only processed for images. 654 // Prepaint tiles that are far away are only processed for images.
658 if (!tile->required_for_activation() && !tile->required_for_draw() && 655 if (!tile->required_for_activation() && !tile->required_for_draw() &&
659 priority.distance_to_visible > 656 prioritized_tile.is_process_for_images_only()) {
660 max_preraster_distance_in_screen_pixels_) {
661 work_to_schedule.tiles_to_process_for_images.push_back(prioritized_tile); 657 work_to_schedule.tiles_to_process_for_images.push_back(prioritized_tile);
662 continue; 658 continue;
663 } 659 }
664 660
665 // We won't be able to schedule this tile, so break out early. 661 // We won't be able to schedule this tile, so break out early.
666 if (work_to_schedule.tiles_to_raster.size() >= 662 if (work_to_schedule.tiles_to_raster.size() >=
667 scheduled_raster_task_limit_) { 663 scheduled_raster_task_limit_) {
668 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; 664 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false;
669 break; 665 break;
670 } 666 }
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 all_tile_tasks_completed = false; 1330 all_tile_tasks_completed = false;
1335 did_notify_all_tile_tasks_completed = false; 1331 did_notify_all_tile_tasks_completed = false;
1336 } 1332 }
1337 1333
1338 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; 1334 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default;
1339 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( 1335 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule(
1340 PrioritizedWorkToSchedule&& other) = default; 1336 PrioritizedWorkToSchedule&& other) = default;
1341 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; 1337 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default;
1342 1338
1343 } // namespace cc 1339 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager.h ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698