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

Side by Side Diff: cc/output/output_surface.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/output_surface.h ('k') | cc/output/output_surface_client.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/output_surface.h" 5 #include "cc/output/output_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void OutputSurface::FrameRateControllerTick(bool throttled, 129 void OutputSurface::FrameRateControllerTick(bool throttled,
130 const BeginFrameArgs& args) { 130 const BeginFrameArgs& args) {
131 DCHECK(frame_rate_controller_); 131 DCHECK(frame_rate_controller_);
132 if (throttled) 132 if (throttled)
133 skipped_begin_impl_frame_args_ = args; 133 skipped_begin_impl_frame_args_ = args;
134 else 134 else
135 BeginImplFrame(args); 135 BeginImplFrame(args);
136 } 136 }
137 137
138 // Forwarded to OutputSurfaceClient 138 // Forwarded to OutputSurfaceClient
139 void OutputSurface::SetNeedsRedrawRect(gfx::Rect damage_rect) { 139 void OutputSurface::SetNeedsRedrawRect(const gfx::Rect& damage_rect) {
140 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect"); 140 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect");
141 client_->SetNeedsRedrawRect(damage_rect); 141 client_->SetNeedsRedrawRect(damage_rect);
142 } 142 }
143 143
144 void OutputSurface::SetNeedsBeginImplFrame(bool enable) { 144 void OutputSurface::SetNeedsBeginImplFrame(bool enable) {
145 TRACE_EVENT1("cc", "OutputSurface::SetNeedsBeginImplFrame", "enable", enable); 145 TRACE_EVENT1("cc", "OutputSurface::SetNeedsBeginImplFrame", "enable", enable);
146 needs_begin_impl_frame_ = enable; 146 needs_begin_impl_frame_ = enable;
147 client_ready_for_begin_impl_frame_ = true; 147 client_ready_for_begin_impl_frame_ = true;
148 if (frame_rate_controller_) { 148 if (frame_rate_controller_) {
149 BeginFrameArgs skipped = frame_rate_controller_->SetActive(enable); 149 BeginFrameArgs skipped = frame_rate_controller_->SetActive(enable);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 pending_gpu_latency_query_ids_.clear(); 235 pending_gpu_latency_query_ids_.clear();
236 available_gpu_latency_query_ids_.clear(); 236 available_gpu_latency_query_ids_.clear();
237 client_->DidLoseOutputSurface(); 237 client_->DidLoseOutputSurface();
238 } 238 }
239 239
240 void OutputSurface::SetExternalStencilTest(bool enabled) { 240 void OutputSurface::SetExternalStencilTest(bool enabled) {
241 external_stencil_test_enabled_ = enabled; 241 external_stencil_test_enabled_ = enabled;
242 } 242 }
243 243
244 void OutputSurface::SetExternalDrawConstraints(const gfx::Transform& transform, 244 void OutputSurface::SetExternalDrawConstraints(const gfx::Transform& transform,
245 gfx::Rect viewport, 245 const gfx::Rect& viewport,
246 gfx::Rect clip, 246 const gfx::Rect& clip,
247 bool valid_for_tile_management) { 247 bool valid_for_tile_management) {
248 client_->SetExternalDrawConstraints( 248 client_->SetExternalDrawConstraints(
249 transform, viewport, clip, valid_for_tile_management); 249 transform, viewport, clip, valid_for_tile_management);
250 } 250 }
251 251
252 OutputSurface::~OutputSurface() { 252 OutputSurface::~OutputSurface() {
253 if (frame_rate_controller_) 253 if (frame_rate_controller_)
254 frame_rate_controller_->SetActive(false); 254 frame_rate_controller_->SetActive(false);
255 ResetContext3d(); 255 ResetContext3d();
256 } 256 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", 483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy",
484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); 484 "bytes_limit_when_visible", policy.bytes_limit_when_visible);
485 // Just ignore the memory manager when it says to set the limit to zero 485 // Just ignore the memory manager when it says to set the limit to zero
486 // bytes. This will happen when the memory manager thinks that the renderer 486 // bytes. This will happen when the memory manager thinks that the renderer
487 // is not visible (which the renderer knows better). 487 // is not visible (which the renderer knows better).
488 if (policy.bytes_limit_when_visible) 488 if (policy.bytes_limit_when_visible)
489 client_->SetMemoryPolicy(policy); 489 client_->SetMemoryPolicy(policy);
490 } 490 }
491 491
492 } // namespace cc 492 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/output/output_surface_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698