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> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class GrContext* GrContext() override; | 51 class GrContext* GrContext() override; |
52 void InvalidateGrContext(uint32_t state) override; | 52 void InvalidateGrContext(uint32_t state) override; |
53 gpu::Capabilities ContextCapabilities() override; | 53 gpu::Capabilities ContextCapabilities() override; |
54 void DeleteCachedResources() override {} | 54 void DeleteCachedResources() override {} |
55 void SetLostContextCallback( | 55 void SetLostContextCallback( |
56 const LostContextCallback& lost_context_callback) override; | 56 const LostContextCallback& lost_context_callback) override; |
57 base::Lock* GetLock() override; | 57 base::Lock* GetLock() override; |
58 | 58 |
59 // SurfacesContextProvider API. | 59 // SurfacesContextProvider API. |
60 void SetSwapBuffersCompletionCallback( | 60 void SetSwapBuffersCompletionCallback( |
61 gfx::GLSurface::SwapCompletionCallback callback); | 61 gl::GLSurface::SwapCompletionCallback callback); |
62 | 62 |
63 protected: | 63 protected: |
64 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; | 64 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; |
65 ~SurfacesContextProvider() override; | 65 ~SurfacesContextProvider() override; |
66 | 66 |
67 private: | 67 private: |
68 // CommandBufferLocalClient: | 68 // CommandBufferLocalClient: |
69 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; | 69 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; |
70 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; | 70 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; |
71 | 71 |
72 // From GLES2Context: | 72 // From GLES2Context: |
73 // Initialized in BindToCurrentThread. | 73 // Initialized in BindToCurrentThread. |
74 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 74 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
75 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 75 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
76 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 76 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
77 | 77 |
78 gpu::Capabilities capabilities_; | 78 gpu::Capabilities capabilities_; |
79 LostContextCallback lost_context_callback_; | 79 LostContextCallback lost_context_callback_; |
80 | 80 |
81 SurfacesContextProviderDelegate* delegate_; | 81 SurfacesContextProviderDelegate* delegate_; |
82 gfx::AcceleratedWidget widget_; | 82 gfx::AcceleratedWidget widget_; |
83 CommandBufferLocal* command_buffer_local_; | 83 CommandBufferLocal* command_buffer_local_; |
84 | 84 |
85 gfx::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 85 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 87 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
88 }; | 88 }; |
89 | 89 |
90 } // namespace mus | 90 } // namespace mus |
91 | 91 |
92 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 92 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
OLD | NEW |