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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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/delegating_renderer.h ('k') | cc/output/direct_renderer.h » ('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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 static ResourceProvider::ResourceId AppendToArray( 89 static ResourceProvider::ResourceId AppendToArray(
90 ResourceProvider::ResourceIdArray* array, 90 ResourceProvider::ResourceIdArray* array,
91 ResourceProvider::ResourceId id) { 91 ResourceProvider::ResourceId id) {
92 array->push_back(id); 92 array->push_back(id);
93 return id; 93 return id;
94 } 94 }
95 95
96 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, 96 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
97 ContextProvider* offscreen_context_provider, 97 ContextProvider* offscreen_context_provider,
98 float device_scale_factor, 98 float device_scale_factor,
99 gfx::Rect device_viewport_rect, 99 const gfx::Rect& device_viewport_rect,
100 gfx::Rect device_clip_rect, 100 const gfx::Rect& device_clip_rect,
101 bool allow_partial_swap, 101 bool allow_partial_swap,
102 bool disable_picture_quad_image_filtering) { 102 bool disable_picture_quad_image_filtering) {
103 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); 103 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame");
104 104
105 DCHECK(!delegated_frame_data_); 105 DCHECK(!delegated_frame_data_);
106 106
107 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); 107 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData);
108 DelegatedFrameData& out_data = *delegated_frame_data_; 108 DelegatedFrameData& out_data = *delegated_frame_data_;
109 // Move the render passes and resources into the |out_frame|. 109 // Move the render passes and resources into the |out_frame|.
110 out_data.render_pass_list.swap(*render_passes_in_draw_order); 110 out_data.render_pass_list.swap(*render_passes_in_draw_order);
(...skipping 11 matching lines...) Expand all
122 } 122 }
123 123
124 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { 124 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) {
125 TRACE_EVENT0("cc", "DelegatingRenderer::SwapBuffers"); 125 TRACE_EVENT0("cc", "DelegatingRenderer::SwapBuffers");
126 CompositorFrame compositor_frame; 126 CompositorFrame compositor_frame;
127 compositor_frame.metadata = metadata; 127 compositor_frame.metadata = metadata;
128 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); 128 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass();
129 output_surface_->SwapBuffers(&compositor_frame); 129 output_surface_->SwapBuffers(&compositor_frame);
130 } 130 }
131 131
132 void DelegatingRenderer::GetFramebufferPixels(void* pixels, gfx::Rect rect) { 132 void DelegatingRenderer::GetFramebufferPixels(void* pixels,
133 const gfx::Rect& rect) {
133 NOTREACHED(); 134 NOTREACHED();
134 } 135 }
135 136
136 void DelegatingRenderer::ReceiveSwapBuffersAck( 137 void DelegatingRenderer::ReceiveSwapBuffersAck(
137 const CompositorFrameAck& ack) { 138 const CompositorFrameAck& ack) {
138 resource_provider_->ReceiveReturnsFromParent(ack.resources); 139 resource_provider_->ReceiveReturnsFromParent(ack.resources);
139 } 140 }
140 141
141 bool DelegatingRenderer::IsContextLost() { 142 bool DelegatingRenderer::IsContextLost() {
142 ContextProvider* context_provider = output_surface_->context_provider(); 143 ContextProvider* context_provider = output_surface_->context_provider();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 gpu::ManagedMemoryStats stats; 177 gpu::ManagedMemoryStats stats;
177 stats.bytes_required = bytes_visible; 178 stats.bytes_required = bytes_visible;
178 stats.bytes_nice_to_have = bytes_visible_and_nearby; 179 stats.bytes_nice_to_have = bytes_visible_and_nearby;
179 stats.bytes_allocated = bytes_allocated; 180 stats.bytes_allocated = bytes_allocated;
180 stats.backbuffer_requested = false; 181 stats.backbuffer_requested = false;
181 182
182 context_provider->ContextSupport()->SendManagedMemoryStats(stats); 183 context_provider->ContextSupport()->SendManagedMemoryStats(stats);
183 } 184 }
184 185
185 } // namespace cc 186 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/delegating_renderer.h ('k') | cc/output/direct_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698