| 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/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 resources.push_back(resource_id); | 89 resources.push_back(resource_id); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); | 92 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { | 95 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { |
| 96 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); | 96 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); |
| 97 CompositorFrame compositor_frame; | 97 CompositorFrame compositor_frame; |
| 98 compositor_frame.metadata = metadata; | 98 compositor_frame.metadata = metadata; |
| 99 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); | 99 compositor_frame.delegated_frame_data = std::move(delegated_frame_data_); |
| 100 output_surface_->SwapBuffers(&compositor_frame); | 100 output_surface_->SwapBuffers(&compositor_frame); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void DelegatingRenderer::ReceiveSwapBuffersAck( | 103 void DelegatingRenderer::ReceiveSwapBuffersAck( |
| 104 const CompositorFrameAck& ack) { | 104 const CompositorFrameAck& ack) { |
| 105 resource_provider_->ReceiveReturnsFromParent(ack.resources); | 105 resource_provider_->ReceiveReturnsFromParent(ack.resources); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void DelegatingRenderer::DidChangeVisibility() { | 108 void DelegatingRenderer::DidChangeVisibility() { |
| 109 ContextProvider* context_provider = output_surface_->context_provider(); | 109 ContextProvider* context_provider = output_surface_->context_provider(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 120 if (context_provider) { | 120 if (context_provider) { |
| 121 context_provider->ContextSupport()->SetSurfaceVisible(visible()); | 121 context_provider->ContextSupport()->SetSurfaceVisible(visible()); |
| 122 | 122 |
| 123 // If we are not visible, we ask the context to aggressively free resources. | 123 // If we are not visible, we ask the context to aggressively free resources. |
| 124 context_provider->ContextSupport()->SetAggressivelyFreeResources( | 124 context_provider->ContextSupport()->SetAggressivelyFreeResources( |
| 125 !visible()); | 125 !visible()); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace cc | 129 } // namespace cc |
| OLD | NEW |