OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "blimp/client/compositor/blimp_output_surface.h" | |
6 | |
7 #include "base/bind.h" | |
8 #include "base/message_loop/message_loop.h" | |
9 #include "cc/output/output_surface_client.h" | |
10 #include "gpu/command_buffer/client/context_support.h" | |
11 | |
12 namespace blimp { | |
13 | |
14 BlimpOutputSurface::BlimpOutputSurface( | |
15 const scoped_refptr<cc::ContextProvider>& context_provider) | |
16 : cc::OutputSurface(context_provider), weak_factory_(this) { | |
17 capabilities_.max_frames_pending = 2; | |
18 } | |
19 | |
20 BlimpOutputSurface::~BlimpOutputSurface() {} | |
21 | |
22 void BlimpOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { | |
23 context_provider_->ContextSupport()->Swap(); | |
24 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
| |
25 | |
26 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
| |
27 FROM_HERE, base::Bind(&BlimpOutputSurface::OnSwapBuffersComplete, | |
28 weak_factory_.GetWeakPtr())); | |
29 } | |
30 | |
31 } // namespace blimp | |
OLD | NEW |