Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: gpu/command_buffer/service/context_group.h

Issue 2061743004: Implement native GMB backbuffers in the GLES2 Command Decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from piman. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/containers/hash_tables.h" 13 #include "base/containers/hash_tables.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "gpu/command_buffer/common/constants.h" 17 #include "gpu/command_buffer/common/constants.h"
18 #include "gpu/command_buffer/common/gles2_cmd_format.h" 18 #include "gpu/command_buffer/common/gles2_cmd_format.h"
19 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 19 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
20 #include "gpu/command_buffer/service/feature_info.h" 20 #include "gpu/command_buffer/service/feature_info.h"
21 #include "gpu/command_buffer/service/framebuffer_completeness_cache.h" 21 #include "gpu/command_buffer/service/framebuffer_completeness_cache.h"
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/gpu_export.h" 24 #include "gpu/gpu_export.h"
25 25
26 namespace gpu { 26 namespace gpu {
27 27
28 class ImageFactory;
28 struct GpuPreferences; 29 struct GpuPreferences;
29 class TransferBufferManager; 30 class TransferBufferManager;
30 31
31 namespace gles2 { 32 namespace gles2 {
32 33
33 class ProgramCache; 34 class ProgramCache;
34 class BufferManager; 35 class BufferManager;
35 class GLES2Decoder; 36 class GLES2Decoder;
36 class FramebufferManager; 37 class FramebufferManager;
37 class MailboxManager; 38 class MailboxManager;
(...skipping 11 matching lines...) Expand all
49 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { 50 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
50 public: 51 public:
51 ContextGroup( 52 ContextGroup(
52 const GpuPreferences& gpu_preferences, 53 const GpuPreferences& gpu_preferences,
53 const scoped_refptr<MailboxManager>& mailbox_manager, 54 const scoped_refptr<MailboxManager>& mailbox_manager,
54 const scoped_refptr<MemoryTracker>& memory_tracker, 55 const scoped_refptr<MemoryTracker>& memory_tracker,
55 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, 56 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache,
56 const scoped_refptr<FramebufferCompletenessCache>& 57 const scoped_refptr<FramebufferCompletenessCache>&
57 framebuffer_completeness_cache, 58 framebuffer_completeness_cache,
58 const scoped_refptr<FeatureInfo>& feature_info, 59 const scoped_refptr<FeatureInfo>& feature_info,
59 bool bind_generates_resource); 60 bool bind_generates_resource,
61 gpu::ImageFactory* image_factory);
60 62
61 // This should only be called by GLES2Decoder. This must be paired with a 63 // This should only be called by GLES2Decoder. This must be paired with a
62 // call to destroy if it succeeds. 64 // call to destroy if it succeeds.
63 bool Initialize( 65 bool Initialize(
64 GLES2Decoder* decoder, 66 GLES2Decoder* decoder,
65 ContextType context_type, 67 ContextType context_type,
66 const DisallowedFeatures& disallowed_features); 68 const DisallowedFeatures& disallowed_features);
67 69
68 // Destroys all the resources when called for the last context in the group. 70 // Destroys all the resources when called for the last context in the group.
69 // It should only be called by GLES2Decoder. 71 // It should only be called by GLES2Decoder.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 140 }
139 141
140 uint32_t uniform_buffer_offset_alignment() const { 142 uint32_t uniform_buffer_offset_alignment() const {
141 return uniform_buffer_offset_alignment_; 143 return uniform_buffer_offset_alignment_;
142 } 144 }
143 145
144 FeatureInfo* feature_info() { 146 FeatureInfo* feature_info() {
145 return feature_info_.get(); 147 return feature_info_.get();
146 } 148 }
147 149
150 gpu::ImageFactory* image_factory() { return image_factory_; }
151
148 const GpuPreferences& gpu_preferences() const { 152 const GpuPreferences& gpu_preferences() const {
149 return gpu_preferences_; 153 return gpu_preferences_;
150 } 154 }
151 155
152 BufferManager* buffer_manager() const { 156 BufferManager* buffer_manager() const {
153 return buffer_manager_.get(); 157 return buffer_manager_.get();
154 } 158 }
155 159
156 FramebufferManager* framebuffer_manager() const { 160 FramebufferManager* framebuffer_manager() const {
157 return framebuffer_manager_.get(); 161 return framebuffer_manager_.get();
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 std::unique_ptr<PathManager> path_manager_; 273 std::unique_ptr<PathManager> path_manager_;
270 274
271 std::unique_ptr<ProgramManager> program_manager_; 275 std::unique_ptr<ProgramManager> program_manager_;
272 276
273 std::unique_ptr<ShaderManager> shader_manager_; 277 std::unique_ptr<ShaderManager> shader_manager_;
274 278
275 std::unique_ptr<SamplerManager> sampler_manager_; 279 std::unique_ptr<SamplerManager> sampler_manager_;
276 280
277 scoped_refptr<FeatureInfo> feature_info_; 281 scoped_refptr<FeatureInfo> feature_info_;
278 282
283 gpu::ImageFactory* image_factory_;
284
279 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; 285 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_;
280 286
281 // Mappings from client side IDs to service side IDs. 287 // Mappings from client side IDs to service side IDs.
282 base::hash_map<GLuint, GLsync> syncs_id_map_; 288 base::hash_map<GLuint, GLsync> syncs_id_map_;
283 289
284 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 290 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
285 }; 291 };
286 292
287 } // namespace gles2 293 } // namespace gles2
288 } // namespace gpu 294 } // namespace gpu
289 295
290 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 296 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698