OLD | NEW |
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 base::Bind(&OutputSurface::OnSwapBuffersComplete, | 251 base::Bind(&OutputSurface::OnSwapBuffersComplete, |
252 weak_ptr_factory_.GetWeakPtr())); | 252 weak_ptr_factory_.GetWeakPtr())); |
253 } | 253 } |
254 | 254 |
255 // We don't post tasks bound to the client directly since they might run | 255 // We don't post tasks bound to the client directly since they might run |
256 // after the OutputSurface has been destroyed. | 256 // after the OutputSurface has been destroyed. |
257 void OutputSurface::OnSwapBuffersComplete() { | 257 void OutputSurface::OnSwapBuffersComplete() { |
258 client_->DidSwapBuffersComplete(); | 258 client_->DidSwapBuffersComplete(); |
259 } | 259 } |
260 | 260 |
| 261 void OutputSurface::BeginFrame(const BeginFrameArgs& args) const { |
| 262 DCHECK(HasClient()); |
| 263 client_->BeginFrame(args); |
| 264 } |
| 265 |
261 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 266 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
262 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 267 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
263 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 268 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
264 // Just ignore the memory manager when it says to set the limit to zero | 269 // Just ignore the memory manager when it says to set the limit to zero |
265 // bytes. This will happen when the memory manager thinks that the renderer | 270 // bytes. This will happen when the memory manager thinks that the renderer |
266 // is not visible (which the renderer knows better). | 271 // is not visible (which the renderer knows better). |
267 if (policy.bytes_limit_when_visible) | 272 if (policy.bytes_limit_when_visible) |
268 client_->SetMemoryPolicy(policy); | 273 client_->SetMemoryPolicy(policy); |
269 } | 274 } |
270 | 275 |
271 } // namespace cc | 276 } // namespace cc |
OLD | NEW |