| 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/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool SurfaceIsSuspendForRecycle() const override { return false; } | 81 bool SurfaceIsSuspendForRecycle() const override { return false; } |
| 82 uint32_t GetFramebufferCopyTextureFormat() override { | 82 uint32_t GetFramebufferCopyTextureFormat() override { |
| 83 // We assume we have an alpha channel from the BlimpContextProvider, so use | 83 // We assume we have an alpha channel from the BlimpContextProvider, so use |
| 84 // GL_RGBA here. | 84 // GL_RGBA here. |
| 85 return GL_RGBA; | 85 return GL_RGBA; |
| 86 } | 86 } |
| 87 bool HasExternalStencilTest() const override { return false; } | 87 bool HasExternalStencilTest() const override { return false; } |
| 88 void ApplyExternalStencil() override {} | 88 void ApplyExternalStencil() override {} |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 void SwapBuffersCallback() { client_->DidSwapBuffersComplete(); } | 91 void SwapBuffersCallback() { client_->DidReceiveSwapBuffersAck(); } |
| 92 | 92 |
| 93 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 93 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 94 base::WeakPtrFactory<DisplayOutputSurface> weak_ptr_factory_; | 94 base::WeakPtrFactory<DisplayOutputSurface> weak_ptr_factory_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(DisplayOutputSurface); | 96 DISALLOW_COPY_AND_ASSIGN(DisplayOutputSurface); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 base::LazyInstance<SimpleTaskGraphRunner> g_task_graph_runner = | 99 base::LazyInstance<SimpleTaskGraphRunner> g_task_graph_runner = |
| 100 LAZY_INSTANCE_INITIALIZER; | 100 LAZY_INSTANCE_INITIALIZER; |
| 101 | 101 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // The Browser compositor and display share the same context provider. | 220 // The Browser compositor and display share the same context provider. |
| 221 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( | 221 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( |
| 222 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), | 222 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), |
| 223 display_.get(), context_provider_, nullptr); | 223 display_.get(), context_provider_, nullptr); |
| 224 | 224 |
| 225 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 225 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace client | 228 } // namespace client |
| 229 } // namespace blimp | 229 } // namespace blimp |
| OLD | NEW |