OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "gpu/command_buffer/service/gpu_preferences.h" | 22 #include "gpu/command_buffer/service/gpu_preferences.h" |
23 #include "gpu/command_buffer/service/shader_translator_cache.h" | 23 #include "gpu/command_buffer/service/shader_translator_cache.h" |
24 #include "gpu/config/gpu_feature_info.h" | 24 #include "gpu/config/gpu_feature_info.h" |
25 #include "gpu/gpu_export.h" | 25 #include "gpu/gpu_export.h" |
26 | 26 |
27 namespace gpu { | 27 namespace gpu { |
28 | 28 |
29 class ImageFactory; | 29 class ImageFactory; |
30 struct GpuPreferences; | 30 struct GpuPreferences; |
31 class TransferBufferManager; | 31 class TransferBufferManager; |
| 32 class ServiceDiscardableManager; |
32 | 33 |
33 namespace gles2 { | 34 namespace gles2 { |
34 | 35 |
35 class ProgramCache; | 36 class ProgramCache; |
36 class BufferManager; | 37 class BufferManager; |
37 class GLES2Decoder; | 38 class GLES2Decoder; |
38 class FramebufferManager; | 39 class FramebufferManager; |
39 class MailboxManager; | 40 class MailboxManager; |
40 class RenderbufferManager; | 41 class RenderbufferManager; |
41 class PathManager; | 42 class PathManager; |
(...skipping 18 matching lines...) Expand all Loading... |
60 const GpuPreferences& gpu_preferences, | 61 const GpuPreferences& gpu_preferences, |
61 const scoped_refptr<MailboxManager>& mailbox_manager, | 62 const scoped_refptr<MailboxManager>& mailbox_manager, |
62 const scoped_refptr<MemoryTracker>& memory_tracker, | 63 const scoped_refptr<MemoryTracker>& memory_tracker, |
63 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, | 64 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, |
64 const scoped_refptr<FramebufferCompletenessCache>& | 65 const scoped_refptr<FramebufferCompletenessCache>& |
65 framebuffer_completeness_cache, | 66 framebuffer_completeness_cache, |
66 const scoped_refptr<FeatureInfo>& feature_info, | 67 const scoped_refptr<FeatureInfo>& feature_info, |
67 bool bind_generates_resource, | 68 bool bind_generates_resource, |
68 gpu::ImageFactory* image_factory, | 69 gpu::ImageFactory* image_factory, |
69 ProgressReporter* progress_reporter, | 70 ProgressReporter* progress_reporter, |
70 const GpuFeatureInfo& gpu_feature_info); | 71 const GpuFeatureInfo& gpu_feature_info, |
| 72 const scoped_refptr<ServiceDiscardableManager>& discardable_manager); |
71 | 73 |
72 // This should only be called by GLES2Decoder. This must be paired with a | 74 // This should only be called by GLES2Decoder. This must be paired with a |
73 // call to destroy if it succeeds. | 75 // call to destroy if it succeeds. |
74 bool Initialize( | 76 bool Initialize( |
75 GLES2Decoder* decoder, | 77 GLES2Decoder* decoder, |
76 ContextType context_type, | 78 ContextType context_type, |
77 const DisallowedFeatures& disallowed_features); | 79 const DisallowedFeatures& disallowed_features); |
78 | 80 |
79 // Destroys all the resources when called for the last context in the group. | 81 // Destroys all the resources when called for the last context in the group. |
80 // It should only be called by GLES2Decoder. | 82 // It should only be called by GLES2Decoder. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 199 } |
198 | 200 |
199 TransferBufferManager* transfer_buffer_manager() const { | 201 TransferBufferManager* transfer_buffer_manager() const { |
200 return transfer_buffer_manager_.get(); | 202 return transfer_buffer_manager_.get(); |
201 } | 203 } |
202 | 204 |
203 SamplerManager* sampler_manager() const { | 205 SamplerManager* sampler_manager() const { |
204 return sampler_manager_.get(); | 206 return sampler_manager_.get(); |
205 } | 207 } |
206 | 208 |
| 209 ServiceDiscardableManager* discardable_manager() const { |
| 210 return discardable_manager_.get(); |
| 211 } |
| 212 |
207 uint32_t GetMemRepresented() const; | 213 uint32_t GetMemRepresented() const; |
208 | 214 |
209 // Loses all the context associated with this group. | 215 // Loses all the context associated with this group. |
210 void LoseContexts(error::ContextLostReason reason); | 216 void LoseContexts(error::ContextLostReason reason); |
211 | 217 |
212 bool GetBufferServiceId(GLuint client_id, GLuint* service_id) const; | 218 bool GetBufferServiceId(GLuint client_id, GLuint* service_id) const; |
213 | 219 |
214 void AddSyncId(GLuint client_id, GLsync service_id) { | 220 void AddSyncId(GLuint client_id, GLsync service_id) { |
215 syncs_id_map_[client_id] = service_id; | 221 syncs_id_map_[client_id] = service_id; |
216 } | 222 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 311 |
306 std::unique_ptr<PassthroughResources> passthrough_resources_; | 312 std::unique_ptr<PassthroughResources> passthrough_resources_; |
307 | 313 |
308 // Used to notify the watchdog thread of progress during destruction, | 314 // Used to notify the watchdog thread of progress during destruction, |
309 // preventing time-outs when destruction takes a long time. May be null when | 315 // preventing time-outs when destruction takes a long time. May be null when |
310 // using in-process command buffer. | 316 // using in-process command buffer. |
311 ProgressReporter* progress_reporter_; | 317 ProgressReporter* progress_reporter_; |
312 | 318 |
313 GpuFeatureInfo gpu_feature_info_; | 319 GpuFeatureInfo gpu_feature_info_; |
314 | 320 |
| 321 const scoped_refptr<ServiceDiscardableManager> discardable_manager_; |
| 322 |
315 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 323 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
316 }; | 324 }; |
317 | 325 |
318 } // namespace gles2 | 326 } // namespace gles2 |
319 } // namespace gpu | 327 } // namespace gpu |
320 | 328 |
321 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 329 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
OLD | NEW |