| 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 "android_webview/browser/gpu_memory_buffer_factory_impl.h" | 5 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" |
| 6 | 6 |
| 7 #include "android_webview/public/browser/draw_gl.h" | 7 #include "android_webview/public/browser/draw_gl.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 9 #include "ui/gfx/gpu_memory_buffer.h" | 10 #include "ui/gfx/gpu_memory_buffer.h" |
| 10 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 11 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
| 12 #include "ui/gl/gl_image_android_native_buffer.h" | 13 #include "ui/gl/gl_image_android_native_buffer.h" |
| 13 | 14 |
| 14 namespace android_webview { | 15 namespace android_webview { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // Provides hardware rendering functions from the Android glue layer. | 19 // Provides hardware rendering functions from the Android glue layer. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 106 |
| 106 return image; | 107 return image; |
| 107 } | 108 } |
| 108 | 109 |
| 109 // static | 110 // static |
| 110 void GpuMemoryBufferFactoryImpl::SetAwDrawGLFunctionTable( | 111 void GpuMemoryBufferFactoryImpl::SetAwDrawGLFunctionTable( |
| 111 AwDrawGLFunctionTable* table) { | 112 AwDrawGLFunctionTable* table) { |
| 112 g_gl_draw_functions = table; | 113 g_gl_draw_functions = table; |
| 113 } | 114 } |
| 114 | 115 |
| 116 bool GpuMemoryBufferFactoryImpl::Initialize() { |
| 117 if (!g_gl_draw_functions) |
| 118 return false; |
| 119 |
| 120 gpu::InProcessCommandBuffer::SetGpuMemoryBufferFactory(this); |
| 121 return true; |
| 122 } |
| 123 |
| 115 } // namespace android_webview | 124 } // namespace android_webview |
| OLD | NEW |