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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 base::Bind(&OutputSurface::OnSwapBuffersComplete, | 349 base::Bind(&OutputSurface::OnSwapBuffersComplete, |
350 weak_ptr_factory_.GetWeakPtr())); | 350 weak_ptr_factory_.GetWeakPtr())); |
351 } | 351 } |
352 | 352 |
353 // We don't post tasks bound to the client directly since they might run | 353 // We don't post tasks bound to the client directly since they might run |
354 // after the OutputSurface has been destroyed. | 354 // after the OutputSurface has been destroyed. |
355 void OutputSurface::OnSwapBuffersComplete() { | 355 void OutputSurface::OnSwapBuffersComplete() { |
356 client_->DidSwapBuffersComplete(); | 356 client_->DidSwapBuffersComplete(); |
357 } | 357 } |
358 | 358 |
| 359 void OutputSurface::BeginFrame(const BeginFrameArgs& args) const { |
| 360 DCHECK(HasClient()); |
| 361 client_->BeginFrame(args); |
| 362 } |
| 363 |
359 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 364 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
360 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 365 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
361 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 366 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
362 // Just ignore the memory manager when it says to set the limit to zero | 367 // Just ignore the memory manager when it says to set the limit to zero |
363 // bytes. This will happen when the memory manager thinks that the renderer | 368 // bytes. This will happen when the memory manager thinks that the renderer |
364 // is not visible (which the renderer knows better). | 369 // is not visible (which the renderer knows better). |
365 if (policy.bytes_limit_when_visible) | 370 if (policy.bytes_limit_when_visible) |
366 client_->SetMemoryPolicy(policy); | 371 client_->SetMemoryPolicy(policy); |
367 } | 372 } |
368 | 373 |
369 } // namespace cc | 374 } // namespace cc |
OLD | NEW |