OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_ |
6 #define CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_ | 6 #define CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 26 matching lines...) Expand all Loading... |
37 : public NON_EXPORTED_BASE(ContextProvider) { | 37 : public NON_EXPORTED_BASE(ContextProvider) { |
38 public: | 38 public: |
39 InProcessContextProvider( | 39 InProcessContextProvider( |
40 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, | 40 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, |
41 gpu::SurfaceHandle widget, | 41 gpu::SurfaceHandle widget, |
42 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 42 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
43 gpu::ImageFactory* image_factory, | 43 gpu::ImageFactory* image_factory, |
44 const gpu::SharedMemoryLimits& limits, | 44 const gpu::SharedMemoryLimits& limits, |
45 InProcessContextProvider* shared_context); | 45 InProcessContextProvider* shared_context); |
46 | 46 |
| 47 // ContextProvider: |
47 bool BindToCurrentThread() override; | 48 bool BindToCurrentThread() override; |
48 gpu::gles2::GLES2Interface* ContextGL() override; | 49 gpu::gles2::GLES2Interface* ContextGL() override; |
49 gpu::ContextSupport* ContextSupport() override; | 50 gpu::ContextSupport* ContextSupport() override; |
50 class GrContext* GrContext() override; | 51 class GrContext* GrContext() override; |
51 ContextCacheController* CacheController() override; | 52 ContextCacheController* CacheController() override; |
52 void InvalidateGrContext(uint32_t state) override; | 53 void InvalidateGrContext(uint32_t state) override; |
53 base::Lock* GetLock() override; | 54 base::Lock* GetLock() override; |
54 gpu::Capabilities ContextCapabilities() override; | 55 gpu::Capabilities ContextCapabilities() override; |
55 void SetLostContextCallback( | 56 void SetLostContextCallback( |
56 const LostContextCallback& lost_context_callback) override; | 57 const LostContextCallback& lost_context_callback) override; |
57 | 58 |
58 uint32_t GetCopyTextureInternalFormat(); | 59 uint32_t GetCopyTextureInternalFormat(); |
59 | 60 |
60 void SetSwapBuffersCompletionCallback( | 61 void SetSwapBuffersCompletionCallback( |
61 const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback& | 62 const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback& |
62 callback); | 63 callback); |
63 | 64 |
64 void SetUpdateVSyncParametersCallback( | 65 void SetUpdateVSyncParametersCallback( |
65 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& | 66 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& |
66 callback); | 67 callback); |
67 | 68 |
| 69 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); |
| 70 |
68 protected: | 71 protected: |
69 friend class base::RefCountedThreadSafe<InProcessContextProvider>; | 72 friend class base::RefCountedThreadSafe<InProcessContextProvider>; |
70 ~InProcessContextProvider() override; | 73 ~InProcessContextProvider() override; |
71 | 74 |
72 private: | 75 private: |
73 const gpu::gles2::ContextCreationAttribHelper attributes_; | 76 const gpu::gles2::ContextCreationAttribHelper attributes_; |
74 | 77 |
75 base::Lock context_lock_; | 78 base::Lock context_lock_; |
76 std::unique_ptr<gpu::GLInProcessContext> context_; | 79 std::unique_ptr<gpu::GLInProcessContext> context_; |
77 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 80 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
78 std::unique_ptr<ContextCacheController> cache_controller_; | 81 std::unique_ptr<ContextCacheController> cache_controller_; |
79 }; | 82 }; |
80 | 83 |
81 } // namespace cc | 84 } // namespace cc |
82 | 85 |
83 #endif // CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_ | 86 #endif // CC_OUTPUT_IN_PROCESS_CONTEXT_PROVIDER_H_ |
OLD | NEW |