summaryrefslogtreecommitdiffstats
path: root/gpu/pgl
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 17:05:13 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 17:05:13 +0000
commitb21265f88af52046652bfefe2909f048f0a3c2b8 (patch)
tree48830cbd442dc02192e3b17e0a40a8f8edd9fe82 /gpu/pgl
parentf39f4b3f8638814272875f37d8b6f574c86d2079 (diff)
downloadchromium_src-b21265f88af52046652bfefe2909f048f0a3c2b8.zip
chromium_src-b21265f88af52046652bfefe2909f048f0a3c2b8.tar.gz
chromium_src-b21265f88af52046652bfefe2909f048f0a3c2b8.tar.bz2
Step 1: Changing CommandBufferHelper to only use a portion
of the command buffer. This brought out the fact that there were lots of places in the code mixing size in bytes with num command buffer entries. This fixes most of those issues. No public interface uses num command buffer entries except gpu::CommandBuffer::State where it makes sense. TEST=relying on unit tests, conformance tests and chrome BUG=none Review URL: http://codereview.chromium.org/2008014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/pgl')
-rw-r--r--gpu/pgl/command_buffer_pepper.cc6
-rw-r--r--gpu/pgl/pgl.cc11
2 files changed, 8 insertions, 9 deletions
diff --git a/gpu/pgl/command_buffer_pepper.cc b/gpu/pgl/command_buffer_pepper.cc
index 6765f1e..53d67d2 100644
--- a/gpu/pgl/command_buffer_pepper.cc
+++ b/gpu/pgl/command_buffer_pepper.cc
@@ -63,7 +63,7 @@ CommandBuffer::State CommandBufferPepper::GetState() {
NULL);
CommandBuffer::State state;
- state.size = output_attribs[1];
+ state.num_entries = output_attribs[1];
state.get_offset = output_attribs[3];
state.put_offset = output_attribs[5];
state.token = output_attribs[7];
@@ -106,7 +106,7 @@ CommandBuffer::State CommandBufferPepper::Flush(int32 put_offset) {
NULL);
CommandBuffer::State state;
- state.size = output_attribs[1];
+ state.num_entries = output_attribs[1];
state.get_offset = output_attribs[3];
state.put_offset = output_attribs[5];
state.token = output_attribs[7];
@@ -181,7 +181,7 @@ gpu::error::Error CommandBufferPepper::GetCachedError() {
CommandBuffer::State CommandBufferPepper::ConvertState() {
CommandBuffer::State state;
- state.size = context_->commandBufferSize;
+ state.num_entries = context_->commandBufferSize;
state.get_offset = context_->getOffset;
state.put_offset = context_->putOffset;
state.token = context_->token;
diff --git a/gpu/pgl/pgl.cc b/gpu/pgl/pgl.cc
index b373478..c3b62f1 100644
--- a/gpu/pgl/pgl.cc
+++ b/gpu/pgl/pgl.cc
@@ -18,8 +18,8 @@ const int32 kTransferBufferSize = 512 * 1024;
class PGLContextImpl {
public:
PGLContextImpl(NPP npp,
- NPDevice* device,
- NPDeviceContext3D* device_context);
+ NPDevice* device,
+ NPDeviceContext3D* device_context);
~PGLContextImpl();
// Initlaize a PGL context with a transfer buffer of a particular size.
@@ -74,7 +74,8 @@ PGLBoolean PGLContextImpl::Initialize(int32 transfer_buffer_size) {
command_buffer_ = new CommandBufferPepper(
npp_, device_, device_context_);
gles2_helper_ = new gpu::gles2::GLES2CmdHelper(command_buffer_);
- if (gles2_helper_->Initialize()) {
+ gpu::Buffer buffer = command_buffer_->GetRingBuffer();
+ if (gles2_helper_->Initialize(buffer.size)) {
transfer_buffer_id_ =
command_buffer_->CreateTransferBuffer(kTransferBufferSize);
gpu::Buffer transfer_buffer =
@@ -131,8 +132,7 @@ PGLBoolean PGLContextImpl::MakeCurrent(PGLContextImpl* pgl_context) {
if (pgl_context->device_context_->error != NPDeviceContext3DError_NoError)
return PGL_FALSE;
#endif
- }
- else {
+ } else {
gles2::SetGLContext(NULL);
}
@@ -167,7 +167,6 @@ PGLInt PGLContextImpl::GetError() {
} // namespace anonymous
extern "C" {
-
PGLBoolean pglInitialize() {
if (g_pgl_context_key_allocated)
return PGL_TRUE;