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 SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 5 #ifndef SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
6 #define SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 6 #define SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 public: | 43 public: |
44 explicit SurfacesContextProvider(gfx::AcceleratedWidget widget); | 44 explicit SurfacesContextProvider(gfx::AcceleratedWidget widget); |
45 | 45 |
46 void SetDelegate(SurfacesContextProviderDelegate* delegate); | 46 void SetDelegate(SurfacesContextProviderDelegate* delegate); |
47 | 47 |
48 // cc::ContextProvider implementation. | 48 // cc::ContextProvider implementation. |
49 bool BindToCurrentThread() override; | 49 bool BindToCurrentThread() override; |
50 gpu::gles2::GLES2Interface* ContextGL() override; | 50 gpu::gles2::GLES2Interface* ContextGL() override; |
51 gpu::ContextSupport* ContextSupport() override; | 51 gpu::ContextSupport* ContextSupport() override; |
52 class GrContext* GrContext() override; | 52 class GrContext* GrContext() override; |
53 cc::ContextCacheController* CacheController() override; | |
53 void InvalidateGrContext(uint32_t state) override; | 54 void InvalidateGrContext(uint32_t state) override; |
54 gpu::Capabilities ContextCapabilities() override; | 55 gpu::Capabilities ContextCapabilities() override; |
55 void DeleteCachedResources() override {} | |
56 void SetLostContextCallback( | 56 void SetLostContextCallback( |
57 const LostContextCallback& lost_context_callback) override; | 57 const LostContextCallback& lost_context_callback) override; |
58 base::Lock* GetLock() override; | 58 base::Lock* GetLock() override; |
59 | 59 |
60 // SurfacesContextProvider API. | 60 // SurfacesContextProvider API. |
61 void SetSwapBuffersCompletionCallback( | 61 void SetSwapBuffersCompletionCallback( |
62 gl::GLSurface::SwapCompletionCallback callback); | 62 gl::GLSurface::SwapCompletionCallback callback); |
63 | 63 |
64 protected: | 64 protected: |
65 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; | 65 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; |
66 ~SurfacesContextProvider() override; | 66 ~SurfacesContextProvider() override; |
67 | 67 |
68 private: | 68 private: |
69 // Callbacks for CommandBufferProxyImpl: | 69 // Callbacks for CommandBufferProxyImpl: |
70 void OnGpuSwapBuffersCompleted( | 70 void OnGpuSwapBuffersCompleted( |
71 const std::vector<ui::LatencyInfo>& latency_info, | 71 const std::vector<ui::LatencyInfo>& latency_info, |
72 gfx::SwapResult result, | 72 gfx::SwapResult result, |
73 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); | 73 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); |
74 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 74 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
75 base::TimeDelta interval); | 75 base::TimeDelta interval); |
76 | 76 |
77 // From GLES2Context: | 77 // From GLES2Context: |
78 // Initialized in BindToCurrentThread. | 78 // Initialized in BindToCurrentThread. |
79 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 79 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
80 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 80 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
81 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 81 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
82 | 82 |
danakj
2016/08/26 23:49:09
nit: no whitespace
ericrk
2016/08/29 22:43:23
Done.
| |
83 std::unique_ptr<cc::ContextCacheController> cache_controller_; | |
84 | |
83 gpu::Capabilities capabilities_; | 85 gpu::Capabilities capabilities_; |
84 LostContextCallback lost_context_callback_; | 86 LostContextCallback lost_context_callback_; |
85 | 87 |
86 SurfacesContextProviderDelegate* delegate_; | 88 SurfacesContextProviderDelegate* delegate_; |
87 gfx::AcceleratedWidget widget_; | 89 gfx::AcceleratedWidget widget_; |
88 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; | 90 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
89 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 91 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
90 | 92 |
91 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 93 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
92 }; | 94 }; |
93 | 95 |
94 } // namespace ui | 96 } // namespace ui |
95 | 97 |
96 #endif // SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 98 #endif // SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
OLD | NEW |