summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 20:58:39 +0000
committerapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 20:58:39 +0000
commit59ddd8324123953384ed97fa1d346bbebb273b83 (patch)
tree73af7d9ab328e090763a2554d62b7e0b93e6c783 /o3d
parent8f9fe77995a9351668e32d5ed6dd76f048e95a85 (diff)
downloadchromium_src-59ddd8324123953384ed97fa1d346bbebb273b83.zip
chromium_src-59ddd8324123953384ed97fa1d346bbebb273b83.tar.gz
chromium_src-59ddd8324123953384ed97fa1d346bbebb273b83.tar.bz2
Fixed gpu_plugin to build in the Chrome tree.
TEST=none BUG=none Review URL: http://codereview.chromium.org/302009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29455 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/build/common.gypi9
-rw-r--r--o3d/build/o3d_in_chrome.gyp29
-rw-r--r--o3d/gpu_plugin/gpu_plugin_object.cc2
-rw-r--r--o3d/gpu_plugin/gpu_processor_unittest.cc36
4 files changed, 48 insertions, 28 deletions
diff --git a/o3d/build/common.gypi b/o3d/build/common.gypi
index ca2b697..7b1476e 100644
--- a/o3d/build/common.gypi
+++ b/o3d/build/common.gypi
@@ -71,15 +71,6 @@
},
}],
],
- 'conditions': [
- ['o3d_in_chrome == "True"',
- {
- 'defines': [
- 'O3D_IN_CHROME',
- ],
- },
- ],
- ],
},
'conditions' : [
['OS == "win"',
diff --git a/o3d/build/o3d_in_chrome.gyp b/o3d/build/o3d_in_chrome.gyp
new file mode 100644
index 0000000..08f2e59
--- /dev/null
+++ b/o3d/build/o3d_in_chrome.gyp
@@ -0,0 +1,29 @@
+# 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.
+
+{
+ 'includes': [
+ 'common.gypi',
+ ],
+ 'targets': [
+ # Depend on this target to set the O3D_IN_CHROME macro. This also works for
+ # indirectly dependent Chromium projects that do not include the O3D
+ # common.gypi.
+ {
+ 'target_name': 'o3d_in_chrome',
+ 'type': 'none',
+ 'conditions': [
+ ['o3d_in_chrome == "True"',
+ {
+ 'all_dependent_settings': {
+ 'defines': [
+ 'O3D_IN_CHROME',
+ ], # 'defines'
+ }, # 'all_dependent_settings'
+ },
+ ],
+ ], # 'conditions'
+ },
+ ],
+}
diff --git a/o3d/gpu_plugin/gpu_plugin_object.cc b/o3d/gpu_plugin/gpu_plugin_object.cc
index 8c33afa..5680ad1 100644
--- a/o3d/gpu_plugin/gpu_plugin_object.cc
+++ b/o3d/gpu_plugin/gpu_plugin_object.cc
@@ -110,7 +110,7 @@ NPObjectPointer<NPObject> GPUPluginObject::OpenCommandBuffer() {
command_buffer_ = NPCreateObject<CommandBuffer>(npp_);
if (command_buffer_->Initialize(ring_buffer)) {
- processor_ = new GPUProcessor(npp_, command_buffer_);
+ processor_ = new GPUProcessor(npp_, command_buffer_.Get());
if (processor_->Initialize(static_cast<HWND>(window_.window))) {
command_buffer_->SetPutOffsetChangeCallback(
NewCallback(processor_.get(),
diff --git a/o3d/gpu_plugin/gpu_processor_unittest.cc b/o3d/gpu_plugin/gpu_processor_unittest.cc
index d06a382..3ee57a9 100644
--- a/o3d/gpu_plugin/gpu_processor_unittest.cc
+++ b/o3d/gpu_plugin/gpu_processor_unittest.cc
@@ -62,7 +62,7 @@ class GPUProcessorTest : public testing::Test {
async_api_.get());
processor_ = new GPUProcessor(NULL,
- command_buffer_,
+ command_buffer_.Get(),
gapi_,
decoder_,
parser_,
@@ -98,7 +98,7 @@ TEST_F(GPUProcessorTest, ProcessorDoesNothingIfRingBufferIsEmpty) {
processor_->ProcessCommands();
- EXPECT_EQ(command_buffer::BufferSyncInterface::kParseNoError,
+ EXPECT_EQ(command_buffer::parse_error::kParseNoError,
command_buffer_->ResetParseError());
EXPECT_FALSE(command_buffer_->GetErrorStatus());
}
@@ -115,11 +115,11 @@ TEST_F(GPUProcessorTest, ProcessesOneCommand) {
EXPECT_CALL(*command_buffer_, SetGetOffset(2));
EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
processor_->ProcessCommands();
- EXPECT_EQ(command_buffer::BufferSyncInterface::kParseNoError,
+ EXPECT_EQ(command_buffer::parse_error::kParseNoError,
command_buffer_->ResetParseError());
EXPECT_FALSE(command_buffer_->GetErrorStatus());
}
@@ -138,10 +138,10 @@ TEST_F(GPUProcessorTest, ProcessesTwoCommands) {
EXPECT_CALL(*command_buffer_, SetGetOffset(3));
EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[2]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
processor_->ProcessCommands();
}
@@ -161,10 +161,10 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) {
.WillOnce(Return(4));
EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[2]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
EXPECT_CALL(*command_buffer_, SetGetOffset(3));
@@ -176,7 +176,7 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) {
.WillOnce(Return(4));
EXPECT_CALL(*async_api_, DoCommand(9, 0, &buffer_[3]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
EXPECT_CALL(*command_buffer_, SetGetOffset(4));
@@ -195,11 +195,11 @@ TEST_F(GPUProcessorTest, SetsErrorCodeOnCommandBuffer) {
EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0]))
.WillOnce(Return(
- command_buffer::BufferSyncInterface::kParseUnknownCommand));
+ command_buffer::parse_error::kParseUnknownCommand));
processor_->ProcessCommands();
- EXPECT_EQ(command_buffer::BufferSyncInterface::kParseUnknownCommand,
+ EXPECT_EQ(command_buffer::parse_error::kParseUnknownCommand,
command_buffer_->ResetParseError());
EXPECT_FALSE(command_buffer_->GetErrorStatus());
}
@@ -219,14 +219,14 @@ TEST_F(GPUProcessorTest,
EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0]))
.WillOnce(Return(
- command_buffer::BufferSyncInterface::kParseUnknownCommand));
+ command_buffer::parse_error::kParseUnknownCommand));
EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[1]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseNoError));
+ .WillOnce(Return(command_buffer::parse_error::kParseNoError));
processor_->ProcessCommands();
- EXPECT_EQ(command_buffer::BufferSyncInterface::kParseUnknownCommand,
+ EXPECT_EQ(command_buffer::parse_error::kParseUnknownCommand,
command_buffer_->ResetParseError());
EXPECT_FALSE(command_buffer_->GetErrorStatus());
}
@@ -243,11 +243,11 @@ TEST_F(GPUProcessorTest, UnrecoverableParseErrorsRaiseTheErrorStatus) {
.WillOnce(Return(2));
EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseInvalidSize));
+ .WillOnce(Return(command_buffer::parse_error::kParseInvalidSize));
processor_->ProcessCommands();
- EXPECT_EQ(command_buffer::BufferSyncInterface::kParseInvalidSize,
+ EXPECT_EQ(command_buffer::parse_error::kParseInvalidSize,
command_buffer_->ResetParseError());
EXPECT_TRUE(command_buffer_->GetErrorStatus());
}
@@ -264,12 +264,12 @@ TEST_F(GPUProcessorTest, ProcessCommandsDoesNothingAfterUnrecoverableError) {
.WillOnce(Return(2));
EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0]))
- .WillOnce(Return(command_buffer::BufferSyncInterface::kParseInvalidSize));
+ .WillOnce(Return(command_buffer::parse_error::kParseInvalidSize));
processor_->ProcessCommands();
processor_->ProcessCommands();
- EXPECT_EQ(command_buffer::BufferSyncInterface::kParseInvalidSize,
+ EXPECT_EQ(command_buffer::parse_error::kParseInvalidSize,
command_buffer_->ResetParseError());
EXPECT_TRUE(command_buffer_->GetErrorStatus());
}