diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 23:06:19 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 23:06:19 +0000 |
commit | 06b73aa26473f9ec6bec009d11329a10cad27350 (patch) | |
tree | 953a5ab22e1fd30e918a47a0eebd72860c0bad69 /gpu/gles2_conform_support | |
parent | d052176a98e0f9803b276dc43daa08b3fd310055 (diff) | |
download | chromium_src-06b73aa26473f9ec6bec009d11329a10cad27350.zip chromium_src-06b73aa26473f9ec6bec009d11329a10cad27350.tar.gz chromium_src-06b73aa26473f9ec6bec009d11329a10cad27350.tar.bz2 |
Revert "Revert 119430 - Make transferbuffer increase in size dynamically"
This reverts commit 2f38c45427c68fe731c1f5c05256b6c141a6a590.
BUG=101431
TEST=
TBR=apatrick@chromium.org
Review URL: http://codereview.chromium.org/9121057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/gles2_conform_support')
-rw-r--r-- | gpu/gles2_conform_support/egl/display.cc | 31 | ||||
-rw-r--r-- | gpu/gles2_conform_support/egl/display.h | 5 |
2 files changed, 18 insertions, 18 deletions
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc index 47fcd51..1b540f4 100644 --- a/gpu/gles2_conform_support/egl/display.cc +++ b/gpu/gles2_conform_support/egl/display.cc @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "gpu/command_buffer/client/gles2_lib.h" +#include "gpu/command_buffer/client/transfer_buffer.h" #include "gpu/command_buffer/service/context_group.h" #include "gpu/gles2_conform_support/egl/config.h" #include "gpu/gles2_conform_support/egl/surface.h" @@ -21,8 +22,7 @@ namespace egl { Display::Display(EGLNativeDisplayType display_id) : display_id_(display_id), - is_initialized_(false), - transfer_buffer_id_(-1) { + is_initialized_(false) { } Display::~Display() { @@ -131,15 +131,11 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config, if (!cmd_helper->Initialize(kCommandBufferSize)) return false; - int32 transfer_buffer_id = - command_buffer->CreateTransferBuffer(kTransferBufferSize, -1); - gpu::Buffer transfer_buffer = - command_buffer->GetTransferBuffer(transfer_buffer_id); - if (transfer_buffer.ptr == NULL) - return false; + scoped_ptr<gpu::TransferBuffer> transfer_buffer(new gpu::TransferBuffer( + cmd_helper.get())); command_buffer_.reset(command_buffer.release()); - transfer_buffer_id_ = transfer_buffer_id; + transfer_buffer_.reset(transfer_buffer.release()); gles2_cmd_helper_.reset(cmd_helper.release()); surface_.reset(new Surface(win)); @@ -171,23 +167,26 @@ EGLContext Display::CreateContext(EGLConfig config, EGLContext share_ctx, const EGLint* attrib_list) { DCHECK(IsValidConfig(config)); - // TODO(alokp): Command buffer does not support shared contexts. + // TODO(alokp): Add support for shared contexts. if (share_ctx != NULL) return EGL_NO_CONTEXT; DCHECK(command_buffer_ != NULL); - DCHECK(transfer_buffer_id_ != -1); - gpu::Buffer buffer = command_buffer_->GetTransferBuffer(transfer_buffer_id_); - DCHECK(buffer.ptr != NULL); + DCHECK(transfer_buffer_.get()); bool share_resources = share_ctx != NULL; context_.reset(new gpu::gles2::GLES2Implementation( gles2_cmd_helper_.get(), - buffer.size, - buffer.ptr, - transfer_buffer_id_, + transfer_buffer_.get(), share_resources, true)); + if (!context_->Initialize( + kTransferBufferSize / 2, + kTransferBufferSize, + kTransferBufferSize * 2)) { + return EGL_NO_CONTEXT; + } + context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); context_->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs"); diff --git a/gpu/gles2_conform_support/egl/display.h b/gpu/gles2_conform_support/egl/display.h index 19571b3..f7e20e8 100644 --- a/gpu/gles2_conform_support/egl/display.h +++ b/gpu/gles2_conform_support/egl/display.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,6 +19,7 @@ namespace gpu { class CommandBufferService; class GpuScheduler; +class TransferBuffer; namespace gles2 { class GLES2CmdHelper; @@ -71,7 +72,7 @@ class Display { scoped_refptr<gfx::GLContext> gl_context_; scoped_refptr<gfx::GLSurface> gl_surface_; scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_cmd_helper_; - int32 transfer_buffer_id_; + scoped_ptr<gpu::TransferBuffer> transfer_buffer_; // TODO(alokp): Support more than one config, surface, and context. scoped_ptr<Config> config_; |