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

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

Issue 212018: Change command buffer client code to use structures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 3 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 | « core/cross/command_buffer/param_cache_cb.cc ('k') | core/cross/command_buffer/render_surface_cb.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/command_buffer/primitive_cb.cc
===================================================================
--- core/cross/command_buffer/primitive_cb.cc (revision 26638)
+++ core/cross/command_buffer/primitive_cb.cc (working copy)
@@ -112,8 +112,7 @@
IndexBufferCB *index_buffer_cb =
down_cast<IndexBufferCB *>(index_buffer());
if (!index_buffer_cb) {
- // TODO: draw non-index in this case ? we don't do it currently on
- // other platforms, so keep compatibility.
+ // TODO(gman): draw non-indexed primitives.
DLOG(INFO) << "Trying to draw with an empty index buffer.";
return;
}
@@ -130,23 +129,15 @@
stream_bank_cb->BindStreamsForRendering();
CommandBufferHelper *helper = renderer_->helper();
- CommandBufferEntry args[6];
// Sets current effect.
// TODO: cache current effect ?
- args[0].value_uint32 = effect_cb->resource_id();
- helper->AddCommand(command_buffer::SET_EFFECT, 1, args);
+ helper->SetEffect(effect_cb->resource_id());
param_cache_cb->RunHandlers(helper);
-
// Draws.
- args[0].value_uint32 = cb_primitive_type;
- args[1].value_uint32 = index_buffer_cb->resource_id();
- args[2].value_uint32 = 0; // first index.
- args[3].value_uint32 = number_primitives_; // primitive count.
- args[4].value_uint32 = 0; // min index.
- args[5].value_uint32 = number_vertices_ - 1; // max index.
- helper->AddCommand(command_buffer::DRAW_INDEXED, 6, args);
+ helper->DrawIndexed(cb_primitive_type, index_buffer_cb->resource_id(),
+ 0, number_primitives_, 0, number_vertices_ - 1);
}
} // namespace o3d
« no previous file with comments | « core/cross/command_buffer/param_cache_cb.cc ('k') | core/cross/command_buffer/render_surface_cb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698