summaryrefslogtreecommitdiffstats
path: root/o3d/command_buffer/common/cross/resource.cc
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 07:11:50 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 07:11:50 +0000
commit3ae92e96ba6e4b5761f2673ec6f28fd916951b70 (patch)
tree7a669b699cae258113ac0fa1fba2e2537f46d3b5 /o3d/command_buffer/common/cross/resource.cc
parentb32753d3cffa4b65b5fc2a15dd31f41089519360 (diff)
downloadchromium_src-3ae92e96ba6e4b5761f2673ec6f28fd916951b70.zip
chromium_src-3ae92e96ba6e4b5761f2673ec6f28fd916951b70.tar.gz
chromium_src-3ae92e96ba6e4b5761f2673ec6f28fd916951b70.tar.bz2
More work in Command Buffers
I think/hope this is the last big CL for this. *) Moved GAPIInterface enums to cmd_buffer_format.h The reason is you should not have to include CODE to make data. The fact that the enums were in GAPIInterface, a class, meant you had to include code if you wanted to make a command buffer. *) Typed arguments where I could. So for example Draw takes PrimitiveType instead of uint32. CreateVertexBuffer takes a ResourceId *) Renamed enums etc to match style guide. *) Moved BitFields into specific commands *) renamed arguments from id to type_id. Review URL: http://codereview.chromium.org/234002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/command_buffer/common/cross/resource.cc')
-rw-r--r--o3d/command_buffer/common/cross/resource.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/o3d/command_buffer/common/cross/resource.cc b/o3d/command_buffer/common/cross/resource.cc
index cf7082f..a077bf1 100644
--- a/o3d/command_buffer/common/cross/resource.cc
+++ b/o3d/command_buffer/common/cross/resource.cc
@@ -42,12 +42,12 @@ namespace texture {
// Gets the number of bytes per block for a given format.
unsigned int GetBytesPerBlock(Format format) {
switch (format) {
- case XRGB8:
- case ARGB8:
+ case kXRGB8:
+ case kARGB8:
return 4;
- case ABGR16F:
+ case kABGR16F:
return 8;
- case DXT1:
+ case kDXT1:
return 8;
default:
LOG(FATAL) << "Invalid format";
@@ -58,11 +58,11 @@ unsigned int GetBytesPerBlock(Format format) {
// Gets the width of a block for a given format.
unsigned int GetBlockSizeX(Format format) {
switch (format) {
- case XRGB8:
- case ARGB8:
- case ABGR16F:
+ case kXRGB8:
+ case kARGB8:
+ case kABGR16F:
return 1;
- case DXT1:
+ case kDXT1:
return 4;
default:
LOG(FATAL) << "Invalid format";
@@ -83,26 +83,26 @@ namespace effect_param {
// Gets the size of the data of a given parameter type.
unsigned int GetDataSize(DataType type) {
switch (type) {
- case UNKNOWN:
+ case kUnknown:
return 0;
- case FLOAT1:
+ case kFloat1:
return sizeof(float); // NOLINT
- case FLOAT2:
- return sizeof(float)*2; // NOLINT
- case FLOAT3:
- return sizeof(float)*3; // NOLINT
- case FLOAT4:
- return sizeof(float)*4; // NOLINT
- case MATRIX4:
- return sizeof(float)*16; // NOLINT
- case INT:
+ case kFloat2:
+ return sizeof(float) * 2; // NOLINT
+ case kFloat3:
+ return sizeof(float) * 3; // NOLINT
+ case kFloat4:
+ return sizeof(float) * 4; // NOLINT
+ case kMatrix4:
+ return sizeof(float) * 16; // NOLINT
+ case kInt:
return sizeof(int); // NOLINT
- case BOOL:
+ case kBool:
return sizeof(bool); // NOLINT
- case SAMPLER:
- return sizeof(ResourceID); // NOLINT
- case TEXTURE:
- return sizeof(ResourceID); // NOLINT
+ case kSampler:
+ return sizeof(ResourceId); // NOLINT
+ case kTexture:
+ return sizeof(ResourceId); // NOLINT
default:
LOG(FATAL) << "Invalid type.";
return 0;