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

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

Issue 12912010: cc: Convert non-const reference arguments to pointers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ui/compositor Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/output/delegating_renderer.h ('k') | cc/output/delegating_renderer_unittest.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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 static ResourceProvider::ResourceId AppendToArray( 134 static ResourceProvider::ResourceId AppendToArray(
135 ResourceProvider::ResourceIdArray* array, 135 ResourceProvider::ResourceIdArray* array,
136 ResourceProvider::ResourceId id) { 136 ResourceProvider::ResourceId id) {
137 array->push_back(id); 137 array->push_back(id);
138 return id; 138 return id;
139 } 139 }
140 140
141 void DelegatingRenderer::DrawFrame( 141 void DelegatingRenderer::DrawFrame(
142 RenderPassList& render_passes_in_draw_order) { 142 RenderPassList* render_passes_in_draw_order) {
143 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); 143 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame");
144 144
145 CompositorFrame out_frame; 145 CompositorFrame out_frame;
146 out_frame.metadata = client_->MakeCompositorFrameMetadata(); 146 out_frame.metadata = client_->MakeCompositorFrameMetadata();
147 147
148 out_frame.delegated_frame_data = make_scoped_ptr(new DelegatedFrameData); 148 out_frame.delegated_frame_data = make_scoped_ptr(new DelegatedFrameData);
149 149
150 // Collect all resource ids in the render passes into a ResourceIdArray. 150 // Collect all resource ids in the render passes into a ResourceIdArray.
151 ResourceProvider::ResourceIdArray resources; 151 ResourceProvider::ResourceIdArray resources;
152 DrawQuad::ResourceIteratorCallback append_to_array = 152 DrawQuad::ResourceIteratorCallback append_to_array =
153 base::Bind(&AppendToArray, &resources); 153 base::Bind(&AppendToArray, &resources);
154 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i) { 154 for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) {
155 RenderPass* render_pass = render_passes_in_draw_order[i]; 155 RenderPass* render_pass = render_passes_in_draw_order->at(i);
156 for (size_t j = 0; j < render_pass->quad_list.size(); ++j) 156 for (size_t j = 0; j < render_pass->quad_list.size(); ++j)
157 render_pass->quad_list[j]->IterateResources(append_to_array); 157 render_pass->quad_list[j]->IterateResources(append_to_array);
158 } 158 }
159 159
160 // Move the render passes and resources into the |out_frame|. 160 // Move the render passes and resources into the |out_frame|.
161 DelegatedFrameData& out_data = *out_frame.delegated_frame_data; 161 DelegatedFrameData& out_data = *out_frame.delegated_frame_data;
162 out_data.render_pass_list.swap(render_passes_in_draw_order); 162 out_data.render_pass_list.swap(*render_passes_in_draw_order);
163 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); 163 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list);
164 164
165 output_surface_->SendFrameToParentCompositor(&out_frame); 165 output_surface_->SendFrameToParentCompositor(&out_frame);
166 } 166 }
167 167
168 bool DelegatingRenderer::SwapBuffers() { 168 bool DelegatingRenderer::SwapBuffers() {
169 return true; 169 return true;
170 } 170 }
171 171
172 void DelegatingRenderer::GetFramebufferPixels(void* pixels, gfx::Rect rect) { 172 void DelegatingRenderer::GetFramebufferPixels(void* pixels, gfx::Rect rect) {
(...skipping 17 matching lines...) Expand all
190 190
191 void DelegatingRenderer::SetVisible(bool visible) { 191 void DelegatingRenderer::SetVisible(bool visible) {
192 visible_ = visible; 192 visible_ = visible;
193 } 193 }
194 194
195 void DelegatingRenderer::onContextLost() { 195 void DelegatingRenderer::onContextLost() {
196 client_->DidLoseOutputSurface(); 196 client_->DidLoseOutputSurface();
197 } 197 }
198 198
199 } // namespace cc 199 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/delegating_renderer.h ('k') | cc/output/delegating_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698