| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "blimp/client/feature/compositor/blimp_output_surface.h" | 5 #include "blimp/client/feature/compositor/blimp_output_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "blimp/client/feature/compositor/blimp_context_provider.h" |
| 9 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
| 10 #include "gpu/command_buffer/client/context_support.h" | 11 #include "gpu/command_buffer/client/context_support.h" |
| 11 | 12 |
| 12 namespace blimp { | 13 namespace blimp { |
| 13 namespace client { | 14 namespace client { |
| 14 | 15 |
| 15 BlimpOutputSurface::BlimpOutputSurface( | 16 BlimpOutputSurface::BlimpOutputSurface( |
| 16 scoped_refptr<cc::ContextProvider> context_provider) | 17 scoped_refptr<BlimpContextProvider> context_provider) |
| 17 : cc::OutputSurface(std::move(context_provider), nullptr, nullptr) {} | 18 : cc::OutputSurface(std::move(context_provider), nullptr, nullptr) {} |
| 18 | 19 |
| 19 BlimpOutputSurface::~BlimpOutputSurface() {} | 20 BlimpOutputSurface::~BlimpOutputSurface() {} |
| 20 | 21 |
| 21 void BlimpOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { | 22 void BlimpOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { |
| 22 // See cc::OutputSurface::SwapBuffers() comment for details. | 23 // See cc::OutputSurface::SwapBuffers() comment for details. |
| 23 context_provider_->ContextSupport()->Swap(); | 24 context_provider_->ContextSupport()->Swap(); |
| 24 client_->DidSwapBuffers(); | 25 client_->DidSwapBuffers(); |
| 25 cc::OutputSurface::PostSwapBuffersComplete(); | 26 cc::OutputSurface::PostSwapBuffersComplete(); |
| 26 } | 27 } |
| 27 | 28 |
| 29 uint32_t BlimpOutputSurface::GetFramebufferCopyTextureFormat() { |
| 30 auto* gl = static_cast<BlimpContextProvider*>(context_provider()); |
| 31 return gl->GetCopyTextureInternalFormat(); |
| 32 } |
| 33 |
| 28 } // namespace client | 34 } // namespace client |
| 29 } // namespace blimp | 35 } // namespace blimp |
| OLD | NEW |