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

Side by Side 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: Chromified and added a test. 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 unified diff | Download patch | Annotate | Revision Log
« cc/picture_layer_impl.cc ('K') | « cc/tile_manager.h ('k') | no next file » | 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/tile_manager.h" 5 #include "cc/tile_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 DidTileRasterStateChange(tile, IDLE_STATE); 442 DidTileRasterStateChange(tile, IDLE_STATE);
443 tiles_with_pending_upload_.pop(); 443 tiles_with_pending_upload_.pop();
444 } 444 }
445 } 445 }
446 446
447 void TileManager::DidCompleteFrame() { 447 void TileManager::DidCompleteFrame() {
448 allow_cheap_tasks_ = true; 448 allow_cheap_tasks_ = true;
449 did_schedule_cheap_tasks_ = false; 449 did_schedule_cheap_tasks_ = false;
450 } 450 }
451 451
452 void TileManager::FlushPendingTileUploadIfNeeded(Tile* tile) {
453 ManagedTileState& managed_tile_state = tile->managed_state();
454 if (managed_tile_state.raster_state == UPLOAD_STATE &&
455 managed_tile_state.resource_is_being_initialized) {
456 DCHECK(managed_tile_state.resource);
457 Resource* resource = managed_tile_state.resource.get();
458 resource_pool_->resource_provider()->InsertWaitForSetPixels(resource->id());
459 managed_tile_state.resource_is_being_initialized = false;
reveman 2013/03/07 20:31:58 I like this approach of not moving the tile out of
Sami 2013/03/08 18:01:10 Done, I've added UPLOAD_FLUSHED_STATE.
460 }
461 }
462
452 void TileManager::GetMemoryStats( 463 void TileManager::GetMemoryStats(
453 size_t* memoryRequiredBytes, 464 size_t* memoryRequiredBytes,
454 size_t* memoryNiceToHaveBytes, 465 size_t* memoryNiceToHaveBytes,
455 size_t* memoryUsedBytes) const { 466 size_t* memoryUsedBytes) const {
456 *memoryRequiredBytes = 0; 467 *memoryRequiredBytes = 0;
457 *memoryNiceToHaveBytes = 0; 468 *memoryNiceToHaveBytes = 0;
458 *memoryUsedBytes = 0; 469 *memoryUsedBytes = 0;
459 for (size_t i = 0; i < live_or_allocated_tiles_.size(); i++) { 470 for (size_t i = 0; i < live_or_allocated_tiles_.size(); i++) {
460 const Tile* tile = live_or_allocated_tiles_[i]; 471 const Tile* tile = live_or_allocated_tiles_[i];
461 const ManagedTileState& mts = tile->managed_state(); 472 const ManagedTileState& mts = tile->managed_state();
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 decode_begin_time = base::TimeTicks::HighResNow(); 999 decode_begin_time = base::TimeTicks::HighResNow();
989 pixel_ref->Decode(); 1000 pixel_ref->Decode();
990 if (stats) { 1001 if (stats) {
991 stats->totalDeferredImageDecodeCount++; 1002 stats->totalDeferredImageDecodeCount++;
992 stats->totalDeferredImageDecodeTime += 1003 stats->totalDeferredImageDecodeTime +=
993 base::TimeTicks::HighResNow() - decode_begin_time; 1004 base::TimeTicks::HighResNow() - decode_begin_time;
994 } 1005 }
995 } 1006 }
996 1007
997 } // namespace cc 1008 } // namespace cc
OLDNEW
« cc/picture_layer_impl.cc ('K') | « cc/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698