| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 5 #ifndef COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
| 6 #define COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 6 #define COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "cc/output/context_provider.h" | 14 #include "cc/output/context_provider.h" |
| 15 #include "components/mus/gles2/command_buffer_local_client.h" | 15 #include "components/mus/gles2/command_buffer_local_client.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
| 18 | 18 |
| 19 namespace gpu { | 19 namespace gpu { |
| 20 | 20 |
| 21 class CommandBufferProxyImpl; | 21 class CommandBufferProxyImpl; |
| 22 struct GpuProcessHostedCALayerTreeParamsMac; |
| 22 class TransferBuffer; | 23 class TransferBuffer; |
| 23 | 24 |
| 24 namespace gles2 { | 25 namespace gles2 { |
| 25 class GLES2CmdHelper; | 26 class GLES2CmdHelper; |
| 26 class GLES2Implementation; | 27 class GLES2Implementation; |
| 27 } | 28 } |
| 28 | 29 |
| 29 } // namespace gpu | 30 } // namespace gpu |
| 30 | 31 |
| 32 namespace ui { |
| 33 class LatencyInfo; |
| 34 } |
| 35 |
| 31 namespace mus { | 36 namespace mus { |
| 32 | 37 |
| 33 class CommandBufferDriver; | 38 class CommandBufferDriver; |
| 34 class CommandBufferImpl; | 39 class CommandBufferImpl; |
| 35 class CommandBufferLocal; | 40 class CommandBufferLocal; |
| 36 class GpuState; | 41 class GpuState; |
| 37 class SurfacesContextProviderDelegate; | 42 class SurfacesContextProviderDelegate; |
| 38 | 43 |
| 39 class SurfacesContextProvider : public cc::ContextProvider, | 44 class SurfacesContextProvider : public cc::ContextProvider, |
| 40 public CommandBufferLocalClient, | 45 public CommandBufferLocalClient, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 63 | 68 |
| 64 protected: | 69 protected: |
| 65 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; | 70 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; |
| 66 ~SurfacesContextProvider() override; | 71 ~SurfacesContextProvider() override; |
| 67 | 72 |
| 68 private: | 73 private: |
| 69 // CommandBufferLocalClient: | 74 // CommandBufferLocalClient: |
| 70 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; | 75 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; |
| 71 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; | 76 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; |
| 72 | 77 |
| 78 // Callbacks for CommandBufferProxyImpl: |
| 79 void OnGpuSwapBuffersCompleted( |
| 80 const std::vector<ui::LatencyInfo>& latency_info, |
| 81 gfx::SwapResult result, |
| 82 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); |
| 83 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
| 84 base::TimeDelta interval); |
| 85 |
| 73 bool use_chrome_gpu_command_buffer_; | 86 bool use_chrome_gpu_command_buffer_; |
| 74 | 87 |
| 75 // From GLES2Context: | 88 // From GLES2Context: |
| 76 // Initialized in BindToCurrentThread. | 89 // Initialized in BindToCurrentThread. |
| 77 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 90 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
| 78 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 91 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
| 79 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 92 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
| 80 | 93 |
| 81 gpu::Capabilities capabilities_; | 94 gpu::Capabilities capabilities_; |
| 82 LostContextCallback lost_context_callback_; | 95 LostContextCallback lost_context_callback_; |
| 83 | 96 |
| 84 SurfacesContextProviderDelegate* delegate_; | 97 SurfacesContextProviderDelegate* delegate_; |
| 85 gfx::AcceleratedWidget widget_; | 98 gfx::AcceleratedWidget widget_; |
| 86 CommandBufferLocal* command_buffer_local_; | 99 CommandBufferLocal* command_buffer_local_; |
| 87 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; | 100 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
| 88 | |
| 89 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 101 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
| 90 | 102 |
| 91 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 103 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
| 92 }; | 104 }; |
| 93 | 105 |
| 94 } // namespace mus | 106 } // namespace mus |
| 95 | 107 |
| 96 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 108 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
| OLD | NEW |