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

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

Issue 880693002: cc: Refactor additional code from BuildRasterQueue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 5 years, 10 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/resources/tile_manager.h ('k') | cc/test/fake_tile_manager_client.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/resources/tile_manager.h" 5 #include "cc/resources/tile_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 10
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; 355 did_check_for_completed_tasks_since_last_schedule_tasks_ = true;
356 } 356 }
357 357
358 FreeResourcesForReleasedTiles(); 358 FreeResourcesForReleasedTiles();
359 CleanUpReleasedTiles(); 359 CleanUpReleasedTiles();
360 360
361 TileVector tiles_that_need_to_be_rasterized; 361 TileVector tiles_that_need_to_be_rasterized;
362 scoped_ptr<RasterTilePriorityQueue> raster_priority_queue( 362 scoped_ptr<RasterTilePriorityQueue> raster_priority_queue(
363 client_->BuildRasterQueue(global_state_.tree_priority, 363 client_->BuildRasterQueue(global_state_.tree_priority,
364 RasterTilePriorityQueue::Type::ALL)); 364 RasterTilePriorityQueue::Type::ALL));
365 // Inform the client that will likely require a draw if the top tile is
366 // required for draw.
367 client_->SetIsLikelyToRequireADraw(
368 !raster_priority_queue->IsEmpty() &&
369 raster_priority_queue->Top()->required_for_draw());
365 AssignGpuMemoryToTiles(raster_priority_queue.get(), 370 AssignGpuMemoryToTiles(raster_priority_queue.get(),
366 scheduled_raster_task_limit_, 371 scheduled_raster_task_limit_,
367 &tiles_that_need_to_be_rasterized); 372 &tiles_that_need_to_be_rasterized);
368 373
369 // Schedule tile tasks. 374 // Schedule tile tasks.
370 ScheduleTasks(tiles_that_need_to_be_rasterized); 375 ScheduleTasks(tiles_that_need_to_be_rasterized);
371 376
372 did_notify_ready_to_activate_ = false; 377 did_notify_ready_to_activate_ = false;
373 did_notify_ready_to_draw_ = false; 378 did_notify_ready_to_draw_ = false;
374 } else { 379 } else {
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 result -= other; 1048 result -= other;
1044 return result; 1049 return result;
1045 } 1050 }
1046 1051
1047 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { 1052 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const {
1048 return memory_bytes_ > limit.memory_bytes_ || 1053 return memory_bytes_ > limit.memory_bytes_ ||
1049 resource_count_ > limit.resource_count_; 1054 resource_count_ > limit.resource_count_;
1050 } 1055 }
1051 1056
1052 } // namespace cc 1057 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager.h ('k') | cc/test/fake_tile_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698