Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / gpu / command_buffer / client / gles2_cmd_helper.h
blob8a5cde19d7a79880ff7e4dab2197242f2ca6b81e
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
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_
8 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
9 #include "gpu/command_buffer/common/gles2_cmd_format.h"
10 #include "gpu/gpu_export.h"
12 namespace gpu {
13 namespace gles2 {
15 // A class that helps write GL command buffers.
16 class GPU_EXPORT GLES2CmdHelper : public CommandBufferHelper {
17 public:
18 explicit GLES2CmdHelper(CommandBuffer* command_buffer);
19 ~GLES2CmdHelper() override;
21 // Include the auto-generated part of this class. We split this because it
22 // means we can easily edit the non-auto generated parts right here in this
23 // file instead of having to edit some template or the code generator.
24 #include "gpu/command_buffer/client/gles2_cmd_helper_autogen.h"
26 // Helpers that could not be auto-generated.
27 // TODO(gman): Auto generate these.
28 void CreateAndConsumeTextureCHROMIUMImmediate(GLenum target,
29 uint32_t client_id,
30 const GLbyte* _mailbox) {
31 const uint32_t size =
32 gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate::ComputeSize();
33 gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate* c =
34 GetImmediateCmdSpaceTotalSize<
35 gles2::cmds::CreateAndConsumeTextureCHROMIUMImmediate>(size);
36 if (c) {
37 c->Init(target, client_id, _mailbox);
41 private:
42 DISALLOW_COPY_AND_ASSIGN(GLES2CmdHelper);
45 } // namespace gles2
46 } // namespace gpu
48 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_