summaryrefslogtreecommitdiffstats
path: root/gpu/pgl/pgl.cc
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/pgl.cc
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/pgl.cc')
-rw-r--r--gpu/pgl/pgl.cc11
1 files changed, 5 insertions, 6 deletions
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;