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

Unified Diff: gpu/command_buffer/common/gles2_cmd_format_autogen.h

Issue 521018: A bunch of unit tests for GLES2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/gles2_cmd_format_autogen.h
===================================================================
--- gpu/command_buffer/common/gles2_cmd_format_autogen.h (revision 35431)
+++ gpu/command_buffer/common/gles2_cmd_format_autogen.h (working copy)
@@ -1,5 +1,12 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
// This file is auto-generated. DO NOT EDIT!
+#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
+#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
+
struct ActiveTexture {
typedef ActiveTexture ValueType;
static const CommandId kCmdId = kActiveTexture;
@@ -133,31 +140,29 @@
static const CommandId kCmdId = kBindAttribLocationImmediate;
static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
- static uint32 ComputeDataSize(const char* s) {
- return strlen(s);
- }
-
- static uint32 ComputeSize(const char* s) {
+ static uint32 ComputeSize(uint32 data_size) {
return static_cast<uint32>(
- sizeof(ValueType) + ComputeDataSize(s)); // NOLINT
+ sizeof(ValueType) + data_size); // NOLINT
}
- void SetHeader(const char* s) {
- header.SetCmdByTotalSize<ValueType>(ComputeSize(s));
+ void SetHeader(uint32 data_size) {
+ header.SetCmdBySize<ValueType>(data_size);
}
- void Init(GLuint _program, GLuint _index, const char* _name) {
- SetHeader(_name);
+ void Init(
+ GLuint _program, GLuint _index, const char* _name, uint32 _data_size) {
+ SetHeader(_data_size);
program = _program;
index = _index;
- data_size = strlen(_name);
- memcpy(ImmediateDataAddress(this), _name, data_size);
+ data_size = _data_size;
+ memcpy(ImmediateDataAddress(this), _name, _data_size);
}
- void* Set(void* cmd, GLuint _program, GLuint _index, const char* _name) {
- static_cast<ValueType*>(cmd)->Init(_program, _index, _name);
- const uint32 size = ComputeSize(_name);
- return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
+ void* Set(
+ void* cmd, GLuint _program, GLuint _index, const char* _name,
+ uint32 _data_size) {
+ static_cast<ValueType*>(cmd)->Init(_program, _index, _name, _data_size);
+ return NextImmediateCmdAddress<ValueType>(cmd, _data_size);
}
gpu::CommandHeader header;
@@ -8081,3 +8086,5 @@
OffsetOf_SwapBuffers_header_not_0);
+#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
+
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_gen.h ('k') | gpu/command_buffer/common/gles2_cmd_format_test_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698