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/feature/compositor/blimp_output_surface.h" | |
6 | |
7 #include "base/bind.h" | |
8 #include "base/message_loop/message_loop.h" | |
9 #include "blimp/client/feature/compositor/blimp_context_provider.h" | |
10 #include "cc/output/compositor_frame.h" | |
11 #include "cc/output/output_surface_client.h" | |
12 #include "gpu/command_buffer/client/context_support.h" | |
13 | |
14 namespace blimp { | |
15 namespace client { | |
16 | |
17 BlimpOutputSurface::BlimpOutputSurface( | |
18 scoped_refptr<BlimpContextProvider> context_provider) | |
19 : cc::OutputSurface(std::move(context_provider), nullptr, nullptr) {} | |
20 | |
21 BlimpOutputSurface::~BlimpOutputSurface() {} | |
22 | |
23 void BlimpOutputSurface::SwapBuffers(cc::CompositorFrame frame) { | |
24 // See cc::OutputSurface::SwapBuffers() comment for details. | |
25 context_provider_->ContextSupport()->Swap(); | |
26 cc::OutputSurface::PostSwapBuffersComplete(); | |
27 } | |
28 | |
29 uint32_t BlimpOutputSurface::GetFramebufferCopyTextureFormat() { | |
30 auto* gl = static_cast<BlimpContextProvider*>(context_provider()); | |
31 return gl->GetCopyTextureInternalFormat(); | |
32 } | |
33 | |
34 } // namespace client | |
35 } // namespace blimp | |
OLD | NEW |