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 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 managed_tile_state.picture_pile_analysis.solid_color); | 679 managed_tile_state.picture_pile_analysis.solid_color); |
680 DidFinishTileInitialization(tile); | 680 DidFinishTileInitialization(tile); |
681 } else if (managed_tile_state.picture_pile_analysis.is_transparent) { | 681 } else if (managed_tile_state.picture_pile_analysis.is_transparent) { |
682 tile->drawing_info().set_transparent(); | 682 tile->drawing_info().set_transparent(); |
683 DidFinishTileInitialization(tile); | 683 DidFinishTileInitialization(tile); |
684 } | 684 } |
685 } | 685 } |
686 } | 686 } |
687 | 687 |
688 void TileManager::GatherPixelRefsForTile(Tile* tile) { | 688 void TileManager::GatherPixelRefsForTile(Tile* tile) { |
| 689 // TODO(vmpstr): Remove this function and pending_pixel_refs |
| 690 // when reveman's improvements to worker pool go in. |
689 TRACE_EVENT0("cc", "TileManager::GatherPixelRefsForTile"); | 691 TRACE_EVENT0("cc", "TileManager::GatherPixelRefsForTile"); |
690 ManagedTileState& managed_tile_state = tile->managed_state(); | 692 ManagedTileState& managed_tile_state = tile->managed_state(); |
691 if (managed_tile_state.need_to_gather_pixel_refs) { | 693 if (managed_tile_state.need_to_gather_pixel_refs) { |
692 base::TimeTicks start_time = | 694 base::TimeTicks start_time = |
693 rendering_stats_instrumentation_->StartRecording(); | 695 rendering_stats_instrumentation_->StartRecording(); |
694 tile->picture_pile()->GatherPixelRefs( | 696 for (PicturePileImpl::PixelRefIterator pixel_ref_iter( |
695 tile->content_rect_, | 697 tile->content_rect(), |
696 tile->contents_scale_, | 698 tile->contents_scale(), |
697 managed_tile_state.pending_pixel_refs); | 699 tile->picture_pile()); |
| 700 pixel_ref_iter; |
| 701 ++pixel_ref_iter) { |
| 702 managed_tile_state.pending_pixel_refs.push_back(*pixel_ref_iter); |
| 703 } |
698 managed_tile_state.need_to_gather_pixel_refs = false; | 704 managed_tile_state.need_to_gather_pixel_refs = false; |
699 base::TimeDelta duration = | 705 base::TimeDelta duration = |
700 rendering_stats_instrumentation_->EndRecording(start_time); | 706 rendering_stats_instrumentation_->EndRecording(start_time); |
701 rendering_stats_instrumentation_->AddImageGathering(duration); | 707 rendering_stats_instrumentation_->AddImageGathering(duration); |
702 } | 708 } |
703 } | 709 } |
704 | 710 |
705 void TileManager::DispatchImageDecodeTasksForTile(Tile* tile) { | 711 void TileManager::DispatchImageDecodeTasksForTile(Tile* tile) { |
706 GatherPixelRefsForTile(tile); | 712 GatherPixelRefsForTile(tile); |
707 std::list<skia::LazyPixelRef*>& pending_pixel_refs = | 713 std::list<skia::LazyPixelRef*>& pending_pixel_refs = |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 skia::LazyPixelRef* pixel_ref, | 1031 skia::LazyPixelRef* pixel_ref, |
1026 RenderingStatsInstrumentation* stats_instrumentation) { | 1032 RenderingStatsInstrumentation* stats_instrumentation) { |
1027 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 1033 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
1028 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 1034 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
1029 pixel_ref->Decode(); | 1035 pixel_ref->Decode(); |
1030 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 1036 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
1031 stats_instrumentation->AddDeferredImageDecode(duration); | 1037 stats_instrumentation->AddDeferredImageDecode(duration); |
1032 } | 1038 } |
1033 | 1039 |
1034 } // namespace cc | 1040 } // namespace cc |
OLD | NEW |