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

Unified Diff: cc/test/fake_output_surface.cc

Issue 577643002: Making OutputSurface a begin frame source and vsync source. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/fake_output_surface_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_output_surface.cc
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 9c027eae60e99a14983618d636bbb3dbe7e6981f..95afacac0aca21dde929f9f9edb241f1ba8d129e 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -82,11 +82,16 @@ void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) {
}
}
-void FakeOutputSurface::SetNeedsBeginFrame(bool enable) {
- needs_begin_frame_ = enable;
- OutputSurface::SetNeedsBeginFrame(enable);
+void FakeOutputSurface::SetNeedsBeginFrames(bool enable) {
+ OutputSurface::SetNeedsBeginFrames(enable);
+ if (enable)
+ OnBeginFrame();
+}
+
+void FakeOutputSurface::OnBeginFrame() {
+ if (NeedsBeginFrames()) {
+ SendBeginFrame(CreateBeginFrameArgsForTesting());
- if (enable) {
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&FakeOutputSurface::OnBeginFrame,
@@ -95,11 +100,10 @@ void FakeOutputSurface::SetNeedsBeginFrame(bool enable) {
}
}
-void FakeOutputSurface::OnBeginFrame() {
- client_->BeginFrame(CreateBeginFrameArgsForTesting());
+void FakeOutputSurface::AsValueInto(base::debug::TracedValue* dict) const {
+ dict->SetString("type", "FakeOutputSurface");
}
-
bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) {
if (OutputSurface::BindToClient(client)) {
client_ = client;
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/fake_output_surface_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698