OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 while (!active_tree_->LayersWithCopyOutputRequest().empty()) { | 917 while (!active_tree_->LayersWithCopyOutputRequest().empty()) { |
918 LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back(); | 918 LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back(); |
919 layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort); | 919 layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort); |
920 } | 920 } |
921 for (size_t i = 0; i < requests_to_abort.size(); ++i) | 921 for (size_t i = 0; i < requests_to_abort.size(); ++i) |
922 requests_to_abort[i]->SendEmptyResult(); | 922 requests_to_abort[i]->SendEmptyResult(); |
923 | 923 |
924 // If we're making a frame to draw, it better have at least one render pass. | 924 // If we're making a frame to draw, it better have at least one render pass. |
925 DCHECK(!frame->render_passes.empty()); | 925 DCHECK(!frame->render_passes.empty()); |
926 | 926 |
927 if (IsCurrentlyScrolling()) { | 927 if (active_tree_->frames_have_been_drawn() > 1) { |
928 UMA_HISTOGRAM_COUNTS_100( | 928 UMA_HISTOGRAM_COUNTS_100( |
929 "Compositing.RenderPass.AppendQuadData.NumMissingTiles", | 929 "Compositing.RenderPass.AppendQuadData.NumMissingTiles", |
930 num_missing_tiles); | 930 num_missing_tiles); |
931 UMA_HISTOGRAM_COUNTS_100( | 931 UMA_HISTOGRAM_COUNTS_100( |
932 "Compositing.RenderPass.AppendQuadData.NumIncompleteTiles", | 932 "Compositing.RenderPass.AppendQuadData.NumIncompleteTiles", |
933 num_incomplete_tiles); | 933 num_incomplete_tiles); |
934 } | 934 } |
935 | 935 |
936 // Should only have one render pass in resourceless software mode. | 936 // Should only have one render pass in resourceless software mode. |
937 DCHECK(draw_mode != DRAW_MODE_RESOURCELESS_SOFTWARE || | 937 DCHECK(draw_mode != DRAW_MODE_RESOURCELESS_SOFTWARE || |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 // The next frame should start by assuming nothing has changed, and changes | 1517 // The next frame should start by assuming nothing has changed, and changes |
1518 // are noted as they occur. | 1518 // are noted as they occur. |
1519 // TODO(boliu): If we did a temporary software renderer frame, propogate the | 1519 // TODO(boliu): If we did a temporary software renderer frame, propogate the |
1520 // damage forward to the next frame. | 1520 // damage forward to the next frame. |
1521 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { | 1521 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { |
1522 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> | 1522 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> |
1523 DidDrawDamagedArea(); | 1523 DidDrawDamagedArea(); |
1524 } | 1524 } |
1525 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); | 1525 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); |
1526 | 1526 |
| 1527 active_tree_->increment_frames_have_been_drawn(); |
1527 devtools_instrumentation::DidDrawFrame(id_); | 1528 devtools_instrumentation::DidDrawFrame(id_); |
1528 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( | 1529 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( |
1529 rendering_stats_instrumentation_->impl_thread_rendering_stats()); | 1530 rendering_stats_instrumentation_->impl_thread_rendering_stats()); |
1530 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); | 1531 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); |
1531 } | 1532 } |
1532 | 1533 |
1533 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1534 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
1534 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1535 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
1535 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); | 1536 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); |
1536 | 1537 |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3258 } | 3259 } |
3259 | 3260 |
3260 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3261 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3261 std::vector<PictureLayerImpl*>::iterator it = | 3262 std::vector<PictureLayerImpl*>::iterator it = |
3262 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3263 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3263 DCHECK(it != picture_layers_.end()); | 3264 DCHECK(it != picture_layers_.end()); |
3264 picture_layers_.erase(it); | 3265 picture_layers_.erase(it); |
3265 } | 3266 } |
3266 | 3267 |
3267 } // namespace cc | 3268 } // namespace cc |
OLD | NEW |