| 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 "ui/gfx/gpu_memory_buffer.h" | 9 #include "ui/gfx/gpu_memory_buffer.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 int err = g_gl_draw_functions->unmap(buffer_id_); | 55 int err = g_gl_draw_functions->unmap(buffer_id_); |
| 56 DCHECK(!err); | 56 DCHECK(!err); |
| 57 mapped_ = false; | 57 mapped_ = false; |
| 58 } | 58 } |
| 59 virtual bool IsMapped() const OVERRIDE { return mapped_; } | 59 virtual bool IsMapped() const OVERRIDE { return mapped_; } |
| 60 virtual uint32 GetStride() const OVERRIDE { | 60 virtual uint32 GetStride() const OVERRIDE { |
| 61 return g_gl_draw_functions->get_stride(buffer_id_); | 61 return g_gl_draw_functions->get_stride(buffer_id_); |
| 62 } | 62 } |
| 63 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE { | 63 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE { |
| 64 gfx::GpuMemoryBufferHandle handle; | 64 gfx::GpuMemoryBufferHandle handle; |
| 65 handle.type = gfx::EGL_CLIENT_BUFFER; | 65 handle.type = gfx::ANDROID_NATIVE_BUFFER; |
| 66 handle.native_buffer = g_gl_draw_functions->get_native_buffer(buffer_id_); | 66 handle.native_buffer = g_gl_draw_functions->get_native_buffer(buffer_id_); |
| 67 return handle; | 67 return handle; |
| 68 } | 68 } |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 long buffer_id_; | 71 long buffer_id_; |
| 72 gfx::Size size_; | 72 gfx::Size size_; |
| 73 bool mapped_; | 73 bool mapped_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); | 75 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 98 return new GpuMemoryBufferImpl(buffer_id, gfx::Size(width, height)); | 98 return new GpuMemoryBufferImpl(buffer_id, gfx::Size(width, height)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 // static | 101 // static |
| 102 void GpuMemoryBufferFactoryImpl::SetAwDrawGLFunctionTable( | 102 void GpuMemoryBufferFactoryImpl::SetAwDrawGLFunctionTable( |
| 103 AwDrawGLFunctionTable* table) { | 103 AwDrawGLFunctionTable* table) { |
| 104 g_gl_draw_functions = table; | 104 g_gl_draw_functions = table; |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace android_webview | 107 } // namespace android_webview |
| OLD | NEW |