Index: blimp/client/compositor/blimp_output_surface.cc |
diff --git a/blimp/client/compositor/blimp_output_surface.cc b/blimp/client/compositor/blimp_output_surface.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9fdd69a672be2c46efe0235ab2f183f8450153ca |
--- /dev/null |
+++ b/blimp/client/compositor/blimp_output_surface.cc |
@@ -0,0 +1,31 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "blimp/client/compositor/blimp_output_surface.h" |
+ |
+#include "base/bind.h" |
+#include "base/message_loop/message_loop.h" |
+#include "cc/output/output_surface_client.h" |
+#include "gpu/command_buffer/client/context_support.h" |
+ |
+namespace blimp { |
+ |
+BlimpOutputSurface::BlimpOutputSurface( |
+ const scoped_refptr<cc::ContextProvider>& context_provider) |
+ : cc::OutputSurface(context_provider), weak_factory_(this) { |
+ capabilities_.max_frames_pending = 2; |
+} |
+ |
+BlimpOutputSurface::~BlimpOutputSurface() {} |
+ |
+void BlimpOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { |
+ context_provider_->ContextSupport()->Swap(); |
+ client_->DidSwapBuffers(); |
Wez
2015/08/27 18:23:55
nit: Comment to clarify what these calls are actua
David Trainor- moved to gerrit
2015/08/28 01:23:47
The comment on the interface is pretty clear about
|
+ |
+ base::MessageLoop::current()->task_runner()->PostTask( |
Wez
2015/08/27 18:23:55
nit: Add a comment to indicate why we need to Post
David Trainor- moved to gerrit
2015/08/28 01:23:47
It's the advice I got when discussing how to imple
|
+ FROM_HERE, base::Bind(&BlimpOutputSurface::OnSwapBuffersComplete, |
+ weak_factory_.GetWeakPtr())); |
+} |
+ |
+} // namespace blimp |