| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 mts.can_use_gpu_memory = false; | 587 mts.can_use_gpu_memory = false; |
| 588 FreeResourcesForTile(tile); | 588 FreeResourcesForTile(tile); |
| 589 continue; | 589 continue; |
| 590 } | 590 } |
| 591 if (tile_bytes > bytes_left) { | 591 if (tile_bytes > bytes_left) { |
| 592 mts.can_use_gpu_memory = false; | 592 mts.can_use_gpu_memory = false; |
| 593 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 593 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
| 594 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) | 594 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) |
| 595 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; | 595 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; |
| 596 FreeResourcesForTile(tile); | 596 FreeResourcesForTile(tile); |
| 597 tile->drawing_info().set_rasterize_on_demand(); |
| 598 tile->drawing_info().set_contents_swizzled( |
| 599 !PlatformColor::SameComponentOrder(tile->format_)); |
| 597 continue; | 600 continue; |
| 598 } | 601 } |
| 602 tile->drawing_info().set_use_resource(); |
| 599 bytes_left -= tile_bytes; | 603 bytes_left -= tile_bytes; |
| 600 mts.can_use_gpu_memory = true; | 604 mts.can_use_gpu_memory = true; |
| 601 if (!mts.drawing_info.resource_ && | 605 if (!mts.drawing_info.resource_ && |
| 602 !mts.drawing_info.resource_is_being_initialized_) { | 606 !mts.drawing_info.resource_is_being_initialized_) { |
| 603 tiles_that_need_to_be_rasterized_.push_back(tile); | 607 tiles_that_need_to_be_rasterized_.push_back(tile); |
| 604 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); | 608 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); |
| 605 } | 609 } |
| 606 } | 610 } |
| 607 | 611 |
| 608 ever_exceeded_memory_budget_ |= | 612 ever_exceeded_memory_budget_ |= |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 skia::LazyPixelRef* pixel_ref, | 1094 skia::LazyPixelRef* pixel_ref, |
| 1091 RenderingStatsInstrumentation* stats_instrumentation) { | 1095 RenderingStatsInstrumentation* stats_instrumentation) { |
| 1092 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 1096 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
| 1093 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 1097 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
| 1094 pixel_ref->Decode(); | 1098 pixel_ref->Decode(); |
| 1095 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 1099 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
| 1096 stats_instrumentation->AddDeferredImageDecode(duration); | 1100 stats_instrumentation->AddDeferredImageDecode(duration); |
| 1097 } | 1101 } |
| 1098 | 1102 |
| 1099 } // namespace cc | 1103 } // namespace cc |
| OLD | NEW |