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