| 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/resources/tile_manager.h" | 5 #include "cc/resources/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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 mts.can_use_gpu_memory = false; | 607 mts.can_use_gpu_memory = false; |
| 608 FreeResourcesForTile(tile); | 608 FreeResourcesForTile(tile); |
| 609 continue; | 609 continue; |
| 610 } | 610 } |
| 611 if (tile_bytes > bytes_left) { | 611 if (tile_bytes > bytes_left) { |
| 612 mts.can_use_gpu_memory = false; | 612 mts.can_use_gpu_memory = false; |
| 613 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 613 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
| 614 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) | 614 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) |
| 615 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; | 615 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; |
| 616 FreeResourcesForTile(tile); | 616 FreeResourcesForTile(tile); |
| 617 tile->drawing_info().set_rasterize_on_demand(); |
| 617 continue; | 618 continue; |
| 618 } | 619 } |
| 619 bytes_left -= tile_bytes; | 620 bytes_left -= tile_bytes; |
| 620 mts.can_use_gpu_memory = true; | 621 mts.can_use_gpu_memory = true; |
| 621 if (!mts.drawing_info.resource_ && | 622 if (!mts.drawing_info.resource_ && |
| 622 !mts.drawing_info.resource_is_being_initialized_) { | 623 !mts.drawing_info.resource_is_being_initialized_) { |
| 623 tiles_that_need_to_be_rasterized_.push_back(tile); | 624 tiles_that_need_to_be_rasterized_.push_back(tile); |
| 624 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); | 625 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); |
| 625 } | 626 } |
| 626 } | 627 } |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 decode_begin_time = base::TimeTicks::HighResNow(); | 1116 decode_begin_time = base::TimeTicks::HighResNow(); |
| 1116 pixel_ref->Decode(); | 1117 pixel_ref->Decode(); |
| 1117 if (stats) { | 1118 if (stats) { |
| 1118 stats->totalDeferredImageDecodeCount++; | 1119 stats->totalDeferredImageDecodeCount++; |
| 1119 stats->totalDeferredImageDecodeTime += | 1120 stats->totalDeferredImageDecodeTime += |
| 1120 base::TimeTicks::HighResNow() - decode_begin_time; | 1121 base::TimeTicks::HighResNow() - decode_begin_time; |
| 1121 } | 1122 } |
| 1122 } | 1123 } |
| 1123 | 1124 |
| 1124 } // namespace cc | 1125 } // namespace cc |
| OLD | NEW |