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 "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void SetSwapBuffersCompletionCallback( | 60 void SetSwapBuffersCompletionCallback( |
61 gfx::GLSurface::SwapCompletionCallback callback); | 61 gfx::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 DidLoseContext() override; | |
71 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; | 70 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; |
72 | 71 |
73 // From GLES2Context: | 72 // From GLES2Context: |
74 // Initialized in BindToCurrentThread. | 73 // Initialized in BindToCurrentThread. |
75 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 74 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
76 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; | 75 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; |
77 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_; | 76 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_; |
78 | 77 |
79 cc::ContextProvider::Capabilities capabilities_; | 78 cc::ContextProvider::Capabilities capabilities_; |
80 LostContextCallback lost_context_callback_; | 79 LostContextCallback lost_context_callback_; |
81 | 80 |
82 SurfacesContextProviderDelegate* delegate_; | 81 SurfacesContextProviderDelegate* delegate_; |
83 gfx::AcceleratedWidget widget_; | 82 gfx::AcceleratedWidget widget_; |
84 CommandBufferLocal* command_buffer_local_; | 83 CommandBufferLocal* command_buffer_local_; |
85 | 84 |
86 gfx::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 85 gfx::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
87 | 86 |
88 base::Lock context_lock_; | 87 base::Lock context_lock_; |
89 | 88 |
90 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 89 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
91 }; | 90 }; |
92 | 91 |
93 } // namespace mus | 92 } // namespace mus |
94 | 93 |
95 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 94 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
OLD | NEW |