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/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(); | |
| 595 tile->drawing_info().set_contents_swizzled( | |
| 596 !PlatformColor::SameComponentOrder(tile->format_)); | |
| 594 continue; | 597 continue; |
| 595 } | 598 } |
| 599 tile->drawing_info().set_texture(); | |
|
reveman
2013/03/23 00:41:31
This feels a bit awkward. I think something like s
Leandro GraciĆ” Gil
2013/03/25 15:21:02
Since there is another comment for this same metho
| |
| 596 bytes_left -= tile_bytes; | 600 bytes_left -= tile_bytes; |
| 597 mts.can_use_gpu_memory = true; | 601 mts.can_use_gpu_memory = true; |
| 598 if (!mts.drawing_info.resource_ && | 602 if (!mts.drawing_info.resource_ && |
| 599 !mts.drawing_info.resource_is_being_initialized_) { | 603 !mts.drawing_info.resource_is_being_initialized_) { |
| 600 tiles_that_need_to_be_rasterized_.push_back(tile); | 604 tiles_that_need_to_be_rasterized_.push_back(tile); |
| 601 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); | 605 DidTileRasterStateChange(tile, WAITING_FOR_RASTER_STATE); |
| 602 } | 606 } |
| 603 } | 607 } |
| 604 | 608 |
| 605 ever_exceeded_memory_budget_ |= | 609 ever_exceeded_memory_budget_ |= |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1087 skia::LazyPixelRef* pixel_ref, | 1091 skia::LazyPixelRef* pixel_ref, |
| 1088 RenderingStatsInstrumentation* stats_instrumentation) { | 1092 RenderingStatsInstrumentation* stats_instrumentation) { |
| 1089 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 1093 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
| 1090 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 1094 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
| 1091 pixel_ref->Decode(); | 1095 pixel_ref->Decode(); |
| 1092 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 1096 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
| 1093 stats_instrumentation->AddDeferredImageDecode(duration); | 1097 stats_instrumentation->AddDeferredImageDecode(duration); |
| 1094 } | 1098 } |
| 1095 | 1099 |
| 1096 } // namespace cc | 1100 } // namespace cc |
| OLD | NEW |