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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
585 mts.can_use_gpu_memory = false; | 585 mts.can_use_gpu_memory = false; |
586 FreeResourcesForTile(tile); | 586 FreeResourcesForTile(tile); |
587 continue; | 587 continue; |
588 } | 588 } |
589 if (tile_bytes > bytes_left) { | 589 if (tile_bytes > bytes_left) { |
590 mts.can_use_gpu_memory = false; | 590 mts.can_use_gpu_memory = false; |
591 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || | 591 if (mts.bin[HIGH_PRIORITY_BIN] == NOW_BIN || |
592 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) | 592 mts.bin[LOW_PRIORITY_BIN] == NOW_BIN) |
593 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; | 593 bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes; |
594 FreeResourcesForTile(tile); | 594 FreeResourcesForTile(tile); |
595 tile->drawing_info().set_rasterize_on_demand(); | |
596 tile->drawing_info().set_contents_swizzled( | |
597 !PlatformColor::SameComponentOrder(tile->format_)); | |
reveman
2013/03/26 18:32:53
nit: indent 4 spaces here
Leandro GraciĆ” Gil
2013/03/26 18:35:47
Done.
| |
595 continue; | 598 continue; |
596 } | 599 } |
600 tile->drawing_info().set_use_resource(); | |
597 bytes_left -= tile_bytes; | 601 bytes_left -= tile_bytes; |
598 mts.can_use_gpu_memory = true; | 602 mts.can_use_gpu_memory = true; |
599 if (!tile->drawing_info().resource_ && | 603 if (!tile->drawing_info().resource_ && |
600 !tile->drawing_info().resource_is_being_initialized_) { | 604 !tile->drawing_info().resource_is_being_initialized_) { |
601 tiles_that_need_to_be_rasterized_.push_back(tile); | 605 tiles_that_need_to_be_rasterized_.push_back(tile); |
602 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); | 606 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); |
603 } | 607 } |
604 } | 608 } |
605 | 609 |
606 ever_exceeded_memory_budget_ |= | 610 ever_exceeded_memory_budget_ |= |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1086 skia::LazyPixelRef* pixel_ref, | 1090 skia::LazyPixelRef* pixel_ref, |
1087 RenderingStatsInstrumentation* stats_instrumentation) { | 1091 RenderingStatsInstrumentation* stats_instrumentation) { |
1088 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 1092 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
1089 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 1093 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
1090 pixel_ref->Decode(); | 1094 pixel_ref->Decode(); |
1091 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 1095 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
1092 stats_instrumentation->AddDeferredImageDecode(duration); | 1096 stats_instrumentation->AddDeferredImageDecode(duration); |
1093 } | 1097 } |
1094 | 1098 |
1095 } // namespace cc | 1099 } // namespace cc |
OLD | NEW |