| 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 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 if (pending_tree_) | 1442 if (pending_tree_) |
| 1443 pending_tree_->set_needs_update_draw_properties(); | 1443 pending_tree_->set_needs_update_draw_properties(); |
| 1444 | 1444 |
| 1445 // Compositor, not CompositorFrameSink, is responsible for setting damage | 1445 // Compositor, not CompositorFrameSink, is responsible for setting damage |
| 1446 // and triggering redraw for constraint changes. | 1446 // and triggering redraw for constraint changes. |
| 1447 SetFullViewportDamage(); | 1447 SetFullViewportDamage(); |
| 1448 SetNeedsRedraw(); | 1448 SetNeedsRedraw(); |
| 1449 } | 1449 } |
| 1450 } | 1450 } |
| 1451 | 1451 |
| 1452 void LayerTreeHostImpl::DidSwapBuffersComplete() { | 1452 void LayerTreeHostImpl::DidReceiveCompositorFrameAck() { |
| 1453 client_->DidSwapBuffersCompleteOnImplThread(); | 1453 client_->DidReceiveCompositorFrameAckOnImplThread(); |
| 1454 } | 1454 } |
| 1455 | 1455 |
| 1456 void LayerTreeHostImpl::ReclaimResources( | 1456 void LayerTreeHostImpl::ReclaimResources( |
| 1457 const ReturnedResourceArray& resources) { | 1457 const ReturnedResourceArray& resources) { |
| 1458 // TODO(piman): We may need to do some validation on this ack before | 1458 // TODO(piman): We may need to do some validation on this ack before |
| 1459 // processing it. | 1459 // processing it. |
| 1460 if (resource_provider_) | 1460 if (resource_provider_) |
| 1461 resource_provider_->ReceiveReturnsFromParent(resources); | 1461 resource_provider_->ReceiveReturnsFromParent(resources); |
| 1462 | 1462 |
| 1463 // In OOM, we now might be able to release more resources that were held | 1463 // In OOM, we now might be able to release more resources that were held |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 } | 1667 } |
| 1668 } | 1668 } |
| 1669 | 1669 |
| 1670 auto data = base::MakeUnique<DelegatedFrameData>(); | 1670 auto data = base::MakeUnique<DelegatedFrameData>(); |
| 1671 resource_provider_->PrepareSendToParent(resources, &data->resource_list); | 1671 resource_provider_->PrepareSendToParent(resources, &data->resource_list); |
| 1672 data->render_pass_list = std::move(frame->render_passes); | 1672 data->render_pass_list = std::move(frame->render_passes); |
| 1673 | 1673 |
| 1674 CompositorFrame compositor_frame; | 1674 CompositorFrame compositor_frame; |
| 1675 compositor_frame.metadata = std::move(metadata); | 1675 compositor_frame.metadata = std::move(metadata); |
| 1676 compositor_frame.delegated_frame_data = std::move(data); | 1676 compositor_frame.delegated_frame_data = std::move(data); |
| 1677 compositor_frame_sink_->SwapBuffers(std::move(compositor_frame)); | 1677 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); |
| 1678 | 1678 |
| 1679 // The next frame should start by assuming nothing has changed, and changes | 1679 // The next frame should start by assuming nothing has changed, and changes |
| 1680 // are noted as they occur. | 1680 // are noted as they occur. |
| 1681 // TODO(boliu): If we did a temporary software renderer frame, propogate the | 1681 // TODO(boliu): If we did a temporary software renderer frame, propogate the |
| 1682 // damage forward to the next frame. | 1682 // damage forward to the next frame. |
| 1683 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { | 1683 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { |
| 1684 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface(); | 1684 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface(); |
| 1685 surface->damage_tracker()->DidDrawDamagedArea(); | 1685 surface->damage_tracker()->DidDrawDamagedArea(); |
| 1686 } | 1686 } |
| 1687 active_tree_->ResetAllChangeTracking(); | 1687 active_tree_->ResetAllChangeTracking(); |
| (...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4088 if (is_visible) { | 4088 if (is_visible) { |
| 4089 worker_context_visibility_ = | 4089 worker_context_visibility_ = |
| 4090 worker_context->CacheController()->ClientBecameVisible(); | 4090 worker_context->CacheController()->ClientBecameVisible(); |
| 4091 } else { | 4091 } else { |
| 4092 worker_context->CacheController()->ClientBecameNotVisible( | 4092 worker_context->CacheController()->ClientBecameNotVisible( |
| 4093 std::move(worker_context_visibility_)); | 4093 std::move(worker_context_visibility_)); |
| 4094 } | 4094 } |
| 4095 } | 4095 } |
| 4096 | 4096 |
| 4097 } // namespace cc | 4097 } // namespace cc |
| OLD | NEW |