diff options
author | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-12 00:11:25 +0000 |
---|---|---|
committer | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-12 00:11:25 +0000 |
commit | a7a27ace0760f1ed19016822a45c6ec5300e861c (patch) | |
tree | b7641f10c9fb3130c0ae8f50e7223db2ae722cda /gpu/command_buffer | |
parent | 82017272e7272182443d7054911c4f890346353e (diff) | |
download | chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.zip chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.tar.gz chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.tar.bz2 |
Added CommandBufferProxy, CommandBufferStub. Replaced NPAPI with IPC for synchronous messages. WebPluginDelegateImpl can instantiate a command buffer. Removed remaining dependencies on NPAPI.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/465040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
62 files changed, 497 insertions, 549 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 5c26709..09e0249 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -17,7 +17,7 @@ _SIZE_OF_COMMAND_HEADER = 4 _FIRST_SPECIFIC_COMMAND_ID = 256 _LICENSE = """ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -418,7 +418,7 @@ class TypeHandler(object): func.WriteCmdInit(file) func.WriteCmdSet(file) - file.Write(" command_buffer::CommandHeader header;\n") + file.Write(" gpu::CommandHeader header;\n") args = func.GetCmdArgs() for arg in args: file.Write(" %s %s;\n" % (arg.cmd_type, arg.name)) @@ -2417,14 +2417,14 @@ class GLGenerator(object): def WriteNamespaceOpen(self, file): """Writes the code for the namespace.""" - file.Write("namespace command_buffer {\n") + file.Write("namespace gpu {\n") file.Write("namespace gles2 {\n") file.Write("\n") def WriteNamespaceClose(self, file): """Writes the code to close the namespace.""" file.Write("} // namespace gles2\n") - file.Write("} // namespace command_buffer\n") + file.Write("} // namespace gpu\n") file.Write("\n") def MakeGuard(self, filename): diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc index 67227fb..fee11ae 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc @@ -35,9 +35,9 @@ #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/common/command_buffer.h" -namespace command_buffer { +namespace gpu { -using command_buffer::CommandBuffer; +using gpu::CommandBuffer; CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer) : command_buffer_(command_buffer), @@ -188,4 +188,4 @@ parse_error::ParseError CommandBufferHelper::GetParseError() { return static_cast<parse_error::ParseError>(parse_error); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/cmd_buffer_helper.h b/gpu/command_buffer/client/cmd_buffer_helper.h index 7cac568..831e994 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.h +++ b/gpu/command_buffer/client/cmd_buffer_helper.h @@ -32,15 +32,15 @@ // This file contains the command buffer helper class. -#ifndef GPU_COMMAND_BUFFER_CLIENT_CROSS_CMD_BUFFER_HELPER_H_ -#define GPU_COMMAND_BUFFER_CLIENT_CROSS_CMD_BUFFER_HELPER_H_ +#ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ +#define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ #include "gpu/command_buffer/common/logging.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/cmd_buffer_common.h" #include "gpu/command_buffer/common/command_buffer.h" -namespace command_buffer { +namespace gpu { // Command buffer helper class. This class simplifies ring buffer management: // it will allocate the buffer, give it to the buffer interface, and let the @@ -59,7 +59,7 @@ namespace command_buffer { // // commands have been executed. class CommandBufferHelper { public: - explicit CommandBufferHelper(command_buffer::CommandBuffer* command_buffer); + explicit CommandBufferHelper(gpu::CommandBuffer* command_buffer); virtual ~CommandBufferHelper(); bool Initialize(); @@ -198,7 +198,7 @@ class CommandBufferHelper { return (get_ - put_ - 1 + entry_count_) % entry_count_; } - command_buffer::CommandBuffer* command_buffer_; + gpu::CommandBuffer* command_buffer_; ::base::SharedMemory* ring_buffer_; CommandBufferEntry *entries_; int32 entry_count_; @@ -211,6 +211,6 @@ class CommandBufferHelper { DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper); }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_CLIENT_CROSS_CMD_BUFFER_HELPER_H_ +#endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index 912df89..3cdc634 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc @@ -40,10 +40,10 @@ #include "gpu/command_buffer/service/gpu_processor.h" #include "testing/gtest/include/gtest/gtest.h" -namespace command_buffer { +namespace gpu { -using command_buffer::CommandBufferService; -using command_buffer::GPUProcessor; +using gpu::CommandBufferService; +using gpu::GPUProcessor; using testing::Return; using testing::Mock; using testing::Truly; @@ -53,7 +53,8 @@ using testing::Invoke; using testing::_; const int32 kNumCommandEntries = 10; -const int32 kCommandBufferSizeBytes = kNumCommandEntries * sizeof(int32); +const int32 kCommandBufferSizeBytes = + kNumCommandEntries * sizeof(CommandBufferEntry); // Test fixture for CommandBufferHelper test - Creates a CommandBufferHelper, // using a CommandBufferEngine with a mock AsyncAPIInterface for its interface @@ -67,14 +68,12 @@ class CommandBufferHelperTest : public testing::Test { EXPECT_CALL(*api_mock_, DoCommand(0, 0, _)) .WillRepeatedly(Return(parse_error::kParseNoError)); - base::SharedMemory* ring_buffer = new base::SharedMemory; - ring_buffer->Create(std::wstring(), false, false, kCommandBufferSizeBytes); - ring_buffer->Map(1024); - command_buffer_.reset(new CommandBufferService); - command_buffer_->Initialize(ring_buffer); + base::SharedMemory* ring_buffer = command_buffer_->Initialize( + kNumCommandEntries); + - parser_ = new command_buffer::CommandParser(ring_buffer->memory(), + parser_ = new gpu::CommandParser(ring_buffer->memory(), kCommandBufferSizeBytes, 0, kCommandBufferSizeBytes, @@ -140,7 +139,7 @@ class CommandBufferHelperTest : public testing::Test { MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; - command_buffer::CommandParser* parser_; + gpu::CommandParser* parser_; scoped_ptr<CommandBufferHelper> helper_; Sequence sequence_; }; @@ -295,4 +294,4 @@ TEST_F(CommandBufferHelperTest, TestToken) { EXPECT_EQ(parse_error::kParseNoError, command_buffer_->ResetParseError()); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/fenced_allocator.cc b/gpu/command_buffer/client/fenced_allocator.cc index 810feb5..27634f0 100644 --- a/gpu/command_buffer/client/fenced_allocator.cc +++ b/gpu/command_buffer/client/fenced_allocator.cc @@ -36,7 +36,7 @@ #include <algorithm> #include "gpu/command_buffer/client/cmd_buffer_helper.h" -namespace command_buffer { +namespace gpu { #ifndef COMPILER_MSVC const FencedAllocator::Offset FencedAllocator::kInvalidOffset; @@ -211,4 +211,4 @@ FencedAllocator::BlockIndex FencedAllocator::GetBlockByOffset(Offset offset) { return it-blocks_.begin(); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h index 72bba33..f0faf37 100644 --- a/gpu/command_buffer/client/fenced_allocator.h +++ b/gpu/command_buffer/client/fenced_allocator.h @@ -32,14 +32,14 @@ // This file contains the definition of the FencedAllocator class. -#ifndef GPU_COMMAND_BUFFER_CLIENT_CROSS_FENCED_ALLOCATOR_H_ -#define GPU_COMMAND_BUFFER_CLIENT_CROSS_FENCED_ALLOCATOR_H_ +#ifndef GPU_COMMAND_BUFFER_CLIENT_FENCED_ALLOCATOR_H_ +#define GPU_COMMAND_BUFFER_CLIENT_FENCED_ALLOCATOR_H_ #include <vector> #include "base/basictypes.h" #include "gpu/command_buffer/common/logging.h" -namespace command_buffer { +namespace gpu { class CommandBufferHelper; // FencedAllocator provides a mechanism to manage allocations within a fixed @@ -156,7 +156,7 @@ class FencedAllocator { // the other functions that return a block index). Offset AllocInBlock(BlockIndex index, unsigned int size); - command_buffer::CommandBufferHelper *helper_; + gpu::CommandBufferHelper *helper_; Container blocks_; DISALLOW_IMPLICIT_CONSTRUCTORS(FencedAllocator); @@ -261,6 +261,6 @@ class FencedAllocatorWrapper { DISALLOW_IMPLICIT_CONSTRUCTORS(FencedAllocatorWrapper); }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_CLIENT_CROSS_FENCED_ALLOCATOR_H_ +#endif // GPU_COMMAND_BUFFER_CLIENT_FENCED_ALLOCATOR_H_ diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index f6bde77..2f5c917 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc @@ -42,10 +42,10 @@ #include "gpu/command_buffer/service/gpu_processor.h" #include "testing/gtest/include/gtest/gtest.h" -namespace command_buffer { +namespace gpu { -using command_buffer::CommandBufferService; -using command_buffer::GPUProcessor; +using gpu::CommandBufferService; +using gpu::GPUProcessor; using testing::Return; using testing::Mock; using testing::Truly; @@ -69,14 +69,11 @@ class BaseFencedAllocatorTest : public testing::Test { .WillRepeatedly(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken), Return(parse_error::kParseNoError))); - base::SharedMemory* ring_buffer = new base::SharedMemory; - ring_buffer->Create(std::wstring(), false, false, 1024); - ring_buffer->Map(1024); - command_buffer_.reset(new CommandBufferService); - command_buffer_->Initialize(ring_buffer); + base::SharedMemory* ring_buffer = command_buffer_->Initialize( + kBufferSize / sizeof(CommandBufferEntry)); - parser_ = new command_buffer::CommandParser(ring_buffer->memory(), + parser_ = new gpu::CommandParser(ring_buffer->memory(), kBufferSize, 0, kBufferSize, @@ -102,7 +99,7 @@ class BaseFencedAllocatorTest : public testing::Test { MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; - command_buffer::CommandParser* parser_; + gpu::CommandParser* parser_; scoped_ptr<CommandBufferHelper> helper_; }; @@ -493,4 +490,4 @@ TEST_F(FencedAllocatorWrapperTest, TestFreePendingToken) { } } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/gles2_cmd_helper.cc b/gpu/command_buffer/client/gles2_cmd_helper.cc index 1dff914..bc6d13f 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper.cc +++ b/gpu/command_buffer/client/gles2_cmd_helper.cc @@ -4,11 +4,11 @@ #include "gpu/command_buffer/client/gles2_cmd_helper.h" -namespace command_buffer { +namespace gpu { // Currently this is a place holder. -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/gles2_cmd_helper.h b/gpu/command_buffer/client/gles2_cmd_helper.h index fbb1ce1..7b26605 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper.h +++ b/gpu/command_buffer/client/gles2_cmd_helper.h @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H -#define GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H +#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ +#define GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" -namespace command_buffer { +namespace gpu { namespace gles2 { // A class that helps write GL command buffers. class GLES2CmdHelper : public CommandBufferHelper { public: - explicit GLES2CmdHelper(command_buffer::CommandBuffer* command_buffer) + explicit GLES2CmdHelper(gpu::CommandBuffer* command_buffer) : CommandBufferHelper(command_buffer) { } virtual ~GLES2CmdHelper() { @@ -70,7 +70,7 @@ class GLES2CmdHelper : public CommandBufferHelper { }; } // namespace gles2 -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H +#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_H_ diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc index 86f31b5..74d9a7e 100644 --- a/gpu/command_buffer/client/gles2_demo.cc +++ b/gpu/command_buffer/client/gles2_demo.cc @@ -25,10 +25,10 @@ #include "gpu/command_buffer/client/gles2_demo_cc.h" using base::SharedMemory; -using command_buffer::GPUProcessor; -using command_buffer::CommandBufferService; -using command_buffer::gles2::GLES2CmdHelper; -using command_buffer::gles2::GLES2Implementation; +using gpu::GPUProcessor; +using gpu::CommandBufferService; +using gpu::gles2::GLES2CmdHelper; +using gpu::gles2::GLES2Implementation; class GLES2Demo { public: @@ -44,17 +44,8 @@ GLES2Demo::GLES2Demo() { } bool GLES2Demo::Setup(void* hwnd, int32 size) { - scoped_ptr<SharedMemory> ring_buffer(new SharedMemory); - if (!ring_buffer->Create(std::wstring(), false, false, size)) { - return NULL; - } - - if (!ring_buffer->Map(size)) { - return NULL; - } - scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); - if (!command_buffer->Initialize(ring_buffer.release())) { + if (!command_buffer->Initialize(size)) { return NULL; } diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 0280d94..dddc705 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -9,7 +9,7 @@ #include "gpu/command_buffer/client/gles2_implementation_gen.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" -namespace command_buffer { +namespace gpu { namespace gles2 { // A 32-bit and 64-bit compatible way of converting a pointer to a GLuint. @@ -253,4 +253,4 @@ void GLES2Implementation::TexSubImage2D( } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index bfd0d32..0557556 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H -#define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H +#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ +#define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ #include "base/shared_memory.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" @@ -11,7 +11,7 @@ #include "gpu/command_buffer/client/id_allocator.h" #include "gpu/command_buffer/client/fenced_allocator.h" -namespace command_buffer { +namespace gpu { namespace gles2 { // This class emulates GLES2 over command buffers. It can be used by a client @@ -87,7 +87,7 @@ class GLES2Implementation { } // namespace gles2 -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H +#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ diff --git a/gpu/command_buffer/client/gles2_implementation_gen.h b/gpu/command_buffer/client/gles2_implementation_gen.h index d385f8f..0926960 100644 --- a/gpu/command_buffer/client/gles2_implementation_gen.h +++ b/gpu/command_buffer/client/gles2_implementation_gen.h @@ -1,5 +1,5 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ #include "gpu/command_buffer/client/gles2_implementation.h" -namespace command_buffer { +namespace gpu { namespace gles2 { GLenum GLES2Implementation::CheckFramebufferStatus(GLenum target) { @@ -68,5 +68,5 @@ void GLES2Implementation::ReadPixels( } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/gles2_lib.cc b/gpu/command_buffer/client/gles2_lib.cc index 681f7ad..04813d4 100644 --- a/gpu/command_buffer/client/gles2_lib.cc +++ b/gpu/command_buffer/client/gles2_lib.cc @@ -6,7 +6,7 @@ namespace gles2 { -::command_buffer::gles2::GLES2Implementation* g_gl_impl; +::gpu::gles2::GLES2Implementation* g_gl_impl; bool InitGLES2Lib() { // TODO(gman): Encapulate initalizing the GLES2 library for client apps. diff --git a/gpu/command_buffer/client/gles2_lib.h b/gpu/command_buffer/client/gles2_lib.h index 589d2050..c642582 100644 --- a/gpu/command_buffer/client/gles2_lib.h +++ b/gpu/command_buffer/client/gles2_lib.h @@ -4,16 +4,16 @@ // These functions emluate GLES2 over command buffers. -#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H -#define GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H +#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ +#define GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ #include "gpu/command_buffer/client/gles2_implementation.h" namespace gles2 { -extern ::command_buffer::gles2::GLES2Implementation* g_gl_impl; +extern ::gpu::gles2::GLES2Implementation* g_gl_impl; -inline ::command_buffer::gles2::GLES2Implementation* GetGLContext() { +inline ::gpu::gles2::GLES2Implementation* GetGLContext() { return g_gl_impl; } @@ -22,5 +22,5 @@ bool InitGLES2Lib(); } // namespace gles2 -#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H +#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_LIB_H_ diff --git a/gpu/command_buffer/client/id_allocator.cc b/gpu/command_buffer/client/id_allocator.cc index 49104e5..12e4f75 100644 --- a/gpu/command_buffer/client/id_allocator.cc +++ b/gpu/command_buffer/client/id_allocator.cc @@ -34,7 +34,7 @@ #include "gpu/command_buffer/client/id_allocator.h" -namespace command_buffer { +namespace gpu { IdAllocator::IdAllocator() : bitmap_(1) { bitmap_[0] = 0; } @@ -82,4 +82,4 @@ bool IdAllocator::GetBit(unsigned int bit) const { return (bitmap_[bit / kBitsPerUint32] & mask) != 0; } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/client/id_allocator.h b/gpu/command_buffer/client/id_allocator.h index b2b14b9..52c448c2 100644 --- a/gpu/command_buffer/client/id_allocator.h +++ b/gpu/command_buffer/client/id_allocator.h @@ -32,15 +32,15 @@ // This file contains the definition of the IdAllocator class. -#ifndef GPU_COMMAND_BUFFER_CLIENT_CROSS_ID_ALLOCATOR_H_ -#define GPU_COMMAND_BUFFER_CLIENT_CROSS_ID_ALLOCATOR_H_ +#ifndef GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ +#define GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ #include <vector> #include "base/basictypes.h" #include "gpu/command_buffer/common/types.h" #include "gpu/command_buffer/common/resource.h" -namespace command_buffer { +namespace gpu { // A class to manage the allocation of resource IDs. It uses a bitfield stored // into a vector of unsigned ints. @@ -49,19 +49,19 @@ class IdAllocator { IdAllocator(); // Allocates a new resource ID. - command_buffer::ResourceId AllocateID() { + gpu::ResourceId AllocateID() { unsigned int bit = FindFirstFree(); SetBit(bit, true); return bit; } // Frees a resource ID. - void FreeID(command_buffer::ResourceId id) { + void FreeID(gpu::ResourceId id) { SetBit(id, false); } // Checks whether or not a resource ID is in use. - bool InUse(command_buffer::ResourceId id) { + bool InUse(gpu::ResourceId id) { return GetBit(id); } private: @@ -73,6 +73,6 @@ class IdAllocator { DISALLOW_COPY_AND_ASSIGN(IdAllocator); }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_CLIENT_CROSS_ID_ALLOCATOR_H_ +#endif // GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ diff --git a/gpu/command_buffer/client/id_allocator_test.cc b/gpu/command_buffer/client/id_allocator_test.cc index bb8d5f9b..7bc6f01 100644 --- a/gpu/command_buffer/client/id_allocator_test.cc +++ b/gpu/command_buffer/client/id_allocator_test.cc @@ -35,9 +35,9 @@ #include "gpu/command_buffer/client/id_allocator.h" #include "testing/gtest/include/gtest/gtest.h" -namespace command_buffer { +namespace gpu { -using command_buffer::ResourceId; +using gpu::ResourceId; class IdAllocatorTest : public testing::Test { protected: @@ -109,4 +109,4 @@ TEST_F(IdAllocatorTest, TestAdvanced) { EXPECT_EQ(id1, id2); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/bitfield_helpers.h b/gpu/command_buffer/common/bitfield_helpers.h index b74374d..7143c69 100644 --- a/gpu/command_buffer/common/bitfield_helpers.h +++ b/gpu/command_buffer/common/bitfield_helpers.h @@ -33,10 +33,10 @@ // This file contains a helper template class used to access bit fields in // unsigned int_ts. -#ifndef GPU_COMMAND_BUFFER_COMMON_CROSS_BITFIELD_HELPERS_H_ -#define GPU_COMMAND_BUFFER_COMMON_CROSS_BITFIELD_HELPERS_H_ +#ifndef GPU_COMMAND_BUFFER_COMMON_BITFIELD_HELPERS_H_ +#define GPU_COMMAND_BUFFER_COMMON_BITFIELD_HELPERS_H_ -namespace command_buffer { +namespace gpu { // Bitfield template class, used to access bit fields in unsigned int_ts. template<int shift, int length> class BitField { @@ -63,6 +63,6 @@ template<int shift, int length> class BitField { } }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_CROSS_BITFIELD_HELPERS_H_ +#endif // GPU_COMMAND_BUFFER_COMMON_BITFIELD_HELPERS_H_ diff --git a/gpu/command_buffer/common/bitfield_helpers_test.cc b/gpu/command_buffer/common/bitfield_helpers_test.cc index 779b540..b71410e 100644 --- a/gpu/command_buffer/common/bitfield_helpers_test.cc +++ b/gpu/command_buffer/common/bitfield_helpers_test.cc @@ -35,7 +35,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "gpu/command_buffer/common/bitfield_helpers.h" -namespace command_buffer { +namespace gpu { // Tests that BitField<>::Get returns the right bits. TEST(BitFieldTest, TestGet) { @@ -63,4 +63,4 @@ TEST(BitFieldTest, TestSet) { EXPECT_EQ(0x87654321u, value); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/cmd_buffer_common.cc b/gpu/command_buffer/common/cmd_buffer_common.cc index e9172eb..c2d8d97 100644 --- a/gpu/command_buffer/common/cmd_buffer_common.cc +++ b/gpu/command_buffer/common/cmd_buffer_common.cc @@ -35,7 +35,7 @@ #include "gpu/command_buffer/common/cmd_buffer_common.h" -namespace command_buffer { +namespace gpu { namespace cmd { const char* GetCommandName(CommandId command_id) { @@ -52,6 +52,6 @@ const char* GetCommandName(CommandId command_id) { } } // namespace cmd -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/cmd_buffer_common.h b/gpu/command_buffer/common/cmd_buffer_common.h index 1d0c4cb..7f02e3e 100644 --- a/gpu/command_buffer/common/cmd_buffer_common.h +++ b/gpu/command_buffer/common/cmd_buffer_common.h @@ -32,15 +32,15 @@ // This file contains the common parts of command buffer formats. -#ifndef GPU_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_COMMON_H_ -#define GPU_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_COMMON_H_ +#ifndef GPU_COMMAND_BUFFER_COMMON_CMD_BUFFER_COMMON_H_ +#define GPU_COMMAND_BUFFER_COMMON_CMD_BUFFER_COMMON_H_ #include "base/basictypes.h" #include "gpu/command_buffer/common/types.h" #include "gpu/command_buffer/common/bitfield_helpers.h" #include "gpu/command_buffer/common/logging.h" -namespace command_buffer { +namespace gpu { namespace cmd { enum ArgFlags { @@ -680,7 +680,7 @@ COMPILE_ASSERT(offsetof(GetBucketData, shared_memory_offset) == 20, #pragma pack(pop) -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_COMMON_H_ +#endif // GPU_COMMAND_BUFFER_COMMON_CMD_BUFFER_COMMON_H_ diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h index 3ce841a..92e38ff 100644 --- a/gpu/command_buffer/common/command_buffer.h +++ b/gpu/command_buffer/common/command_buffer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ #include "base/shared_memory.h" #include "base/task.h" -namespace command_buffer { +namespace gpu { // Common interface for CommandBuffer implementations. class CommandBuffer { @@ -19,12 +19,12 @@ class CommandBuffer { virtual ~CommandBuffer() { } - // Initialize the command buffer with the given ring buffer. Takes ownership - // of ring buffer. - virtual bool Initialize(::base::SharedMemory* ring_buffer) = 0; + // Initialize the command buffer with the given size (number of command + // entries). + virtual base::SharedMemory* Initialize(int32 size) = 0; // Gets the shared memory ring buffer object for the command buffer. - virtual ::base::SharedMemory* GetRingBuffer() = 0; + virtual base::SharedMemory* GetRingBuffer() = 0; virtual int32 GetSize() = 0; @@ -62,7 +62,7 @@ class CommandBuffer { virtual void DestroyTransferBuffer(int32 id) = 0; // Get the shared memory associated with a handle. - virtual ::base::SharedMemory* GetTransferBuffer(int32 handle) = 0; + virtual base::SharedMemory* GetTransferBuffer(int32 handle) = 0; // Get the current token value. This is used for by the writer to defer // changes to shared memory objects until the reader has reached a certain @@ -92,6 +92,6 @@ class CommandBuffer { DISALLOW_COPY_AND_ASSIGN(CommandBuffer); }; -} // namespace command_buffer +} // namespace gpu #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ diff --git a/gpu/command_buffer/common/command_buffer_mock.h b/gpu/command_buffer/common/command_buffer_mock.h index faa5536..79d5682 100644 --- a/gpu/command_buffer/common/command_buffer_mock.h +++ b/gpu/command_buffer/common/command_buffer_mock.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ #include "gpu/command_buffer/common/command_buffer.h" #include "testing/gmock/include/gmock/gmock.h" -namespace command_buffer { +namespace gpu { // An NPObject that implements a shared memory command buffer and a synchronous // API to manage the put and get pointers. @@ -16,13 +16,13 @@ class MockCommandBuffer : public CommandBuffer { public: MockCommandBuffer() { ON_CALL(*this, GetRingBuffer()) - .WillByDefault(testing::Return(static_cast<::base::SharedMemory*>(NULL))); + .WillByDefault(testing::Return(static_cast<base::SharedMemory*>(NULL))); ON_CALL(*this, GetTransferBuffer(testing::_)) - .WillByDefault(testing::Return(static_cast<::base::SharedMemory*>(NULL))); + .WillByDefault(testing::Return(static_cast<base::SharedMemory*>(NULL))); } - MOCK_METHOD1(Initialize, bool(::base::SharedMemory* ring_buffer)); - MOCK_METHOD0(GetRingBuffer, ::base::SharedMemory*()); + MOCK_METHOD1(Initialize, base::SharedMemory*(int32 size)); + MOCK_METHOD0(GetRingBuffer, base::SharedMemory*()); MOCK_METHOD0(GetSize, int32()); MOCK_METHOD1(SyncOffsets, int32(int32 put_offset)); MOCK_METHOD0(GetGetOffset, int32()); @@ -31,7 +31,7 @@ class MockCommandBuffer : public CommandBuffer { MOCK_METHOD1(SetPutOffsetChangeCallback, void(Callback0::Type* callback)); MOCK_METHOD1(CreateTransferBuffer, int32(size_t size)); MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle)); - MOCK_METHOD1(GetTransferBuffer, ::base::SharedMemory*(int32 handle)); + MOCK_METHOD1(GetTransferBuffer, base::SharedMemory*(int32 handle)); MOCK_METHOD0(GetToken, int32()); MOCK_METHOD1(SetToken, void(int32 token)); MOCK_METHOD0(ResetParseError, int32()); @@ -43,6 +43,6 @@ class MockCommandBuffer : public CommandBuffer { DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer); }; -} // namespace command_buffer +} // namespace gpu #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_ diff --git a/gpu/command_buffer/common/constants.h b/gpu/command_buffer/common/constants.h index ee874cd..1b0593d 100644 --- a/gpu/command_buffer/common/constants.h +++ b/gpu/command_buffer/common/constants.h @@ -30,12 +30,12 @@ */ -#ifndef O3D_COMMAND_BUFFER_COMMON_CROSS_CONSTANTS_H_ -#define O3D_COMMAND_BUFFER_COMMON_CROSS_CONSTANTS_H_ +#ifndef GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ +#define GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ #include "base/basictypes.h" -namespace command_buffer { +namespace gpu { typedef int32 CommandBufferOffset; const CommandBufferOffset kInvalidCommandBufferOffset = -1; @@ -66,6 +66,6 @@ namespace parse_error { // failure. const int32 kInvalidSharedMemoryId = -1; -} // namespace command_buffer +} // namespace gpu -#endif // O3D_COMMAND_BUFFER_COMMON_CROSS_CONSTANTS_H_ +#endif // GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_format.cc b/gpu/command_buffer/common/gles2_cmd_format.cc index 7c88a84..7770514 100644 --- a/gpu/command_buffer/common/gles2_cmd_format.cc +++ b/gpu/command_buffer/common/gles2_cmd_format.cc @@ -9,7 +9,7 @@ // and service side have different requirements. #include "gpu/command_buffer/common/cmd_buffer_common.h" -namespace command_buffer { +namespace gpu { namespace gles2 { #include "gpu/command_buffer/common/gles2_cmd_ids_autogen.h" @@ -29,6 +29,6 @@ const char* GetCommandName(CommandId id) { } } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/gles2_cmd_format.h b/gpu/command_buffer/common/gles2_cmd_format.h index 6e3a09b..4fcd273 100644 --- a/gpu/command_buffer/common/gles2_cmd_format.h +++ b/gpu/command_buffer/common/gles2_cmd_format.h @@ -4,8 +4,8 @@ // This file defines the GLES2 command buffer commands. -#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H -#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H +#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ +#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ // This is here because service side code must include the system's version of // the GL headers where as client side code includes the Chrome version. @@ -24,7 +24,7 @@ #include "gpu/command_buffer/common/cmd_buffer_common.h" #include "gpu/command_buffer/common/gles2_cmd_ids.h" -namespace command_buffer { +namespace gpu { namespace gles2 { #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h" @@ -69,7 +69,7 @@ struct GetAttribLocation { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 name_shm_id; uint32 name_shm_offset; @@ -132,7 +132,7 @@ struct GetAttribLocationImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 location_shm_id; uint32 location_shm_offset; @@ -189,7 +189,7 @@ struct GetUniformLocation { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 name_shm_id; uint32 name_shm_offset; @@ -252,7 +252,7 @@ struct GetUniformLocationImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 location_shm_id; uint32 location_shm_offset; @@ -275,7 +275,7 @@ COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, } // namespace gles2 -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H +#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 83c7869..affe2c0 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -25,7 +25,7 @@ struct ActiveTexture { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 texture; }; @@ -60,7 +60,7 @@ struct AttachShader { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 shader; }; @@ -107,7 +107,7 @@ struct BindAttribLocation { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 index; uint32 name_shm_id; @@ -162,7 +162,7 @@ struct BindAttribLocationImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 index; uint32 data_size; @@ -203,7 +203,7 @@ struct BindBuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 buffer; }; @@ -241,7 +241,7 @@ struct BindFramebuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 framebuffer; }; @@ -279,7 +279,7 @@ struct BindRenderbuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 renderbuffer; }; @@ -317,7 +317,7 @@ struct BindTexture { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 texture; }; @@ -359,7 +359,7 @@ struct BlendColor { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float red; float green; float blue; @@ -402,7 +402,7 @@ struct BlendEquation { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mode; }; @@ -437,7 +437,7 @@ struct BlendEquationSeparate { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 modeRGB; uint32 modeAlpha; }; @@ -475,7 +475,7 @@ struct BlendFunc { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 sfactor; uint32 dfactor; }; @@ -518,7 +518,7 @@ struct BlendFuncSeparate { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 srcRGB; uint32 dstRGB; uint32 srcAlpha; @@ -570,7 +570,7 @@ struct BufferData { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 size; uint32 data_shm_id; @@ -622,7 +622,7 @@ struct BufferDataImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 size; uint32 usage; @@ -671,7 +671,7 @@ struct BufferSubData { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 offset; uint32 size; @@ -723,7 +723,7 @@ struct BufferSubDataImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 offset; uint32 size; @@ -763,7 +763,7 @@ struct CheckFramebufferStatus { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; }; @@ -797,7 +797,7 @@ struct Clear { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mask; }; @@ -836,7 +836,7 @@ struct ClearColor { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float red; float green; float blue; @@ -879,7 +879,7 @@ struct ClearDepthf { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float depth; }; @@ -913,7 +913,7 @@ struct ClearStencil { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 s; }; @@ -953,7 +953,7 @@ struct ColorMask { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 red; uint32 green; uint32 blue; @@ -996,7 +996,7 @@ struct CompileShader { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; }; @@ -1047,7 +1047,7 @@ struct CompressedTexImage2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 internalformat; @@ -1122,7 +1122,7 @@ struct CompressedTexImage2DImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 internalformat; @@ -1192,7 +1192,7 @@ struct CompressedTexSubImage2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 xoffset; @@ -1271,7 +1271,7 @@ struct CompressedTexSubImage2DImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 xoffset; @@ -1340,7 +1340,7 @@ struct CopyTexImage2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 internalformat; @@ -1408,7 +1408,7 @@ struct CopyTexSubImage2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 xoffset; @@ -1463,7 +1463,7 @@ struct CreateProgram { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 client_id; }; @@ -1498,7 +1498,7 @@ struct CreateShader { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 type; uint32 client_id; }; @@ -1535,7 +1535,7 @@ struct CullFace { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mode; }; @@ -1574,7 +1574,7 @@ struct DeleteBuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 buffers_shm_id; uint32 buffers_shm_offset; @@ -1622,7 +1622,7 @@ struct DeleteBuffersImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -1663,7 +1663,7 @@ struct DeleteFramebuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 framebuffers_shm_id; uint32 framebuffers_shm_offset; @@ -1711,7 +1711,7 @@ struct DeleteFramebuffersImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -1745,7 +1745,7 @@ struct DeleteProgram { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; }; @@ -1786,7 +1786,7 @@ struct DeleteRenderbuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 renderbuffers_shm_id; uint32 renderbuffers_shm_offset; @@ -1834,7 +1834,7 @@ struct DeleteRenderbuffersImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -1868,7 +1868,7 @@ struct DeleteShader { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; }; @@ -1907,7 +1907,7 @@ struct DeleteTextures { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 textures_shm_id; uint32 textures_shm_offset; @@ -1955,7 +1955,7 @@ struct DeleteTexturesImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -1989,7 +1989,7 @@ struct DepthFunc { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 func; }; @@ -2023,7 +2023,7 @@ struct DepthMask { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 flag; }; @@ -2058,7 +2058,7 @@ struct DepthRangef { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float zNear; float zFar; }; @@ -2096,7 +2096,7 @@ struct DetachShader { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 shader; }; @@ -2133,7 +2133,7 @@ struct Disable { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 cap; }; @@ -2167,7 +2167,7 @@ struct DisableVertexAttribArray { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 index; }; @@ -2203,7 +2203,7 @@ struct DrawArrays { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mode; uint32 first; uint32 count; @@ -2248,7 +2248,7 @@ struct DrawElements { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mode; uint32 count; uint32 type; @@ -2291,7 +2291,7 @@ struct Enable { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 cap; }; @@ -2325,7 +2325,7 @@ struct EnableVertexAttribArray { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 index; }; @@ -2358,7 +2358,7 @@ struct Finish { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; }; COMPILE_ASSERT(sizeof(Finish) == 4, @@ -2388,7 +2388,7 @@ struct Flush { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; }; COMPILE_ASSERT(sizeof(Flush) == 4, @@ -2427,7 +2427,7 @@ struct FramebufferRenderbuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 attachment; uint32 renderbuffertarget; @@ -2479,7 +2479,7 @@ struct FramebufferTexture2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 attachment; uint32 textarget; @@ -2525,7 +2525,7 @@ struct FrontFace { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mode; }; @@ -2564,7 +2564,7 @@ struct GenBuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 buffers_shm_id; uint32 buffers_shm_offset; @@ -2612,7 +2612,7 @@ struct GenBuffersImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -2646,7 +2646,7 @@ struct GenerateMipmap { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; }; @@ -2687,7 +2687,7 @@ struct GenFramebuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 framebuffers_shm_id; uint32 framebuffers_shm_offset; @@ -2735,7 +2735,7 @@ struct GenFramebuffersImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -2776,7 +2776,7 @@ struct GenRenderbuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 renderbuffers_shm_id; uint32 renderbuffers_shm_offset; @@ -2824,7 +2824,7 @@ struct GenRenderbuffersImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -2863,7 +2863,7 @@ struct GenTextures { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; uint32 textures_shm_id; uint32 textures_shm_offset; @@ -2911,7 +2911,7 @@ struct GenTexturesImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 n; }; @@ -2967,7 +2967,7 @@ struct GetActiveAttrib { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 index; uint32 bufsize; @@ -3053,7 +3053,7 @@ struct GetActiveUniform { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 index; uint32 bufsize; @@ -3131,7 +3131,7 @@ struct GetAttachedShaders { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 maxcount; uint32 count_shm_id; @@ -3185,7 +3185,7 @@ struct GetBooleanv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 pname; uint32 params_shm_id; uint32 params_shm_offset; @@ -3233,7 +3233,7 @@ struct GetBufferParameteriv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 params_shm_id; @@ -3277,7 +3277,7 @@ struct GetError { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 result_shm_id; uint32 result_shm_offset; }; @@ -3319,7 +3319,7 @@ struct GetFloatv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 pname; uint32 params_shm_id; uint32 params_shm_offset; @@ -3369,7 +3369,7 @@ struct GetFramebufferAttachmentParameteriv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 attachment; uint32 pname; @@ -3422,7 +3422,7 @@ struct GetIntegerv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 pname; uint32 params_shm_id; uint32 params_shm_offset; @@ -3470,7 +3470,7 @@ struct GetProgramiv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 pname; uint32 params_shm_id; @@ -3527,7 +3527,7 @@ struct GetProgramInfoLog { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 bufsize; uint32 length_shm_id; @@ -3584,7 +3584,7 @@ struct GetRenderbufferParameteriv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 params_shm_id; @@ -3635,7 +3635,7 @@ struct GetShaderiv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; uint32 pname; uint32 params_shm_id; @@ -3692,7 +3692,7 @@ struct GetShaderInfoLog { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; uint32 bufsize; uint32 length_shm_id; @@ -3755,7 +3755,7 @@ struct GetShaderPrecisionFormat { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shadertype; uint32 precisiontype; uint32 range_shm_id; @@ -3818,7 +3818,7 @@ struct GetShaderSource { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; uint32 bufsize; uint32 length_shm_id; @@ -3867,7 +3867,7 @@ struct GetString { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 name; }; @@ -3909,7 +3909,7 @@ struct GetTexParameterfv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 params_shm_id; @@ -3960,7 +3960,7 @@ struct GetTexParameteriv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 params_shm_id; @@ -4011,7 +4011,7 @@ struct GetUniformfv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 location; uint32 params_shm_id; @@ -4062,7 +4062,7 @@ struct GetUniformiv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 location; uint32 params_shm_id; @@ -4113,7 +4113,7 @@ struct GetVertexAttribfv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 index; uint32 pname; uint32 params_shm_id; @@ -4164,7 +4164,7 @@ struct GetVertexAttribiv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 index; uint32 pname; uint32 params_shm_id; @@ -4215,7 +4215,7 @@ struct GetVertexAttribPointerv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 index; uint32 pname; uint32 pointer_shm_id; @@ -4259,7 +4259,7 @@ struct Hint { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 mode; }; @@ -4301,7 +4301,7 @@ struct IsBuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 buffer; uint32 result_shm_id; uint32 result_shm_offset; @@ -4346,7 +4346,7 @@ struct IsEnabled { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 cap; uint32 result_shm_id; uint32 result_shm_offset; @@ -4392,7 +4392,7 @@ struct IsFramebuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 framebuffer; uint32 result_shm_id; uint32 result_shm_offset; @@ -4438,7 +4438,7 @@ struct IsProgram { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; uint32 result_shm_id; uint32 result_shm_offset; @@ -4484,7 +4484,7 @@ struct IsRenderbuffer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 renderbuffer; uint32 result_shm_id; uint32 result_shm_offset; @@ -4529,7 +4529,7 @@ struct IsShader { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; uint32 result_shm_id; uint32 result_shm_offset; @@ -4575,7 +4575,7 @@ struct IsTexture { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 texture; uint32 result_shm_id; uint32 result_shm_offset; @@ -4615,7 +4615,7 @@ struct LineWidth { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float width; }; @@ -4649,7 +4649,7 @@ struct LinkProgram { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; }; @@ -4684,7 +4684,7 @@ struct PixelStorei { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 pname; uint32 param; }; @@ -4722,7 +4722,7 @@ struct PolygonOffset { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float factor; float units; }; @@ -4774,7 +4774,7 @@ struct ReadPixels { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 x; uint32 y; uint32 width; @@ -4837,7 +4837,7 @@ struct RenderbufferStorage { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 internalformat; uint32 width; @@ -4881,7 +4881,7 @@ struct SampleCoverage { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; float value; uint32 invert; }; @@ -4921,7 +4921,7 @@ struct Scissor { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 x; uint32 y; uint32 width; @@ -4974,7 +4974,7 @@ struct ShaderSource { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; uint32 count; uint32 data_shm_id; @@ -5026,7 +5026,7 @@ struct ShaderSourceImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 shader; uint32 count; uint32 data_size; @@ -5068,7 +5068,7 @@ struct StencilFunc { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 func; uint32 ref; uint32 mask; @@ -5111,7 +5111,7 @@ struct StencilFuncSeparate { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 face; uint32 func; uint32 ref; @@ -5154,7 +5154,7 @@ struct StencilMask { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 mask; }; @@ -5189,7 +5189,7 @@ struct StencilMaskSeparate { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 face; uint32 mask; }; @@ -5228,7 +5228,7 @@ struct StencilOp { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 fail; uint32 zfail; uint32 zpass; @@ -5272,7 +5272,7 @@ struct StencilOpSeparate { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 face; uint32 fail; uint32 zfail; @@ -5333,7 +5333,7 @@ struct TexImage2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 internalformat; @@ -5413,7 +5413,7 @@ struct TexImage2DImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 internalformat; @@ -5470,7 +5470,7 @@ struct TexParameterf { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; float param; @@ -5518,7 +5518,7 @@ struct TexParameterfv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 params_shm_id; @@ -5571,7 +5571,7 @@ struct TexParameterfvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; }; @@ -5610,7 +5610,7 @@ struct TexParameteri { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 param; @@ -5658,7 +5658,7 @@ struct TexParameteriv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; uint32 params_shm_id; @@ -5711,7 +5711,7 @@ struct TexParameterivImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 pname; }; @@ -5766,7 +5766,7 @@ struct TexSubImage2D { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 xoffset; @@ -5845,7 +5845,7 @@ struct TexSubImage2DImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, total_size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 target; uint32 level; uint32 xoffset; @@ -5901,7 +5901,7 @@ struct Uniform1f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; float x; }; @@ -5946,7 +5946,7 @@ struct Uniform1fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -5999,7 +5999,7 @@ struct Uniform1fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6037,7 +6037,7 @@ struct Uniform1i { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 x; }; @@ -6082,7 +6082,7 @@ struct Uniform1iv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -6135,7 +6135,7 @@ struct Uniform1ivImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6174,7 +6174,7 @@ struct Uniform2f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; float x; float y; @@ -6222,7 +6222,7 @@ struct Uniform2fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -6275,7 +6275,7 @@ struct Uniform2fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6314,7 +6314,7 @@ struct Uniform2i { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 x; uint32 y; @@ -6362,7 +6362,7 @@ struct Uniform2iv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -6415,7 +6415,7 @@ struct Uniform2ivImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6455,7 +6455,7 @@ struct Uniform3f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; float x; float y; @@ -6506,7 +6506,7 @@ struct Uniform3fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -6559,7 +6559,7 @@ struct Uniform3fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6599,7 +6599,7 @@ struct Uniform3i { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 x; uint32 y; @@ -6650,7 +6650,7 @@ struct Uniform3iv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -6703,7 +6703,7 @@ struct Uniform3ivImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6746,7 +6746,7 @@ struct Uniform4f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; float x; float y; @@ -6800,7 +6800,7 @@ struct Uniform4fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -6853,7 +6853,7 @@ struct Uniform4fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -6895,7 +6895,7 @@ struct Uniform4i { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 x; uint32 y; @@ -6949,7 +6949,7 @@ struct Uniform4iv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 v_shm_id; @@ -7002,7 +7002,7 @@ struct Uniform4ivImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; }; @@ -7049,7 +7049,7 @@ struct UniformMatrix2fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 transpose; @@ -7110,7 +7110,7 @@ struct UniformMatrix2fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 transpose; @@ -7160,7 +7160,7 @@ struct UniformMatrix3fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 transpose; @@ -7221,7 +7221,7 @@ struct UniformMatrix3fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 transpose; @@ -7271,7 +7271,7 @@ struct UniformMatrix4fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 transpose; @@ -7332,7 +7332,7 @@ struct UniformMatrix4fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 location; uint32 count; uint32 transpose; @@ -7372,7 +7372,7 @@ struct UseProgram { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; }; @@ -7406,7 +7406,7 @@ struct ValidateProgram { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 program; }; @@ -7441,7 +7441,7 @@ struct VertexAttrib1f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; float x; }; @@ -7483,7 +7483,7 @@ struct VertexAttrib1fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; uint32 values_shm_id; uint32 values_shm_offset; @@ -7532,7 +7532,7 @@ struct VertexAttrib1fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; }; @@ -7568,7 +7568,7 @@ struct VertexAttrib2f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; float x; float y; @@ -7613,7 +7613,7 @@ struct VertexAttrib2fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; uint32 values_shm_id; uint32 values_shm_offset; @@ -7662,7 +7662,7 @@ struct VertexAttrib2fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; }; @@ -7699,7 +7699,7 @@ struct VertexAttrib3f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; float x; float y; @@ -7747,7 +7747,7 @@ struct VertexAttrib3fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; uint32 values_shm_id; uint32 values_shm_offset; @@ -7796,7 +7796,7 @@ struct VertexAttrib3fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; }; @@ -7836,7 +7836,7 @@ struct VertexAttrib4f { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; float x; float y; @@ -7887,7 +7887,7 @@ struct VertexAttrib4fv { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; uint32 values_shm_id; uint32 values_shm_offset; @@ -7936,7 +7936,7 @@ struct VertexAttrib4fvImmediate { return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; }; @@ -7980,7 +7980,7 @@ struct VertexAttribPointer { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 indx; uint32 size; uint32 type; @@ -8032,7 +8032,7 @@ struct Viewport { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; uint32 x; uint32 y; uint32 width; @@ -8074,7 +8074,7 @@ struct SwapBuffers { return NextCmdAddress<ValueType>(cmd); } - command_buffer::CommandHeader header; + gpu::CommandHeader header; }; COMPILE_ASSERT(sizeof(SwapBuffers) == 4, diff --git a/gpu/command_buffer/common/gles2_cmd_format_test.cc b/gpu/command_buffer/common/gles2_cmd_format_test.cc index c699a1d..216dc68 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test.cc +++ b/gpu/command_buffer/common/gles2_cmd_format_test.cc @@ -7,11 +7,11 @@ #include "testing/gtest/include/gtest/gtest.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" -namespace command_buffer { +namespace gpu { namespace gles2 { #include "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h" } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/gles2_cmd_id_test.cc b/gpu/command_buffer/common/gles2_cmd_id_test.cc index 05035f9..401ce5b 100644 --- a/gpu/command_buffer/common/gles2_cmd_id_test.cc +++ b/gpu/command_buffer/common/gles2_cmd_id_test.cc @@ -1,5 +1,5 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" -namespace command_buffer { +namespace gpu { namespace gles2 { // *** These IDs MUST NOT CHANGE!!! *** @@ -368,5 +368,5 @@ TEST(GLES2CommandIdTest, CommandIdsMatch) { GLES2_SwapBuffers_kCmdId_mismatch); } } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/gles2_cmd_ids.h b/gpu/command_buffer/common/gles2_cmd_ids.h index 130fce9..b6f317f 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids.h +++ b/gpu/command_buffer/common/gles2_cmd_ids.h @@ -4,12 +4,12 @@ // This file defines the GLES2 command buffer commands. -#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_IDS_H -#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_IDS_H +#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_IDS_H_ +#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_IDS_H_ #include "gpu/command_buffer/common/cmd_buffer_common.h" -namespace command_buffer { +namespace gpu { namespace gles2 { #include "gpu/command_buffer/common/gles2_cmd_ids_autogen.h" @@ -17,7 +17,7 @@ namespace gles2 { const char* GetCommandName(CommandId command_id); } // namespace gles2 -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_IDS_H +#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_IDS_H_ diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 1268c23..d35ea3d 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -8,7 +8,7 @@ #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/gles2_cmd_format.h" -namespace command_buffer { +namespace gpu { namespace gles2 { int GLES2Util::GLGetNumValuesReturned(int id) const { @@ -344,5 +344,5 @@ uint32 GLES2Util::ComputeImageDataSize( } } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/gles2_cmd_utils.h b/gpu/command_buffer/common/gles2_cmd_utils.h index 9674a30..74ba8f1 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.h +++ b/gpu/command_buffer/common/gles2_cmd_utils.h @@ -5,13 +5,13 @@ // This file is here so other GLES2 related files can have a common set of // includes where appropriate. -#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H -#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H +#ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ +#define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ #include "base/basictypes.h" #include "gpu/command_buffer/common/types.h" -namespace command_buffer { +namespace gpu { namespace gles2 { // Utilties for GLES2 support. @@ -35,7 +35,7 @@ class GLES2Util { }; } // namespace gles2 -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H +#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ diff --git a/gpu/command_buffer/common/logging.h b/gpu/command_buffer/common/logging.h index a9bbad8..76aef5e 100644 --- a/gpu/command_buffer/common/logging.h +++ b/gpu/command_buffer/common/logging.h @@ -33,8 +33,8 @@ // This file abstracts differences in logging between NaCl and host // environment. -#ifndef GPU_COMMAND_BUFFER_COMMON_CROSS_LOGGING_H_ -#define GPU_COMMAND_BUFFER_COMMON_CROSS_LOGGING_H_ +#ifndef GPU_COMMAND_BUFFER_COMMON_LOGGING_H_ +#define GPU_COMMAND_BUFFER_COMMON_LOGGING_H_ #ifndef __native_client__ #include "base/logging.h" @@ -64,4 +64,4 @@ #endif -#endif // GPU_COMMAND_BUFFER_COMMON_CROSS_LOGGING_H_ +#endif // GPU_COMMAND_BUFFER_COMMON_LOGGING_H_ diff --git a/gpu/command_buffer/common/resource.cc b/gpu/command_buffer/common/resource.cc index f3b75ec..2aec518 100644 --- a/gpu/command_buffer/common/resource.cc +++ b/gpu/command_buffer/common/resource.cc @@ -34,7 +34,7 @@ #include "gpu/command_buffer/common/resource.h" -namespace command_buffer { +namespace gpu { namespace texture { @@ -117,4 +117,4 @@ unsigned int GetDataSize(DataType type) { } // namespace effect_param -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/common/resource.h b/gpu/command_buffer/common/resource.h index 01de6a1..1ad0981 100644 --- a/gpu/command_buffer/common/resource.h +++ b/gpu/command_buffer/common/resource.h @@ -33,8 +33,8 @@ // This file contains definitions for resource flags, enums, and helper // functions. -#ifndef GPU_COMMAND_BUFFER_COMMON_CROSS_RESOURCE_H_ -#define GPU_COMMAND_BUFFER_COMMON_CROSS_RESOURCE_H_ +#ifndef GPU_COMMAND_BUFFER_COMMON_RESOURCE_H_ +#define GPU_COMMAND_BUFFER_COMMON_RESOURCE_H_ #include <algorithm> #include "base/basictypes.h" @@ -42,7 +42,7 @@ #include "gpu/command_buffer/common/types.h" #include "gpu/command_buffer/common/logging.h" -namespace command_buffer { +namespace gpu { // A resource ID, key to the resource maps. typedef uint32 ResourceId; @@ -224,6 +224,6 @@ enum FilteringMode { }; } // namespace sampler -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_CROSS_RESOURCE_H_ +#endif // GPU_COMMAND_BUFFER_COMMON_RESOURCE_H_ diff --git a/gpu/command_buffer/common/types.h b/gpu/command_buffer/common/types.h index daa01cb..8387120 100644 --- a/gpu/command_buffer/common/types.h +++ b/gpu/command_buffer/common/types.h @@ -29,11 +29,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - // This file contains cross-platform basic type definitions -#ifndef GPU_COMMAND_BUFFER_COMMON_CROSS_TYPES_H_ -#define GPU_COMMAND_BUFFER_COMMON_CROSS_TYPES_H_ +#ifndef GPU_COMMAND_BUFFER_COMMON_TYPES_H_ +#define GPU_COMMAND_BUFFER_COMMON_TYPES_H_ #include <build/build_config.h> #if !defined(COMPILER_MSVC) @@ -41,7 +40,7 @@ #endif #include <string> -namespace command_buffer { +namespace gpu { #if defined(COMPILER_MSVC) typedef short Int16; typedef unsigned short Uint16; @@ -55,6 +54,6 @@ typedef uint32_t Uint32; #endif typedef std::string String; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_COMMON_CROSS_TYPES_H_ +#endif // GPU_COMMAND_BUFFER_COMMON_TYPES_H_ diff --git a/gpu/command_buffer/service/cmd_buffer_engine.h b/gpu/command_buffer/service/cmd_buffer_engine.h index 74ad649..4312b47 100644 --- a/gpu/command_buffer/service/cmd_buffer_engine.h +++ b/gpu/command_buffer/service/cmd_buffer_engine.h @@ -33,12 +33,12 @@ // This file defines the CommandBufferEngine class, providing the main loop for // the service, exposing the RPC API, managing the command parser. -#ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_CMD_BUFFER_ENGINE_H_ -#define GPU_COMMAND_BUFFER_SERVICE_CROSS_CMD_BUFFER_ENGINE_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_CMD_BUFFER_ENGINE_H_ +#define GPU_COMMAND_BUFFER_SERVICE_CMD_BUFFER_ENGINE_H_ #include "base/basictypes.h" -namespace command_buffer { +namespace gpu { class CommandBufferEngine { public: @@ -65,6 +65,6 @@ class CommandBufferEngine { DISALLOW_COPY_AND_ASSIGN(CommandBufferEngine); }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_CROSS_CMD_BUFFER_ENGINE_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_CMD_BUFFER_ENGINE_H_ diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc index 1341732..dfdb8ce 100644 --- a/gpu/command_buffer/service/cmd_parser.cc +++ b/gpu/command_buffer/service/cmd_parser.cc @@ -35,7 +35,7 @@ #include "gpu/command_buffer/service/precompile.h" #include "gpu/command_buffer/service/cmd_parser.h" -namespace command_buffer { +namespace gpu { CommandParser::CommandParser(void *shm_address, size_t shm_size, @@ -107,4 +107,4 @@ parse_error::ParseError CommandParser::ProcessAllCommands() { return parse_error::kParseNoError; } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/cmd_parser.h b/gpu/command_buffer/service/cmd_parser.h index 2209cf8..131a459 100644 --- a/gpu/command_buffer/service/cmd_parser.h +++ b/gpu/command_buffer/service/cmd_parser.h @@ -32,13 +32,13 @@ // This file contains the command parser class. -#ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_CMD_PARSER_H_ -#define GPU_COMMAND_BUFFER_SERVICE_CROSS_CMD_PARSER_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ +#define GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ #include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/cmd_buffer_common.h" -namespace command_buffer { +namespace gpu { class AsyncAPIInterface; @@ -110,6 +110,6 @@ class AsyncAPIInterface { virtual const char* GetCommandName(unsigned int command_id) const = 0; }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_CROSS_CMD_PARSER_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ diff --git a/gpu/command_buffer/service/cmd_parser_test.cc b/gpu/command_buffer/service/cmd_parser_test.cc index 59c5528..1a847b2 100644 --- a/gpu/command_buffer/service/cmd_parser_test.cc +++ b/gpu/command_buffer/service/cmd_parser_test.cc @@ -39,7 +39,7 @@ #include "gpu/command_buffer/service/mocks.h" #include "testing/gtest/include/gtest/gtest.h" -namespace command_buffer { +namespace gpu { using testing::Return; using testing::Mock; @@ -313,4 +313,4 @@ TEST_F(CommandParserTest, TestError) { Mock::VerifyAndClearExpectations(api_mock()); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc index 94d2148..e2dffec 100644 --- a/gpu/command_buffer/service/command_buffer_service.cc +++ b/gpu/command_buffer/service/command_buffer_service.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ using ::base::SharedMemory; -namespace command_buffer { +namespace gpu { CommandBufferService::CommandBufferService() : size_(0), @@ -24,18 +24,21 @@ CommandBufferService::CommandBufferService() CommandBufferService::~CommandBufferService() { } -bool CommandBufferService::Initialize(::base::SharedMemory* ring_buffer) { - DCHECK(ring_buffer); - +base::SharedMemory* CommandBufferService::Initialize(int32 size) { // Fail if already initialized. if (ring_buffer_.get()) return false; - size_t size_in_bytes = ring_buffer->max_size(); - size_ = size_in_bytes / sizeof(int32); - ring_buffer_.reset(ring_buffer); + size_ = size; + + ring_buffer_.reset(new SharedMemory); + if (ring_buffer_->Create(std::wstring(), false, false, size_)) { + if (ring_buffer_->Map(size_)) + return ring_buffer_.get(); + } - return true; + ring_buffer_.reset(); + return NULL; } SharedMemory* CommandBufferService::GetRingBuffer() { @@ -158,4 +161,4 @@ void CommandBufferService::RaiseErrorStatus() { error_status_ = true; } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h index d6da953..6784581 100644 --- a/gpu/command_buffer/service/command_buffer_service.h +++ b/gpu/command_buffer/service/command_buffer_service.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. -#ifndef GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_H_ -#define GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ +#define GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ #include <set> #include <vector> @@ -13,81 +13,48 @@ #include "base/shared_memory.h" #include "base/task.h" #include "gpu/command_buffer/common/command_buffer.h" -#include "gpu/np_utils/default_np_object.h" -#include "gpu/np_utils/np_dispatcher.h" -namespace command_buffer { +namespace gpu { -// An NPObject that implements a shared memory command buffer and a synchronous +// An object that implements a shared memory command buffer and a synchronous // API to manage the put and get pointers. class CommandBufferService : public CommandBuffer { public: CommandBufferService(); virtual ~CommandBufferService(); - // Overrides CommandBuffer. - virtual bool Initialize(::base::SharedMemory* ring_buffer); - - // Overrides CommandBuffer. - virtual ::base::SharedMemory* GetRingBuffer(); - + // CommandBuffer implementation: + virtual base::SharedMemory* Initialize(int32 size); + virtual base::SharedMemory* GetRingBuffer(); virtual int32 GetSize(); - - // Overrides CommandBuffer. virtual int32 SyncOffsets(int32 put_offset); - - // Overrides CommandBuffer. virtual int32 GetGetOffset(); - - // Overrides CommandBuffer. virtual void SetGetOffset(int32 get_offset); - - // Overrides CommandBuffer. virtual int32 GetPutOffset(); - - // Overrides CommandBuffer. virtual void SetPutOffsetChangeCallback(Callback0::Type* callback); - - // Overrides CommandBuffer. virtual int32 CreateTransferBuffer(size_t size); - - // Overrides CommandBuffer. virtual void DestroyTransferBuffer(int32 id); - - // Overrides CommandBuffer. - virtual ::base::SharedMemory* GetTransferBuffer(int32 handle); - - // Overrides CommandBuffer. + virtual base::SharedMemory* GetTransferBuffer(int32 handle); virtual int32 GetToken(); - - // Overrides CommandBuffer. virtual void SetToken(int32 token); - - // Overrides CommandBuffer. virtual int32 ResetParseError(); - - // Overrides CommandBuffer. virtual void SetParseError(int32 parse_error); - - // Overrides CommandBuffer. virtual bool GetErrorStatus(); - - // Overrides CommandBuffer. virtual void RaiseErrorStatus(); private: - scoped_ptr< ::base::SharedMemory> ring_buffer_; + scoped_ptr< base::SharedMemory> ring_buffer_; int32 size_; int32 get_offset_; int32 put_offset_; scoped_ptr<Callback0::Type> put_offset_change_callback_; - std::vector<linked_ptr< ::base::SharedMemory> > registered_objects_; + std::vector<linked_ptr< base::SharedMemory> > registered_objects_; std::set<int32> unused_registered_object_elements_; int32 token_; int32 parse_error_; bool error_status_; }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc index 68ff221..b5749af 100644 --- a/gpu/command_buffer/service/command_buffer_service_unittest.cc +++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -14,7 +14,7 @@ using testing::Return; using testing::SetArgumentPointee; using testing::StrictMock; -namespace command_buffer { +namespace gpu { class CommandBufferServiceTest : public testing::Test { protected: @@ -30,17 +30,16 @@ TEST_F(CommandBufferServiceTest, NullRingBufferByDefault) { } TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) { - SharedMemory* ring_buffer = new SharedMemory; - EXPECT_TRUE(ring_buffer->Create(std::wstring(), false, false, 1024)); - EXPECT_TRUE(command_buffer_->Initialize(ring_buffer)); - EXPECT_TRUE(ring_buffer == command_buffer_->GetRingBuffer()); - EXPECT_EQ(256, command_buffer_->GetSize()); + base::SharedMemory* ring_buffer = command_buffer_->Initialize(1024); + EXPECT_TRUE(NULL != ring_buffer); + EXPECT_EQ(ring_buffer, command_buffer_->GetRingBuffer()); + EXPECT_GT(command_buffer_->GetSize(), 0); } TEST_F(CommandBufferServiceTest, InitializeFailsSecondTime) { SharedMemory* ring_buffer = new SharedMemory; - EXPECT_TRUE(command_buffer_->Initialize(ring_buffer)); - EXPECT_FALSE(command_buffer_->Initialize(ring_buffer)); + EXPECT_TRUE(NULL != command_buffer_->Initialize(1024)); + EXPECT_TRUE(NULL == command_buffer_->Initialize(1024)); } TEST_F(CommandBufferServiceTest, GetAndPutOffsetsDefaultToZero) { @@ -54,10 +53,7 @@ class MockCallback : public CallbackRunner<Tuple0> { }; TEST_F(CommandBufferServiceTest, CanSyncGetAndPutOffset) { - SharedMemory* ring_buffer = new SharedMemory; - ring_buffer->Create(std::wstring(), false, false, 1024); - - EXPECT_TRUE(command_buffer_->Initialize(ring_buffer)); + command_buffer_->Initialize(1024); StrictMock<MockCallback>* put_offset_change_callback = new StrictMock<MockCallback>; @@ -175,4 +171,4 @@ TEST_F(CommandBufferServiceTest, CanRaiseErrorStatus) { EXPECT_TRUE(command_buffer_->GetErrorStatus()); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/common_decoder.cc b/gpu/command_buffer/service/common_decoder.cc index c0d545f..478d281 100644 --- a/gpu/command_buffer/service/common_decoder.cc +++ b/gpu/command_buffer/service/common_decoder.cc @@ -33,7 +33,7 @@ #include "gpu/command_buffer/service/common_decoder.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" -namespace command_buffer { +namespace gpu { const void* CommonDecoder::Bucket::GetData(size_t offset, size_t size) const { if (OffsetSizeValid(offset, size)) { @@ -295,4 +295,4 @@ parse_error::ParseError CommonDecoder::HandleGetBucketData( return parse_error::kParseNoError; } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/common_decoder.h b/gpu/command_buffer/service/common_decoder.h index c96cc9c..f33926b 100644 --- a/gpu/command_buffer/service/common_decoder.h +++ b/gpu/command_buffer/service/common_decoder.h @@ -29,15 +29,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_COMMON_DECODER_H_ -#define GPU_COMMAND_BUFFER_SERVICE_CROSS_COMMON_DECODER_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ +#define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ #include <map> #include "base/linked_ptr.h" #include "base/scoped_ptr.h" #include "gpu/command_buffer/service/cmd_parser.h" -namespace command_buffer { +namespace gpu { class CommandBufferEngine; @@ -176,7 +176,7 @@ class CommonDecoder : public AsyncAPIInterface { BucketMap buckets_; }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_CROSS_COMMON_DECODER_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc index ce3a5d5..54f1941 100644 --- a/gpu/command_buffer/service/common_decoder_unittest.cc +++ b/gpu/command_buffer/service/common_decoder_unittest.cc @@ -6,7 +6,7 @@ #include "gpu/command_buffer/service/cmd_buffer_engine.h" #include "testing/gtest/include/gtest/gtest.h" -namespace command_buffer { +namespace gpu { TEST(CommonDecoderBucket, Basic) { CommonDecoder::Bucket bucket; @@ -414,5 +414,5 @@ TEST_F(CommonDecoderTest, GetBucketData) { } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 5d0d2d7..7ceef0e 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -14,7 +14,7 @@ #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" -namespace command_buffer { +namespace gpu { namespace gles2 { namespace { @@ -103,7 +103,7 @@ enum GLErrorBit { } uint32 GLErrorToErrorBit(GLenum error) { - switch(error) { + switch (error) { case GL_INVALID_ENUM: return GLErrorBit::kInvalidEnum; case GL_INVALID_VALUE: @@ -121,7 +121,7 @@ uint32 GLErrorToErrorBit(GLenum error) { } GLenum GLErrorBitToGLError(uint32 error_bit) { - switch(error_bit) { + switch (error_bit) { case GLErrorBit::kInvalidEnum: return GL_INVALID_ENUM; case GLErrorBit::kInvalidValue: @@ -698,12 +698,12 @@ parse_error::ParseError GLES2DecoderImpl::DoCommand( } } // namespace gles2 -} // namespace command_buffer +} // namespace gpu // This is included so the compiler will make these inline. #include "gpu/command_buffer/service/gles2_cmd_decoder_validate.h" -namespace command_buffer { +namespace gpu { namespace gles2 { void GLES2DecoderImpl::CreateProgramHelper(GLuint client_id) { @@ -1231,5 +1231,5 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetActiveAttrib( #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index a131e50..fbac4f0 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -4,8 +4,8 @@ // This file contains the GLES2Decoder class. -#ifndef O3D_COMMAND_BUFFER_SERVICE_CROSS_GLES2_CMD_DECODER_H -#define O3D_COMMAND_BUFFER_SERVICE_CROSS_GLES2_CMD_DECODER_H +#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ +#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ #include <build/build_config.h> #if defined(OS_LINUX) @@ -15,7 +15,7 @@ #endif #include "gpu/command_buffer/service/common_decoder.h" -namespace command_buffer { +namespace gpu { namespace gles2 { // This class implements the AsyncAPIInterface interface, decoding GLES2 @@ -80,6 +80,6 @@ class GLES2Decoder : public CommonDecoder { }; } // namespace gles2 -} // namespace command_buffer +} // namespace gpu -#endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GLES2_CMD_DECODER_H +#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_validate.h b/gpu/command_buffer/service/gles2_cmd_decoder_validate.h index ff51aae..cfb5157 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_validate.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_validate.h @@ -1,10 +1,10 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. -namespace command_buffer { +namespace gpu { namespace gles2 { namespace { @@ -1258,5 +1258,5 @@ parse_error::ParseError ValidateSwapBuffers( } } // anonymous namespace } // namespace gles2 -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/gpu_processor.cc b/gpu/command_buffer/service/gpu_processor.cc index 6d71a9c..61449c0 100644 --- a/gpu/command_buffer/service/gpu_processor.cc +++ b/gpu/command_buffer/service/gpu_processor.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -7,7 +7,7 @@ using ::base::SharedMemory; -namespace command_buffer { +namespace gpu { GPUProcessor::~GPUProcessor() { } @@ -20,16 +20,16 @@ void GPUProcessor::ProcessCommands() { int commands_processed = 0; while (commands_processed < commands_per_update_ && !parser_->IsEmpty()) { - command_buffer::parse_error::ParseError parse_error = + gpu::parse_error::ParseError parse_error = parser_->ProcessCommand(); switch (parse_error) { - case command_buffer::parse_error::kParseUnknownCommand: - case command_buffer::parse_error::kParseInvalidArguments: + case gpu::parse_error::kParseUnknownCommand: + case gpu::parse_error::kParseInvalidArguments: command_buffer_->SetParseError(parse_error); break; - case command_buffer::parse_error::kParseInvalidSize: - case command_buffer::parse_error::kParseOutOfBounds: + case gpu::parse_error::kParseInvalidSize: + case gpu::parse_error::kParseOutOfBounds: command_buffer_->SetParseError(parse_error); command_buffer_->RaiseErrorStatus(); return; @@ -75,4 +75,4 @@ void GPUProcessor::set_token(int32 token) { command_buffer_->SetToken(token); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/gpu_processor.h b/gpu/command_buffer/service/gpu_processor.h index 6797ef1..a594f0b 100644 --- a/gpu/command_buffer/service/gpu_processor.h +++ b/gpu/command_buffer/service/gpu_processor.h @@ -1,10 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ #define GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ +#include "app/gfx/native_widget_types.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/shared_memory.h" @@ -13,12 +14,12 @@ #include "gpu/command_buffer/service/cmd_parser.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" -namespace command_buffer { +namespace gpu { // This class processes commands in a command buffer. It is event driven and // posts tasks to the current message loop to do additional work. class GPUProcessor : public ::base::RefCounted<GPUProcessor>, - public command_buffer::CommandBufferEngine { + public gpu::CommandBufferEngine { public: explicit GPUProcessor(CommandBuffer* command_buffer); @@ -28,7 +29,7 @@ class GPUProcessor : public ::base::RefCounted<GPUProcessor>, CommandParser* parser, int commands_per_update); - virtual bool Initialize(HWND hwnd); + virtual bool Initialize(gfx::PluginWindowHandle hwnd); virtual ~GPUProcessor(); @@ -36,9 +37,7 @@ class GPUProcessor : public ::base::RefCounted<GPUProcessor>, virtual void ProcessCommands(); -#if defined(OS_WIN) - virtual bool SetWindow(HWND handle, int width, int height); -#endif + virtual bool SetWindow(gfx::PluginWindowHandle handle, int width, int height); // Implementation of CommandBufferEngine. @@ -68,13 +67,13 @@ class GPUProcessor : public ::base::RefCounted<GPUProcessor>, scoped_ptr<CommandParser> parser_; }; -} // namespace command_buffer +} // namespace gpu // Callbacks to the GPUProcessor hold a reference count. template <typename Method> -class CallbackStorage<command_buffer::GPUProcessor, Method> { +class CallbackStorage<gpu::GPUProcessor, Method> { public: - CallbackStorage(command_buffer::GPUProcessor* obj, Method method) + CallbackStorage(gpu::GPUProcessor* obj, Method method) : obj_(obj), meth_(method) { DCHECK(obj_); @@ -86,7 +85,7 @@ class CallbackStorage<command_buffer::GPUProcessor, Method> { } protected: - command_buffer::GPUProcessor* obj_; + gpu::GPUProcessor* obj_; Method meth_; private: diff --git a/gpu/command_buffer/service/gpu_processor_mock.h b/gpu/command_buffer/service/gpu_processor_mock.h index 852782b..be6a938 100644 --- a/gpu/command_buffer/service/gpu_processor_mock.h +++ b/gpu/command_buffer/service/gpu_processor_mock.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ #include "gpu/command_buffer/service/gpu_processor.h" #include "testing/gmock/include/gmock/gmock.h" -namespace command_buffer { +namespace gpu { class MockGPUProcessor : public GPUProcessor { public: @@ -16,17 +16,12 @@ class MockGPUProcessor : public GPUProcessor { : GPUProcessor(command_buffer) { } -#if defined(OS_WIN) - MOCK_METHOD1(Initialize, bool(HWND handle)); -#endif - + MOCK_METHOD1(Initialize, bool(gfx::PluginWindowHandle handle)); MOCK_METHOD0(Destroy, void()); MOCK_METHOD0(ProcessCommands, void()); - -#if defined(OS_WIN) - MOCK_METHOD3(SetWindow, bool(HWND handle, int width, int height)); -#endif - + MOCK_METHOD3(SetWindow, bool(gfx::PluginWindowHandle handle, + int width, + int height)); MOCK_METHOD1(GetSharedMemoryAddress, void*(int32 shm_id)); MOCK_METHOD1(GetSharedMemorySize, size_t(int32 shm_id)); MOCK_METHOD1(set_token, void(int32 token)); @@ -35,6 +30,6 @@ class MockGPUProcessor : public GPUProcessor { DISALLOW_COPY_AND_ASSIGN(MockGPUProcessor); }; -} // namespace command_buffer +} // namespace gpu #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_MOCK_H_ diff --git a/gpu/command_buffer/service/gpu_processor_unittest.cc b/gpu/command_buffer/service/gpu_processor_unittest.cc index db60f3a..5041371 100644 --- a/gpu/command_buffer/service/gpu_processor_unittest.cc +++ b/gpu/command_buffer/service/gpu_processor_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -19,10 +19,10 @@ using testing::Return; using testing::SetArgumentPointee; using testing::StrictMock; -namespace command_buffer { +namespace gpu { const size_t kRingBufferSize = 1024; -const size_t kRingBufferEntries = kRingBufferSize / sizeof(int32); +const size_t kRingBufferEntries = kRingBufferSize / sizeof(CommandBufferEntry); class GPUProcessorTest : public testing::Test { protected: @@ -40,11 +40,11 @@ class GPUProcessorTest : public testing::Test { ON_CALL(*command_buffer_.get(), GetSize()) .WillByDefault(Return(kRingBufferEntries)); - async_api_.reset(new StrictMock<command_buffer::AsyncAPIMock>); + async_api_.reset(new StrictMock<gpu::AsyncAPIMock>); decoder_ = gles2::GLES2Decoder::Create(); - parser_ = new command_buffer::CommandParser(buffer_, + parser_ = new gpu::CommandParser(buffer_, kRingBufferEntries, 0, kRingBufferEntries, @@ -68,9 +68,9 @@ class GPUProcessorTest : public testing::Test { scoped_ptr<MockCommandBuffer> command_buffer_; scoped_ptr<::base::SharedMemory> shared_memory_; int32* buffer_; - command_buffer::gles2::GLES2Decoder* decoder_; - command_buffer::CommandParser* parser_; - scoped_ptr<command_buffer::AsyncAPIMock> async_api_; + gpu::gles2::GLES2Decoder* decoder_; + gpu::CommandParser* parser_; + scoped_ptr<gpu::AsyncAPIMock> async_api_; scoped_refptr<GPUProcessor> processor_; }; @@ -81,14 +81,14 @@ TEST_F(GPUProcessorTest, ProcessorDoesNothingIfRingBufferIsEmpty) { processor_->ProcessCommands(); - EXPECT_EQ(command_buffer::parse_error::kParseNoError, + EXPECT_EQ(gpu::parse_error::kParseNoError, command_buffer_->ResetParseError()); EXPECT_FALSE(command_buffer_->GetErrorStatus()); } TEST_F(GPUProcessorTest, ProcessesOneCommand) { - command_buffer::CommandHeader* header = - reinterpret_cast<command_buffer::CommandHeader*>(&buffer_[0]); + gpu::CommandHeader* header = + reinterpret_cast<gpu::CommandHeader*>(&buffer_[0]); header[0].command = 7; header[0].size = 2; buffer_[1] = 123; @@ -98,18 +98,18 @@ TEST_F(GPUProcessorTest, ProcessesOneCommand) { EXPECT_CALL(*command_buffer_, SetGetOffset(2)); EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); processor_->ProcessCommands(); - EXPECT_EQ(command_buffer::parse_error::kParseNoError, + EXPECT_EQ(gpu::parse_error::kParseNoError, command_buffer_->ResetParseError()); EXPECT_FALSE(command_buffer_->GetErrorStatus()); } TEST_F(GPUProcessorTest, ProcessesTwoCommands) { - command_buffer::CommandHeader* header = - reinterpret_cast<command_buffer::CommandHeader*>(&buffer_[0]); + gpu::CommandHeader* header = + reinterpret_cast<gpu::CommandHeader*>(&buffer_[0]); header[0].command = 7; header[0].size = 2; buffer_[1] = 123; @@ -121,17 +121,17 @@ TEST_F(GPUProcessorTest, ProcessesTwoCommands) { EXPECT_CALL(*command_buffer_, SetGetOffset(3)); EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[2])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); processor_->ProcessCommands(); } TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) { - command_buffer::CommandHeader* header = - reinterpret_cast<command_buffer::CommandHeader*>(&buffer_[0]); + gpu::CommandHeader* header = + reinterpret_cast<gpu::CommandHeader*>(&buffer_[0]); header[0].command = 7; header[0].size = 2; buffer_[1] = 123; @@ -144,10 +144,10 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) { .WillOnce(Return(4)); EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[2])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); EXPECT_CALL(*command_buffer_, SetGetOffset(3)); @@ -159,7 +159,7 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) { .WillOnce(Return(4)); EXPECT_CALL(*async_api_, DoCommand(9, 0, &buffer_[3])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); EXPECT_CALL(*command_buffer_, SetGetOffset(4)); @@ -167,8 +167,8 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) { } TEST_F(GPUProcessorTest, SetsErrorCodeOnCommandBuffer) { - command_buffer::CommandHeader* header = - reinterpret_cast<command_buffer::CommandHeader*>(&buffer_[0]); + gpu::CommandHeader* header = + reinterpret_cast<gpu::CommandHeader*>(&buffer_[0]); header[0].command = 7; header[0].size = 1; @@ -178,18 +178,18 @@ TEST_F(GPUProcessorTest, SetsErrorCodeOnCommandBuffer) { EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0])) .WillOnce(Return( - command_buffer::parse_error::kParseUnknownCommand)); + gpu::parse_error::kParseUnknownCommand)); EXPECT_CALL(*command_buffer_, - SetParseError(command_buffer::parse_error::kParseUnknownCommand)); + SetParseError(gpu::parse_error::kParseUnknownCommand)); processor_->ProcessCommands(); } TEST_F(GPUProcessorTest, RecoverableParseErrorsAreNotClearedByFollowingSuccessfulCommands) { - command_buffer::CommandHeader* header = - reinterpret_cast<command_buffer::CommandHeader*>(&buffer_[0]); + gpu::CommandHeader* header = + reinterpret_cast<gpu::CommandHeader*>(&buffer_[0]); header[0].command = 7; header[0].size = 1; header[1].command = 8; @@ -201,20 +201,20 @@ TEST_F(GPUProcessorTest, EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0])) .WillOnce(Return( - command_buffer::parse_error::kParseUnknownCommand)); + gpu::parse_error::kParseUnknownCommand)); EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[1])) - .WillOnce(Return(command_buffer::parse_error::kParseNoError)); + .WillOnce(Return(gpu::parse_error::kParseNoError)); EXPECT_CALL(*command_buffer_, - SetParseError(command_buffer::parse_error::kParseUnknownCommand)); + SetParseError(gpu::parse_error::kParseUnknownCommand)); processor_->ProcessCommands(); } TEST_F(GPUProcessorTest, UnrecoverableParseErrorsRaiseTheErrorStatus) { - command_buffer::CommandHeader* header = - reinterpret_cast<command_buffer::CommandHeader*>(&buffer_[0]); + gpu::CommandHeader* header = + reinterpret_cast<gpu::CommandHeader*>(&buffer_[0]); header[0].command = 7; header[0].size = 1; header[1].command = 8; @@ -224,10 +224,10 @@ TEST_F(GPUProcessorTest, UnrecoverableParseErrorsRaiseTheErrorStatus) { .WillOnce(Return(2)); EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0])) - .WillOnce(Return(command_buffer::parse_error::kParseInvalidSize)); + .WillOnce(Return(gpu::parse_error::kParseInvalidSize)); EXPECT_CALL(*command_buffer_, - SetParseError(command_buffer::parse_error::kParseInvalidSize)); + SetParseError(gpu::parse_error::kParseInvalidSize)); EXPECT_CALL(*command_buffer_, RaiseErrorStatus()); @@ -274,4 +274,4 @@ TEST_F(GPUProcessorTest, SetTokenForwardsToCommandBuffer) { processor_->set_token(7); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/gpu_processor_win.cc b/gpu/command_buffer/service/gpu_processor_win.cc index a4e138b..c08e102 100644 --- a/gpu/command_buffer/service/gpu_processor_win.cc +++ b/gpu/command_buffer/service/gpu_processor_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,7 +8,7 @@ using ::base::SharedMemory; -namespace command_buffer { +namespace gpu { GPUProcessor::GPUProcessor(CommandBuffer* command_buffer) : command_buffer_(command_buffer), @@ -29,7 +29,7 @@ GPUProcessor::GPUProcessor(CommandBuffer* command_buffer, parser_.reset(parser); } -bool GPUProcessor::Initialize(HWND handle) { +bool GPUProcessor::Initialize(gfx::PluginWindowHandle handle) { DCHECK(handle); // Cannot reinitialize. @@ -45,10 +45,10 @@ bool GPUProcessor::Initialize(HWND handle) { } void* ptr = ring_buffer->memory(); - parser_.reset(new command_buffer::CommandParser(ptr, size, 0, size, 0, + parser_.reset(new gpu::CommandParser(ptr, size, 0, size, 0, decoder_.get())); } else { - parser_.reset(new command_buffer::CommandParser(NULL, 0, 0, 0, 0, + parser_.reset(new gpu::CommandParser(NULL, 0, 0, 0, 0, decoder_.get())); } @@ -65,7 +65,9 @@ void GPUProcessor::Destroy() { } } -bool GPUProcessor::SetWindow(HWND handle, int width, int height) { +bool GPUProcessor::SetWindow(gfx::PluginWindowHandle handle, + int width, + int height) { if (handle == NULL) { // Destroy GAPI when the window handle becomes invalid. Destroy(); @@ -75,4 +77,4 @@ bool GPUProcessor::SetWindow(HWND handle, int width, int height) { } } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h index 3d85e32..d77c566 100644 --- a/gpu/command_buffer/service/mocks.h +++ b/gpu/command_buffer/service/mocks.h @@ -36,15 +36,15 @@ // would be definitely preferable, unfortunately it doesn't work on Windows // yet. -#ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ -#define GPU_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ +#define GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ #include <vector> #include "testing/gmock/include/gmock/gmock.h" #include "gpu/command_buffer/service/cmd_parser.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" -namespace command_buffer { +namespace gpu { // Mocks an AsyncAPIInterface, using GMock. class AsyncAPIMock : public AsyncAPIInterface { @@ -103,6 +103,6 @@ class AsyncAPIMock : public AsyncAPIInterface { CommandBufferEngine *engine_; }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ diff --git a/gpu/command_buffer/service/precompile.h b/gpu/command_buffer/service/precompile.h index 55d2b21..ce2cf9f 100644 --- a/gpu/command_buffer/service/precompile.h +++ b/gpu/command_buffer/service/precompile.h @@ -33,8 +33,8 @@ // This file contains includes for common headers used by command buffer server // files. It is used for pre-compiled header support. -#ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_PRECOMPILE_H_ -#define GPU_COMMAND_BUFFER_SERVICE_CROSS_PRECOMPILE_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_PRECOMPILE_H_ +#define GPU_COMMAND_BUFFER_SERVICE_PRECOMPILE_H_ #include <build/build_config.h> @@ -47,4 +47,4 @@ #include <map> #include <vector> -#endif // O3D_CORE_CROSS_PRECOMPILE_H_ +#endif // O3D_CORE_PRECOMPILE_H_ diff --git a/gpu/command_buffer/service/resource.cc b/gpu/command_buffer/service/resource.cc index 1208d30..288cc4f 100644 --- a/gpu/command_buffer/service/resource.cc +++ b/gpu/command_buffer/service/resource.cc @@ -35,7 +35,7 @@ #include "gpu/command_buffer/service/precompile.h" #include "gpu/command_buffer/service/resource.h" -namespace command_buffer { +namespace gpu { // Assigns a resource to a resource ID, by setting it at the right location // into the list, resizing the list if necessary, and destroying an existing @@ -98,4 +98,4 @@ void ResourceMapBase::DestroyAllResources() { resources_.clear(); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/resource.h b/gpu/command_buffer/service/resource.h index 20e3038..819f7b2 100644 --- a/gpu/command_buffer/service/resource.h +++ b/gpu/command_buffer/service/resource.h @@ -32,14 +32,14 @@ // This file contains the definition for resource classes and the resource map. -#ifndef GPU_COMMAND_BUFFER_SERVICE_CROSS_RESOURCE_H_ -#define GPU_COMMAND_BUFFER_SERVICE_CROSS_RESOURCE_H_ +#ifndef GPU_COMMAND_BUFFER_SERVICE_RESOURCE_H_ +#define GPU_COMMAND_BUFFER_SERVICE_RESOURCE_H_ #include <vector> #include "base/scoped_ptr.h" #include "gpu/command_buffer/common/resource.h" -namespace command_buffer { +namespace gpu { // Base class for resources, just providing a common Destroy function. class Resource { @@ -263,6 +263,6 @@ template<class T> class ResourceMap { ResourceMapBase container_; }; -} // namespace command_buffer +} // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_CROSS_RESOURCE_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_RESOURCE_H_ diff --git a/gpu/command_buffer/service/resource_test.cc b/gpu/command_buffer/service/resource_test.cc index 7a9438b..50eba1d 100644 --- a/gpu/command_buffer/service/resource_test.cc +++ b/gpu/command_buffer/service/resource_test.cc @@ -36,7 +36,7 @@ #include "gpu/command_buffer/service/resource.h" #include "testing/gtest/include/gtest/gtest.h" -namespace command_buffer { +namespace gpu { // Mock resource implementation that checks for leaks. class ResourceMock : public Resource { @@ -124,4 +124,4 @@ TEST_F(ResourceMapTest, TestMap) { CheckLeaks(); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/x_utils.cc b/gpu/command_buffer/service/x_utils.cc index 3e1776b..2ed6cae 100644 --- a/gpu/command_buffer/service/x_utils.cc +++ b/gpu/command_buffer/service/x_utils.cc @@ -36,7 +36,7 @@ #include "gpu/command_buffer/common/logging.h" #include "gpu/command_buffer/service/x_utils.h" -namespace command_buffer { +namespace gpu { bool XWindowWrapper::Initialize() { XWindowAttributes attributes; @@ -89,4 +89,4 @@ void XWindowWrapper::SwapBuffers() { glXSwapBuffers(display_, window_); } -} // namespace command_buffer +} // namespace gpu diff --git a/gpu/command_buffer/service/x_utils.h b/gpu/command_buffer/service/x_utils.h index bd2dd53..5647ba2 100644 --- a/gpu/command_buffer/service/x_utils.h +++ b/gpu/command_buffer/service/x_utils.h @@ -39,7 +39,7 @@ #include "base/basictypes.h" #include "gpu/command_buffer/common/logging.h" -namespace command_buffer { +namespace gpu { // This class is a wrapper around an X Window and associated GL context. It is // useful to isolate intrusive X headers, since it can be forward declared @@ -71,6 +71,6 @@ class XWindowWrapper { DISALLOW_COPY_AND_ASSIGN(XWindowWrapper); }; -} // namespace command_buffer +} // namespace gpu #endif // GPU_COMMAND_BUFFER_SERVICE_X_UTILS_H_ |