OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "android_webview/common/gpu_memory_buffer_factory_proxy.h" |
| 6 |
| 7 #include "android_webview/common/aw_switches.h" |
| 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" |
| 10 |
| 11 namespace android_webview { |
| 12 |
| 13 gfx::GpuMemoryBuffer::Create* g_pixel_buffer_factory_ = NULL; |
| 14 |
| 15 const gfx::GpuMemoryBuffer::Create& GetGpuMemoryBufferFactoryProxy() { |
| 16 return *g_pixel_buffer_factory_; |
| 17 } |
| 18 |
| 19 void SetGpuMemoryBufferFactoryProxy( |
| 20 const gfx::GpuMemoryBuffer::Create& factory) { |
| 21 DCHECK(g_pixel_buffer_factory_ == NULL); |
| 22 g_pixel_buffer_factory_ = |
| 23 CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseZeroCopyBuffers) |
| 24 ? new gfx::GpuMemoryBuffer::Create(factory) : NULL; |
| 25 } |
| 26 |
| 27 } // namespace android_webview |
OLD | NEW |