| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/client/gpu_memory_buffer_factory.h" | 5 #include "gpu/command_buffer/client/gpu_memory_buffer_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace gpu { | 9 namespace gpu { |
| 10 namespace gles2 { |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 GpuMemoryBuffer::Creator* g_gpu_memory_buffer_factory_ = NULL; | 13 GpuMemoryBuffer::Creator* g_gpu_memory_buffer_factory_ = NULL; |
| 13 } | 14 } |
| 14 | 15 |
| 15 const GpuMemoryBuffer::Creator& GetProcessDefaultGpuMemoryBufferFactory() { | 16 const GpuMemoryBuffer::Creator& GetProcessDefaultGpuMemoryBufferFactory() { |
| 17 DCHECK(g_gpu_memory_buffer_factory_ != NULL); |
| 16 return *g_gpu_memory_buffer_factory_; | 18 return *g_gpu_memory_buffer_factory_; |
| 17 } | 19 } |
| 18 | 20 |
| 19 void SetProcessDefaultGpuMemoryBufferFactory( | 21 void SetProcessDefaultGpuMemoryBufferFactory( |
| 20 const GpuMemoryBuffer::Creator& factory) { | 22 const GpuMemoryBuffer::Creator& factory) { |
| 21 DCHECK(g_gpu_memory_buffer_factory_ == NULL); | 23 DCHECK(g_gpu_memory_buffer_factory_ == NULL); |
| 24 // TODO(kaanb): move the ownership of this memory to android_webview |
| 22 g_gpu_memory_buffer_factory_ = new GpuMemoryBuffer::Creator(factory); | 25 g_gpu_memory_buffer_factory_ = new GpuMemoryBuffer::Creator(factory); |
| 23 } | 26 } |
| 24 | 27 |
| 28 } // namespace gles2 |
| 25 } // namespace gpu | 29 } // namespace gpu |
| OLD | NEW |