Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: android_webview/browser/gpu_memory_buffer_factory_impl.cc

Issue 212933009: ui: Refactor GLImageEGL for usage by targets other than EGL_NATIVE_BUFFER_ANDROID. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/gpu_memory_buffer.h » ('j') | ui/gl/gl_image_android_native_buffer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/gpu_memory_buffer.h » ('j') | ui/gl/gl_image_android_native_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698