Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: cc/resources/tile_manager.cc

Issue 14230007: cc: Do GatherPixelRefs from skia at record time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile fix Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/picture_unittest.cc ('k') | cc/test/fake_content_layer_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/resources/picture_unittest.cc ('k') | cc/test/fake_content_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698