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

Unified Diff: core/cross/command_buffer/buffer_cb.cc

Issue 150089: Fixing EffectTest.LogOpenGLCalls and cleaning up a line in DrawPassTest. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/cross/draw_pass_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/command_buffer/buffer_cb.cc
===================================================================
--- core/cross/command_buffer/buffer_cb.cc (revision 19210)
+++ core/cross/command_buffer/buffer_cb.cc (working copy)
@@ -47,7 +47,7 @@
: VertexBuffer(service_locator),
lock_pointer_(NULL),
has_data_(false),
- resource_id_(0),
+ resource_id_(command_buffer::kInvalidResource),
renderer_(renderer) {
}
@@ -58,12 +58,13 @@
// 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 @@
: IndexBuffer(service_locator),
lock_pointer_(NULL),
has_data_(false),
- resource_id_(0),
+ resource_id_(command_buffer::kInvalidResource),
renderer_(renderer) {
}
@@ -143,12 +144,13 @@
// 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;
}
}
« no previous file with comments | « no previous file | core/cross/draw_pass_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698