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

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

Issue 548153004: Unified BeginFrame scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 6 years, 3 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/scheduler/scheduler.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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 base::Bind(&OutputSurface::OnSwapBuffersComplete, 253 base::Bind(&OutputSurface::OnSwapBuffersComplete,
254 weak_ptr_factory_.GetWeakPtr())); 254 weak_ptr_factory_.GetWeakPtr()));
255 } 255 }
256 256
257 // We don't post tasks bound to the client directly since they might run 257 // We don't post tasks bound to the client directly since they might run
258 // after the OutputSurface has been destroyed. 258 // after the OutputSurface has been destroyed.
259 void OutputSurface::OnSwapBuffersComplete() { 259 void OutputSurface::OnSwapBuffersComplete() {
260 client_->DidSwapBuffersComplete(); 260 client_->DidSwapBuffersComplete();
261 } 261 }
262 262
263 void OutputSurface::BeginFrame(const BeginFrameArgs& args) const {
264 DCHECK(HasClient());
265 client_->BeginFrame(args);
266 }
267
263 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 268 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
264 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", 269 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy",
265 "bytes_limit_when_visible", policy.bytes_limit_when_visible); 270 "bytes_limit_when_visible", policy.bytes_limit_when_visible);
266 // Just ignore the memory manager when it says to set the limit to zero 271 // Just ignore the memory manager when it says to set the limit to zero
267 // bytes. This will happen when the memory manager thinks that the renderer 272 // bytes. This will happen when the memory manager thinks that the renderer
268 // is not visible (which the renderer knows better). 273 // is not visible (which the renderer knows better).
269 if (policy.bytes_limit_when_visible) 274 if (policy.bytes_limit_when_visible)
270 client_->SetMemoryPolicy(policy); 275 client_->SetMemoryPolicy(policy);
271 } 276 }
272 277
273 } // namespace cc 278 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698