| Index: gpu/command_buffer/service/in_process_command_buffer.cc
|
| diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
|
| index da7433e51939a4186d49b2047d3291313f640d5d..497041aac1ab1f1fef605770451d0127ddd901d6 100644
|
| --- a/gpu/command_buffer/service/in_process_command_buffer.cc
|
| +++ b/gpu/command_buffer/service/in_process_command_buffer.cc
|
| @@ -47,8 +47,6 @@ namespace gpu {
|
|
|
| namespace {
|
|
|
| -static InProcessGpuMemoryBufferFactory* g_gpu_memory_buffer_factory = NULL;
|
| -
|
| template <typename T>
|
| static void RunTaskWithResult(base::Callback<T(void)> task,
|
| T* result,
|
| @@ -305,11 +303,9 @@ bool InProcessCommandBuffer::Initialize(
|
| base::Bind(&RunTaskWithResult<bool>, init_task, &result, &completion));
|
| completion.Wait();
|
|
|
| - if (result) {
|
| + if (result)
|
| capabilities_ = capabilities;
|
| - capabilities_.map_image =
|
| - capabilities_.map_image && g_gpu_memory_buffer_factory;
|
| - }
|
| +
|
| return result;
|
| }
|
|
|
| @@ -619,78 +615,12 @@ gfx::GpuMemoryBuffer* InProcessCommandBuffer::CreateGpuMemoryBuffer(
|
| unsigned internalformat,
|
| unsigned usage,
|
| int32* id) {
|
| - CheckSequencedThread();
|
| -
|
| - *id = -1;
|
| -
|
| - scoped_ptr<gfx::GpuMemoryBuffer> buffer =
|
| - g_gpu_memory_buffer_factory->AllocateGpuMemoryBuffer(
|
| - width, height, internalformat, usage);
|
| - if (!buffer.get())
|
| - return NULL;
|
| -
|
| - static int32 next_id = 1;
|
| - int32 new_id = next_id++;
|
| -
|
| - base::Closure task =
|
| - base::Bind(&InProcessCommandBuffer::RegisterGpuMemoryBufferOnGpuThread,
|
| - base::Unretained(this),
|
| - new_id,
|
| - buffer->GetHandle(),
|
| - width,
|
| - height,
|
| - internalformat);
|
| -
|
| - QueueTask(task);
|
| -
|
| - *id = new_id;
|
| - DCHECK(gpu_memory_buffers_.find(new_id) == gpu_memory_buffers_.end());
|
| - return gpu_memory_buffers_.add(new_id, buffer.Pass()).first->second;
|
| -}
|
| -
|
| -void InProcessCommandBuffer::RegisterGpuMemoryBufferOnGpuThread(
|
| - int32 id,
|
| - const gfx::GpuMemoryBufferHandle& handle,
|
| - size_t width,
|
| - size_t height,
|
| - unsigned internalformat) {
|
| - scoped_refptr<gfx::GLImage> image =
|
| - g_gpu_memory_buffer_factory->CreateImageForGpuMemoryBuffer(
|
| - handle, gfx::Size(width, height), internalformat);
|
| - if (!image.get())
|
| - return;
|
| -
|
| - // For Android specific workaround.
|
| - gles2::ContextGroup* context_group = decoder_->GetContextGroup();
|
| - if (context_group->feature_info()->workarounds().release_image_after_use)
|
| - image->SetReleaseAfterUse();
|
| -
|
| - if (decoder_) {
|
| - gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
|
| - DCHECK(image_manager);
|
| - image_manager->AddImage(image.get(), id);
|
| - }
|
| + NOTREACHED();
|
| + return NULL;
|
| }
|
|
|
| void InProcessCommandBuffer::DestroyGpuMemoryBuffer(int32 id) {
|
| - CheckSequencedThread();
|
| -
|
| - base::Closure task =
|
| - base::Bind(&InProcessCommandBuffer::UnregisterGpuMemoryBufferOnGpuThread,
|
| - base::Unretained(this),
|
| - id);
|
| -
|
| - QueueTask(task);
|
| -
|
| - gpu_memory_buffers_.erase(id);
|
| -}
|
| -
|
| -void InProcessCommandBuffer::UnregisterGpuMemoryBufferOnGpuThread(int32 id) {
|
| - if (decoder_) {
|
| - gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
|
| - DCHECK(image_manager);
|
| - image_manager->RemoveImage(id);
|
| - }
|
| + NOTREACHED();
|
| }
|
|
|
| uint32 InProcessCommandBuffer::InsertSyncPoint() {
|
| @@ -849,10 +779,4 @@ InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) {
|
| }
|
| #endif
|
|
|
| -// static
|
| -void InProcessCommandBuffer::SetGpuMemoryBufferFactory(
|
| - InProcessGpuMemoryBufferFactory* factory) {
|
| - g_gpu_memory_buffer_factory = factory;
|
| -}
|
| -
|
| } // namespace gpu
|
|
|