| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/support/compositor/blimp_embedder_compositor.h" | 5 #include "blimp/client/support/compositor/blimp_embedder_compositor.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void EnsureBackbuffer() override {} | 59 void EnsureBackbuffer() override {} |
| 60 void DiscardBackbuffer() override { | 60 void DiscardBackbuffer() override { |
| 61 context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); | 61 context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); |
| 62 } | 62 } |
| 63 void BindFramebuffer() override { | 63 void BindFramebuffer() override { |
| 64 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 64 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 65 } | 65 } |
| 66 void Reshape(const gfx::Size& size, | 66 void Reshape(const gfx::Size& size, |
| 67 float device_scale_factor, | 67 float device_scale_factor, |
| 68 const gfx::ColorSpace& color_space, | 68 const gfx::ColorSpace& color_space, |
| 69 bool has_alpha) override { | 69 bool has_alpha, |
| 70 bool use_stencil) override { |
| 70 context_provider()->ContextGL()->ResizeCHROMIUM( | 71 context_provider()->ContextGL()->ResizeCHROMIUM( |
| 71 size.width(), size.height(), device_scale_factor, has_alpha); | 72 size.width(), size.height(), device_scale_factor, has_alpha); |
| 72 } | 73 } |
| 73 void SwapBuffers(cc::OutputSurfaceFrame frame) override { | 74 void SwapBuffers(cc::OutputSurfaceFrame frame) override { |
| 74 context_provider_->ContextSupport()->Swap(); | 75 context_provider_->ContextSupport()->Swap(); |
| 75 // The ack for SwapBuffers must be run asynchronously, that will be | 76 // The ack for SwapBuffers must be run asynchronously, that will be |
| 76 // satisfied since we will go through a PostTask here. | 77 // satisfied since we will go through a PostTask here. |
| 77 task_runner_->PostTask( | 78 task_runner_->PostTask( |
| 78 FROM_HERE, base::Bind(&DisplayOutputSurface::SwapBuffersCallback, | 79 FROM_HERE, base::Bind(&DisplayOutputSurface::SwapBuffersCallback, |
| 79 weak_ptr_factory_.GetWeakPtr())); | 80 weak_ptr_factory_.GetWeakPtr())); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( | 230 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( |
| 230 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), | 231 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), |
| 231 display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, | 232 display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, |
| 232 shared_bitmap_manager); | 233 shared_bitmap_manager); |
| 233 | 234 |
| 234 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 235 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| 235 } | 236 } |
| 236 | 237 |
| 237 } // namespace client | 238 } // namespace client |
| 238 } // namespace blimp | 239 } // namespace blimp |
| OLD | NEW |