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

Unified Diff: blimp/client/compositor/blimp_output_surface.cc

Issue 1295243003: Initial commit of the blimp/ folder and target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
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

Powered by Google App Engine
This is Rietveld 408576698