Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1659 } | 1659 } |
| 1660 | 1660 |
| 1661 | 1661 |
| 1662 CompositorFrame compositor_frame; | 1662 CompositorFrame compositor_frame; |
| 1663 compositor_frame.metadata = std::move(metadata); | 1663 compositor_frame.metadata = std::move(metadata); |
| 1664 resource_provider_->PrepareSendToParent(resources, | 1664 resource_provider_->PrepareSendToParent(resources, |
| 1665 &compositor_frame.resource_list); | 1665 &compositor_frame.resource_list); |
| 1666 compositor_frame.render_pass_list = std::move(frame->render_passes); | 1666 compositor_frame.render_pass_list = std::move(frame->render_passes); |
| 1667 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); | 1667 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); |
| 1668 | 1668 |
| 1669 active_tree()->ClearSwapPromises(); | |
|
Fady Samuel
2016/12/15 21:08:40
Is this necessary? Why was this added?
Saman Sami
2016/12/15 21:20:55
This calls DidSwap, and clears the swap promise li
| |
| 1670 | |
| 1669 // The next frame should start by assuming nothing has changed, and changes | 1671 // The next frame should start by assuming nothing has changed, and changes |
| 1670 // are noted as they occur. | 1672 // are noted as they occur. |
| 1671 // TODO(boliu): If we did a temporary software renderer frame, propogate the | 1673 // TODO(boliu): If we did a temporary software renderer frame, propogate the |
| 1672 // damage forward to the next frame. | 1674 // damage forward to the next frame. |
| 1673 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { | 1675 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { |
| 1674 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface(); | 1676 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface(); |
| 1675 surface->damage_tracker()->DidDrawDamagedArea(); | 1677 surface->damage_tracker()->DidDrawDamagedArea(); |
| 1676 } | 1678 } |
| 1677 active_tree_->ResetAllChangeTracking(); | 1679 active_tree_->ResetAllChangeTracking(); |
| 1678 | 1680 |
| 1679 active_tree_->set_has_ever_been_drawn(true); | 1681 active_tree_->set_has_ever_been_drawn(true); |
| 1680 devtools_instrumentation::DidDrawFrame(id_); | 1682 devtools_instrumentation::DidDrawFrame(id_); |
| 1681 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( | 1683 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( |
| 1682 rendering_stats_instrumentation_->impl_thread_rendering_stats()); | 1684 rendering_stats_instrumentation_->impl_thread_rendering_stats()); |
| 1683 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); | 1685 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); |
| 1686 | |
|
Fady Samuel
2016/12/15 21:08:40
Remove blank line?
Saman Sami
2016/12/15 21:20:55
Done.
| |
| 1684 return true; | 1687 return true; |
| 1685 } | 1688 } |
| 1686 | 1689 |
| 1687 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1690 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
| 1688 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1691 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
| 1689 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); | 1692 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); |
| 1690 | 1693 |
| 1691 for (auto* it : video_frame_controllers_) | 1694 for (auto* it : video_frame_controllers_) |
| 1692 it->DidDrawFrame(); | 1695 it->DidDrawFrame(); |
| 1693 } | 1696 } |
| (...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4084 worker_context_visibility_ = | 4087 worker_context_visibility_ = |
| 4085 worker_context->CacheController()->ClientBecameVisible(); | 4088 worker_context->CacheController()->ClientBecameVisible(); |
| 4086 } else { | 4089 } else { |
| 4087 worker_context->CacheController()->ClientBecameNotVisible( | 4090 worker_context->CacheController()->ClientBecameNotVisible( |
| 4088 std::move(worker_context_visibility_)); | 4091 std::move(worker_context_visibility_)); |
| 4089 } | 4092 } |
| 4090 } | 4093 } |
| 4091 } | 4094 } |
| 4092 | 4095 |
| 4093 } // namespace cc | 4096 } // namespace cc |
| OLD | NEW |