| Index: content/common/gpu/client/context_provider_command_buffer.cc
|
| diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
|
| index 338ab4331b5cde55ee9b2f08797ce4941ce1d0e4..65c1c75a0c71dc52c6ca71495679499447725ec5 100644
|
| --- a/content/common/gpu/client/context_provider_command_buffer.cc
|
| +++ b/content/common/gpu/client/context_provider_command_buffer.cc
|
| @@ -76,18 +76,21 @@ class ContextProviderCommandBuffer::MemoryAllocationCallbackProxy
|
| };
|
|
|
| scoped_refptr<ContextProviderCommandBuffer>
|
| -ContextProviderCommandBuffer::Create(const CreateCallback& create_callback) {
|
| - scoped_refptr<ContextProviderCommandBuffer> provider =
|
| - new ContextProviderCommandBuffer;
|
| - if (!provider->InitializeOnMainThread(create_callback))
|
| +ContextProviderCommandBuffer::Create(
|
| + scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d) {
|
| + if (!context3d)
|
| return NULL;
|
| - return provider;
|
| +
|
| + return new ContextProviderCommandBuffer(context3d.Pass());
|
| }
|
|
|
| -ContextProviderCommandBuffer::ContextProviderCommandBuffer()
|
| - : leak_on_destroy_(false),
|
| +ContextProviderCommandBuffer::ContextProviderCommandBuffer(
|
| + scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d)
|
| + : context3d_(context3d.Pass()),
|
| + leak_on_destroy_(false),
|
| destroyed_(false) {
|
| DCHECK(main_thread_checker_.CalledOnValidThread());
|
| + DCHECK(context3d_);
|
| context_thread_checker_.DetachFromThread();
|
| }
|
|
|
| @@ -104,16 +107,6 @@ ContextProviderCommandBuffer::~ContextProviderCommandBuffer() {
|
| }
|
| }
|
|
|
| -bool ContextProviderCommandBuffer::InitializeOnMainThread(
|
| - const CreateCallback& create_callback) {
|
| - DCHECK(main_thread_checker_.CalledOnValidThread());
|
| -
|
| - DCHECK(!context3d_);
|
| - DCHECK(!create_callback.is_null());
|
| - context3d_ = create_callback.Run();
|
| - return !!context3d_;
|
| -}
|
| -
|
| bool ContextProviderCommandBuffer::BindToCurrentThread() {
|
| DCHECK(context3d_);
|
|
|
|
|