summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorrlp@google.com <rlp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-01 18:40:29 +0000
committerrlp@google.com <rlp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-01 18:40:29 +0000
commit14c55cab163d4e6d2406863e911da09fe3367aa3 (patch)
tree34f7b988572d4f6d4328f2b52627c181f0cf13bf /o3d
parent0d9048770144071061ef303dfacc6a81da012345 (diff)
downloadchromium_src-14c55cab163d4e6d2406863e911da09fe3367aa3.zip
chromium_src-14c55cab163d4e6d2406863e911da09fe3367aa3.tar.gz
chromium_src-14c55cab163d4e6d2406863e911da09fe3367aa3.tar.bz2
Fixing EffectTest.LogOpenGLCalls and cleaning up a line in DrawPassTest.
Review URL: http://codereview.chromium.org/150089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/core/cross/command_buffer/buffer_cb.cc10
-rw-r--r--o3d/core/cross/draw_pass_test.cc2
2 files changed, 7 insertions, 5 deletions
diff --git a/o3d/core/cross/command_buffer/buffer_cb.cc b/o3d/core/cross/command_buffer/buffer_cb.cc
index 93d6b27..0914abd 100644
--- a/o3d/core/cross/command_buffer/buffer_cb.cc
+++ b/o3d/core/cross/command_buffer/buffer_cb.cc
@@ -47,7 +47,7 @@ VertexBufferCB::VertexBufferCB(ServiceLocator* service_locator,
: VertexBuffer(service_locator),
lock_pointer_(NULL),
has_data_(false),
- resource_id_(0),
+ resource_id_(command_buffer::kInvalidResource),
renderer_(renderer) {
}
@@ -58,12 +58,13 @@ VertexBufferCB::~VertexBufferCB() {
// Sends the DESTROY_VERTEX_BUFFER command, and frees the ID from the allocator.
void VertexBufferCB::ConcreteFree() {
- if (GetSizeInBytes() != 0) {
+ if (resource_id_ != command_buffer::kInvalidResource) {
CommandBufferHelper *helper = renderer_->helper();
CommandBufferEntry args[1];
args[0].value_uint32 = resource_id_;
helper->AddCommand(command_buffer::DESTROY_VERTEX_BUFFER, 1, args);
renderer_->vertex_buffer_ids().FreeID(resource_id_);
+ resource_id_ = command_buffer::kInvalidResource;
}
}
@@ -132,7 +133,7 @@ IndexBufferCB::IndexBufferCB(ServiceLocator* service_locator,
: IndexBuffer(service_locator),
lock_pointer_(NULL),
has_data_(false),
- resource_id_(0),
+ resource_id_(command_buffer::kInvalidResource),
renderer_(renderer) {
}
@@ -143,12 +144,13 @@ IndexBufferCB::~IndexBufferCB() {
// Sends the DESTROY_INDEX_BUFFER command, and frees the ID from the allocator.
void IndexBufferCB::ConcreteFree() {
- if (GetSizeInBytes() != 0) {
+ if (resource_id_ != command_buffer::kInvalidResource) {
CommandBufferHelper *helper = renderer_->helper();
CommandBufferEntry args[1];
args[0].value_uint32 = resource_id_;
helper->AddCommand(command_buffer::DESTROY_INDEX_BUFFER, 1, args);
renderer_->index_buffer_ids().FreeID(resource_id_);
+ resource_id_ = command_buffer::kInvalidResource;
}
}
diff --git a/o3d/core/cross/draw_pass_test.cc b/o3d/core/cross/draw_pass_test.cc
index 3181b99..a82a39c 100644
--- a/o3d/core/cross/draw_pass_test.cc
+++ b/o3d/core/cross/draw_pass_test.cc
@@ -64,7 +64,7 @@ void DrawPassTest::SetUp() {
}
void DrawPassTest::TearDown() {
- pack_->Destroy();
+ object_manager_->DestroyPack(pack_);
delete transformation_context_;
}