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

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

Issue 2814843002: gpu: GPU service scheduler. (Closed)
Patch Set: rebase 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
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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 void TileManager::Flush() { 519 void TileManager::Flush() {
520 TRACE_EVENT0("cc", "TileManager::Flush"); 520 TRACE_EVENT0("cc", "TileManager::Flush");
521 521
522 if (!tile_task_manager_) { 522 if (!tile_task_manager_) {
523 TRACE_EVENT_INSTANT0("cc", "Flush aborted", TRACE_EVENT_SCOPE_THREAD); 523 TRACE_EVENT_INSTANT0("cc", "Flush aborted", TRACE_EVENT_SCOPE_THREAD);
524 return; 524 return;
525 } 525 }
526 526
527 tile_task_manager_->CheckForCompletedTasks(); 527 tile_task_manager_->CheckForCompletedTasks();
528 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; 528 did_check_for_completed_tasks_since_last_schedule_tasks_ = true;
529
530 // Actually flush.
531 raster_buffer_provider_->Flush();
532
529 CheckPendingGpuWorkTiles(true /* issue_signals */); 533 CheckPendingGpuWorkTiles(true /* issue_signals */);
530 534
531 TRACE_EVENT_INSTANT1("cc", "DidFlush", TRACE_EVENT_SCOPE_THREAD, "stats", 535 TRACE_EVENT_INSTANT1("cc", "DidFlush", TRACE_EVENT_SCOPE_THREAD, "stats",
532 RasterTaskCompletionStatsAsValue(flush_stats_)); 536 RasterTaskCompletionStatsAsValue(flush_stats_));
533 flush_stats_ = RasterTaskCompletionStats(); 537 flush_stats_ = RasterTaskCompletionStats();
534 } 538 }
535 539
536 void TileManager::DidModifyTilePriorities() { 540 void TileManager::DidModifyTilePriorities() {
537 pending_tile_requirements_dirty_ = true; 541 pending_tile_requirements_dirty_ = true;
538 } 542 }
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 state->EndDictionary(); 1423 state->EndDictionary();
1420 return std::move(state); 1424 return std::move(state);
1421 } 1425 }
1422 1426
1423 bool TileManager::UsePartialRaster() const { 1427 bool TileManager::UsePartialRaster() const {
1424 return tile_manager_settings_.use_partial_raster && 1428 return tile_manager_settings_.use_partial_raster &&
1425 raster_buffer_provider_->CanPartialRasterIntoProvidedResource(); 1429 raster_buffer_provider_->CanPartialRasterIntoProvidedResource();
1426 } 1430 }
1427 1431
1428 void TileManager::CheckPendingGpuWorkTiles(bool issue_signals) { 1432 void TileManager::CheckPendingGpuWorkTiles(bool issue_signals) {
1433 TRACE_EVENT2("cc", "TileManager::CheckPendingGpuWorkTiles",
1434 "pending_gpu_work_tiles", pending_gpu_work_tiles_.size(),
1435 "tree_priority",
1436 TreePriorityToString(global_state_.tree_priority));
1437
1429 ResourceProvider::ResourceIdArray required_for_activation_ids; 1438 ResourceProvider::ResourceIdArray required_for_activation_ids;
1430 ResourceProvider::ResourceIdArray required_for_draw_ids; 1439 ResourceProvider::ResourceIdArray required_for_draw_ids;
1431 1440
1432 for (auto it = pending_gpu_work_tiles_.begin(); 1441 for (auto it = pending_gpu_work_tiles_.begin();
1433 it != pending_gpu_work_tiles_.end();) { 1442 it != pending_gpu_work_tiles_.end();) {
1434 Tile* tile = *it; 1443 Tile* tile = *it;
1435 const Resource* resource = tile->draw_info().resource(); 1444 const Resource* resource = tile->draw_info().resource();
1436 DCHECK(resource); 1445 DCHECK(resource);
1437 1446
1438 if (global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY || 1447 if (global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY ||
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 all_tile_tasks_completed = false; 1650 all_tile_tasks_completed = false;
1642 did_notify_all_tile_tasks_completed = false; 1651 did_notify_all_tile_tasks_completed = false;
1643 } 1652 }
1644 1653
1645 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; 1654 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default;
1646 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( 1655 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule(
1647 PrioritizedWorkToSchedule&& other) = default; 1656 PrioritizedWorkToSchedule&& other) = default;
1648 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; 1657 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default;
1649 1658
1650 } // namespace cc 1659 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698