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

Unified Diff: core/cross/command_buffer/renderer_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/render_surface_cb.cc ('k') | core/cross/command_buffer/sampler_cb.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/command_buffer/renderer_cb.cc
===================================================================
--- core/cross/command_buffer/renderer_cb.cc (revision 26638)
+++ core/cross/command_buffer/renderer_cb.cc (working copy)
@@ -187,38 +187,31 @@
uint32 buffers = (color_flag ? GAPIInterface::COLOR : 0) |
(depth_flag ? GAPIInterface::DEPTH : 0) |
(stencil_flag ? GAPIInterface::STENCIL : 0);
- command_buffer::CommandBufferEntry args[7];
- args[0].value_uint32 = buffers;
- args[1].value_float = color[0];
- args[2].value_float = color[1];
- args[3].value_float = color[2];
- args[4].value_float = color[3];
- args[5].value_float = depth;
- args[6].value_uint32 = stencil;
- helper_->AddCommand(command_buffer::CLEAR, 7, args);
+ helper_->Clear(buffers, color[0], color[1], color[2], color[3],
+ depth, stencil);
}
void RendererCB::PlatformSpecificEndDraw() {
}
-// Adds the BEGIN_FRAME command to the command buffer.
+// Adds the BeginFrame command to the command buffer.
bool RendererCB::PlatformSpecificStartRendering() {
// Any device issues are handled in the command buffer backend
DCHECK(helper_);
- helper_->AddCommand(command_buffer::BEGIN_FRAME, 0 , NULL);
+ helper_->BeginFrame();
return true;
}
-// Adds the END_FRAME command to the command buffer, and flushes the commands.
+// Adds the EndFrame command to the command buffer, and flushes the commands.
void RendererCB::PlatformSpecificFinishRendering() {
// Any device issues are handled in the command buffer backend
- helper_->AddCommand(command_buffer::END_FRAME, 0 , NULL);
+ helper_->EndFrame();
helper_->WaitForToken(frame_token_);
frame_token_ = helper_->InsertToken();
}
void RendererCB::PlatformSpecificPresent() {
- // TODO(gman): The END_FRAME command needs to be split into END_FRAME
+ // TODO(gman): The EndFrame command needs to be split into EndFrame
// and PRESENT.
}
@@ -231,14 +224,13 @@
down_cast<const RenderSurfaceCB*>(surface);
const RenderDepthStencilSurfaceCB* surface_depth_cb =
down_cast<const RenderDepthStencilSurfaceCB*>(surface_depth);
- command_buffer::CommandBufferEntry args[2];
- args[0].value_uint32 = surface_cb->resource_id();
- args[1].value_uint32 = surface_depth_cb->resource_id();
- helper_->AddCommand(command_buffer::SET_RENDER_SURFACE, 2, args);
+ helper_->SetRenderSurface(
+ surface_cb->resource_id(),
+ surface_depth_cb->resource_id());
}
void RendererCB::SetBackBufferPlatformSpecific() {
- helper_->AddCommand(command_buffer::SET_BACK_SURFACES, 0, NULL);
+ helper_->SetBackSurfaces();
}
// Creates a StreamBank, returning a platform specific implementation class.
@@ -314,14 +306,7 @@
int height,
float min_z,
float max_z) {
- command_buffer::CommandBufferEntry args[6];
- args[0].value_uint32 = left;
- args[1].value_uint32 = top;
- args[2].value_uint32 = width;
- args[3].value_uint32 = height;
- args[4].value_float = min_z;
- args[5].value_float = max_z;
- helper_->AddCommand(command_buffer::SET_VIEWPORT, 6, args);
+ helper_->SetViewport(left, top, width, height, min_z, max_z);
}
const int* RendererCB::GetRGBAUByteNSwizzleTable() {
« no previous file with comments | « core/cross/command_buffer/render_surface_cb.cc ('k') | core/cross/command_buffer/sampler_cb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698