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