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

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

Issue 2275203002: Make command buffer commands and immediate data volatile (Closed)
Patch Set: std::copy->const_cast+memcpy Created 4 years, 3 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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // This file contains the GLES2DecoderPassthroughImpl class. 5 // This file contains the GLES2DecoderPassthroughImpl class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_
8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 14 matching lines...) Expand all
25 namespace gles2 { 25 namespace gles2 {
26 26
27 class ContextGroup; 27 class ContextGroup;
28 28
29 class GLES2DecoderPassthroughImpl : public GLES2Decoder { 29 class GLES2DecoderPassthroughImpl : public GLES2Decoder {
30 public: 30 public:
31 explicit GLES2DecoderPassthroughImpl(ContextGroup* group); 31 explicit GLES2DecoderPassthroughImpl(ContextGroup* group);
32 ~GLES2DecoderPassthroughImpl() override; 32 ~GLES2DecoderPassthroughImpl() override;
33 33
34 Error DoCommands(unsigned int num_commands, 34 Error DoCommands(unsigned int num_commands,
35 const void* buffer, 35 const volatile void* buffer,
36 int num_entries, 36 int num_entries,
37 int* entries_processed) override; 37 int* entries_processed) override;
38 38
39 const char* GetCommandName(unsigned int command_id) const override; 39 const char* GetCommandName(unsigned int command_id) const override;
40 40
41 bool Initialize(const scoped_refptr<gl::GLSurface>& surface, 41 bool Initialize(const scoped_refptr<gl::GLSurface>& surface,
42 const scoped_refptr<gl::GLContext>& context, 42 const scoped_refptr<gl::GLContext>& context,
43 bool offscreen, 43 bool offscreen,
44 const DisallowedFeatures& disallowed_features, 44 const DisallowedFeatures& disallowed_features,
45 const ContextCreationAttribHelper& attrib_helper) override; 45 const ContextCreationAttribHelper& attrib_helper) override;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 const ContextState* GetContextState() override; 210 const ContextState* GetContextState() override;
211 scoped_refptr<ShaderTranslatorInterface> GetTranslator(GLenum type) override; 211 scoped_refptr<ShaderTranslatorInterface> GetTranslator(GLenum type) override;
212 212
213 private: 213 private:
214 int commands_to_process_; 214 int commands_to_process_;
215 215
216 DebugMarkerManager debug_marker_manager_; 216 DebugMarkerManager debug_marker_manager_;
217 Logger logger_; 217 Logger logger_;
218 218
219 #define GLES2_CMD_OP(name) \ 219 #define GLES2_CMD_OP(name) \
220 Error Handle##name(uint32_t immediate_data_size, const void* data); 220 Error Handle##name(uint32_t immediate_data_size, const volatile void* data);
221 221
222 GLES2_COMMAND_LIST(GLES2_CMD_OP) 222 GLES2_COMMAND_LIST(GLES2_CMD_OP)
223 #undef GLES2_CMD_OP 223 #undef GLES2_CMD_OP
224 224
225 using CmdHandler = 225 using CmdHandler =
226 Error (GLES2DecoderPassthroughImpl::*)(uint32_t immediate_data_size, 226 Error (GLES2DecoderPassthroughImpl::*)(uint32_t immediate_data_size,
227 const void* data); 227 const volatile void* data);
228 228
229 // A struct to hold info about each command. 229 // A struct to hold info about each command.
230 struct CommandInfo { 230 struct CommandInfo {
231 CmdHandler cmd_handler; 231 CmdHandler cmd_handler;
232 uint8_t arg_flags; // How to handle the arguments for this scommand 232 uint8_t arg_flags; // How to handle the arguments for this scommand
233 uint8_t cmd_flags; // How to handle this command 233 uint8_t cmd_flags; // How to handle this command
234 uint16_t arg_count; // How many arguments are expected for this command. 234 uint16_t arg_count; // How many arguments are expected for this command.
235 }; 235 };
236 236
237 // A table of CommandInfo for all the commands. 237 // A table of CommandInfo for all the commands.
(...skipping 12 matching lines...) Expand all
250 250
251 // Include the prototypes of all the doer functions from a separate header to 251 // Include the prototypes of all the doer functions from a separate header to
252 // keep this file clean. 252 // keep this file clean.
253 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototyp es.h" 253 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototyp es.h"
254 }; 254 };
255 255
256 } // namespace gles2 256 } // namespace gles2
257 } // namespace gpu 257 } // namespace gpu
258 258
259 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_ 259 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_mock.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698