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

Side by Side Diff: cc/output/delegating_renderer.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make CompositorFrameMetadata movable Created 4 years, 6 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/output/compositor_frame_metadata.cc ('k') | cc/output/gl_renderer.cc » ('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/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ResourceProvider::ResourceIdArray resources; 92 ResourceProvider::ResourceIdArray resources;
93 for (const auto& render_pass : out_data.render_pass_list) { 93 for (const auto& render_pass : out_data.render_pass_list) {
94 for (const auto& quad : render_pass->quad_list) { 94 for (const auto& quad : render_pass->quad_list) {
95 for (ResourceId resource_id : quad->resources) 95 for (ResourceId resource_id : quad->resources)
96 resources.push_back(resource_id); 96 resources.push_back(resource_id);
97 } 97 }
98 } 98 }
99 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); 99 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list);
100 } 100 }
101 101
102 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { 102 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) {
piman 2016/06/24 00:56:25 nit: can we make this take a CompositorFrameMetada
103 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); 103 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers");
104 CompositorFrame compositor_frame; 104 CompositorFrame compositor_frame;
105 compositor_frame.metadata = metadata; 105 compositor_frame.metadata = CompositorFrameMetadata(metadata);
106 compositor_frame.delegated_frame_data = std::move(delegated_frame_data_); 106 compositor_frame.delegated_frame_data = std::move(delegated_frame_data_);
107 output_surface_->SwapBuffers(&compositor_frame); 107 output_surface_->SwapBuffers(std::move(compositor_frame));
108 } 108 }
109 109
110 void DelegatingRenderer::ReceiveSwapBuffersAck( 110 void DelegatingRenderer::ReceiveSwapBuffersAck(
111 const CompositorFrameAck& ack) { 111 const CompositorFrameAck& ack) {
112 resource_provider_->ReceiveReturnsFromParent(ack.resources); 112 resource_provider_->ReceiveReturnsFromParent(ack.resources);
113 } 113 }
114 114
115 void DelegatingRenderer::DidChangeVisibility() { 115 void DelegatingRenderer::DidChangeVisibility() {
116 ContextProvider* context_provider = output_surface_->context_provider(); 116 ContextProvider* context_provider = output_surface_->context_provider();
117 if (!visible()) { 117 if (!visible()) {
118 TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources"); 118 TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources");
119 if (context_provider) { 119 if (context_provider) {
120 context_provider->DeleteCachedResources(); 120 context_provider->DeleteCachedResources();
121 context_provider->ContextGL()->Flush(); 121 context_provider->ContextGL()->Flush();
122 } 122 }
123 } 123 }
124 if (context_provider) { 124 if (context_provider) {
125 // If we are not visible, we ask the context to aggressively free resources. 125 // If we are not visible, we ask the context to aggressively free resources.
126 context_provider->ContextSupport()->SetAggressivelyFreeResources( 126 context_provider->ContextSupport()->SetAggressivelyFreeResources(
127 !visible()); 127 !visible());
128 } 128 }
129 } 129 }
130 130
131 } // namespace cc 131 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/compositor_frame_metadata.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698