| 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_CLIENT_GLES2_CMD_HELPER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 11 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
| 12 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 12 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 13 #include "gpu/gpu_export.h" | 13 #include "gpu/gpu_export.h" |
| 14 | 14 |
| 15 namespace gpu { | 15 namespace gpu { |
| 16 namespace gles2 { | 16 namespace gles2 { |
| 17 | 17 |
| 18 // A class that helps write GL command buffers. | 18 // A class that helps write GL command buffers. |
| 19 class GPU_EXPORT GLES2CmdHelper : public CommandBufferHelper { | 19 class GPU_EXPORT GLES2CmdHelper : public CommandBufferHelper { |
| 20 public: | 20 public: |
| 21 explicit GLES2CmdHelper(CommandBuffer* command_buffer); | 21 explicit GLES2CmdHelper(CommandBuffer* command_buffer); |
| 22 ~GLES2CmdHelper() override; | 22 ~GLES2CmdHelper() override; |
| 23 | 23 |
| 24 // Include the auto-generated part of this class. We split this because it | 24 // Include the auto-generated part of this class. We split this because it |
| 25 // means we can easily edit the non-auto generated parts right here in this | 25 // means we can easily edit the non-auto generated parts right here in this |
| 26 // file instead of having to edit some template or the code generator. | 26 // file instead of having to edit some template or the code generator. |
| 27 #include "gpu/command_buffer/client/gles2_cmd_helper_autogen.h" | 27 #include "gpu/command_buffer/client/gles2_cmd_helper_autogen.h" |
| 28 | 28 |
| 29 // Helpers that could not be auto-generated. | 29 // Helpers that could not be auto-generated. |
| 30 // TODO(gman): Auto generate these. | |
| 31 void CreateAndConsumeTextureCHROMIUMImmediate(GLenum target, | |
| 32 uint32_t client_id, | |
| 33 const GLbyte* _mailbox) { | |
| 34 const uint32_t size = | |
| 35 gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate::ComputeSize(); | |
| 36 gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate* c = | |
| 37 GetImmediateCmdSpaceTotalSize< | |
| 38 gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate>(size); | |
| 39 if (c) { | |
| 40 c->Init(target, client_id, _mailbox); | |
| 41 } | |
| 42 } | |
| 43 | 30 |
| 44 private: | 31 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(GLES2CmdHelper); | 32 DISALLOW_COPY_AND_ASSIGN(GLES2CmdHelper); |
| 46 }; | 33 }; |
| 47 | 34 |
| 48 } // namespace gles2 | 35 } // namespace gles2 |
| 49 } // namespace gpu | 36 } // namespace gpu |
| 50 | 37 |
| 51 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ | 38 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ |
| 52 | 39 |
| OLD | NEW |