Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 542 // different than texture format. | 542 // different than texture format. |
| 543 managed_tile_state.contents_swizzled = | 543 managed_tile_state.contents_swizzled = |
| 544 !PlatformColor::sameComponentOrder(tile->format_); | 544 !PlatformColor::sameComponentOrder(tile->format_); |
| 545 | 545 |
| 546 // Tile resources can't be freed until upload has completed. | 546 // Tile resources can't be freed until upload has completed. |
| 547 managed_tile_state.can_be_freed = false; | 547 managed_tile_state.can_be_freed = false; |
| 548 | 548 |
| 549 resource_pool_->resource_provider()->beginSetPixels(resource->id()); | 549 resource_pool_->resource_provider()->beginSetPixels(resource->id()); |
| 550 managed_tile_state.resource = resource.Pass(); | 550 managed_tile_state.resource = resource.Pass(); |
| 551 tiles_with_pending_set_pixels_.push(tile); | 551 tiles_with_pending_set_pixels_.push(tile); |
| 552 | |
| 553 resource_pool_->resource_provider()->shallowFlushIfSupported(); | |
|
epenner
2013/01/10 04:45:49
Could this just go straight into the resource prov
reveman
2013/01/10 14:46:58
I think the tile manager is the right place for th
epenner
2013/01/10 17:34:42
Yeah sorry, this patch is good as is, just thinkin
epenner
2013/01/10 17:45:42
So actually I talked with Dave and this is good as
| |
| 552 } else { | 554 } else { |
| 553 resource_pool_->resource_provider()->releasePixelBuffer(resource->id()); | 555 resource_pool_->resource_provider()->releasePixelBuffer(resource->id()); |
| 554 resource_pool_->ReleaseResource(resource.Pass()); | 556 resource_pool_->ReleaseResource(resource.Pass()); |
| 555 managed_tile_state.resource_is_being_initialized = false; | 557 managed_tile_state.resource_is_being_initialized = false; |
| 556 } | 558 } |
| 557 | 559 |
| 558 DispatchMoreTasks(); | 560 DispatchMoreTasks(); |
| 559 } | 561 } |
| 560 | 562 |
| 561 void TileManager::DidFinishTileInitialization(Tile* tile) { | 563 void TileManager::DidFinishTileInitialization(Tile* tile) { |
| 562 ManagedTileState& managed_tile_state = tile->managed_state(); | 564 ManagedTileState& managed_tile_state = tile->managed_state(); |
| 563 DCHECK(managed_tile_state.resource); | 565 DCHECK(managed_tile_state.resource); |
| 564 managed_tile_state.resource_is_being_initialized = false; | 566 managed_tile_state.resource_is_being_initialized = false; |
| 565 managed_tile_state.can_be_freed = true; | 567 managed_tile_state.can_be_freed = true; |
| 566 for (int i = 0; i < NUM_TREES; ++i) | 568 for (int i = 0; i < NUM_TREES; ++i) |
| 567 drawable_tiles_in_bin_count_[managed_tile_state.bin[i]][i]++; | 569 drawable_tiles_in_bin_count_[managed_tile_state.bin[i]][i]++; |
| 568 } | 570 } |
| 569 | 571 |
| 570 } // namespace cc | 572 } // namespace cc |
| OLD | NEW |