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

Unified Diff: cc/tile_manager.cc

Issue 12321053: cc: Complete pending tile uploads if they are needed for tree activation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only flush when not in smoothness/animations Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« cc/resource_provider.cc ('K') | « cc/tile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_manager.cc
diff --git a/cc/tile_manager.cc b/cc/tile_manager.cc
index 963dd9a02ef71032a1399ff3a04a85db53465aa1..0a16af474358ff963c7ff825c4c2cad6120e9e38 100644
--- a/cc/tile_manager.cc
+++ b/cc/tile_manager.cc
@@ -128,6 +128,9 @@ scoped_ptr<base::Value> TileRasterStateAsValue(
case UPLOAD_STATE:
return scoped_ptr<base::Value>(base::Value::CreateStringValue(
"UPLOAD_STATE"));
+ case UPLOAD_FLUSHED_STATE:
nduca 2013/03/11 19:41:47 I'm not sure I'm wild about flush as a term here.
Sami 2013/03/12 14:13:07 Agreed. I'll call it forced upload completion here
+ return scoped_ptr<base::Value>(base::Value::CreateStringValue(
+ "UPLOAD_FLUSHED_STATE"));
default:
DCHECK(false) << "Unrecognized TileRasterState value";
return scoped_ptr<base::Value>(base::Value::CreateStringValue(
@@ -459,6 +462,17 @@ void TileManager::DidCompleteFrame() {
did_schedule_cheap_tasks_ = false;
}
+void TileManager::FlushPendingTileUploadIfNeeded(Tile* tile) {
+ ManagedTileState& managed_tile_state = tile->managed_state();
+ if (managed_tile_state.raster_state == UPLOAD_STATE) {
+ DCHECK(managed_tile_state.resource);
+ Resource* resource = managed_tile_state.resource.get();
+ resource_pool_->resource_provider()->InsertWaitForSetPixels(resource->id());
+ managed_tile_state.resource_is_being_initialized = false;
+ DidTileRasterStateChange(tile, UPLOAD_FLUSHED_STATE);
+ }
+}
+
void TileManager::GetMemoryStats(
size_t* memoryRequiredBytes,
size_t* memoryNiceToHaveBytes,
@@ -544,6 +558,7 @@ bool TileManager::HasPendingWorkScheduled(WhichTree tree) const {
case WAITING_FOR_RASTER_STATE:
case RASTER_STATE:
case UPLOAD_STATE:
+ case UPLOAD_FLUSHED_STATE:
for (int j = 0; j < NEVER_BIN; ++j) {
if (raster_state_count_[i][tree][j])
return true;
« cc/resource_provider.cc ('K') | « cc/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698