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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ipc/client/gpu_memory_buffer_impl_surface_texture.h" 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "gpu/ipc/common/android/surface_texture_manager.h" 10 #include "gpu/ipc/common/android/surface_texture_manager.h"
11 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 11 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
12 #include "ui/gfx/buffer_format_util.h" 12 #include "ui/gfx/buffer_format_util.h"
13 #include "ui/gl/android/surface_texture.h" 13 #include "ui/gl/android/surface_texture.h"
14 #include "ui/gl/gl_bindings.h" 14 #include "ui/gl/gl_bindings.h"
15 15
16 namespace gpu { 16 namespace gpu {
17 namespace { 17 namespace {
18 18
19 int WindowFormat(gfx::BufferFormat format) { 19 int WindowFormat(gfx::BufferFormat format) {
20 switch (format) { 20 switch (format) {
21 case gfx::BufferFormat::RGBA_8888: 21 case gfx::BufferFormat::RGBA_8888:
22 return WINDOW_FORMAT_RGBA_8888; 22 return WINDOW_FORMAT_RGBA_8888;
23 case gfx::BufferFormat::ATC: 23 case gfx::BufferFormat::ATC:
24 case gfx::BufferFormat::ATCIA: 24 case gfx::BufferFormat::ATCIA:
25 case gfx::BufferFormat::DXT1: 25 case gfx::BufferFormat::DXT1:
26 case gfx::BufferFormat::DXT5: 26 case gfx::BufferFormat::DXT5:
27 case gfx::BufferFormat::ETC1: 27 case gfx::BufferFormat::ETC1:
28 case gfx::BufferFormat::R_8: 28 case gfx::BufferFormat::R_8:
29 case gfx::BufferFormat::RG_88:
29 case gfx::BufferFormat::BGR_565: 30 case gfx::BufferFormat::BGR_565:
30 case gfx::BufferFormat::RGBA_4444: 31 case gfx::BufferFormat::RGBA_4444:
31 case gfx::BufferFormat::RGBX_8888: 32 case gfx::BufferFormat::RGBX_8888:
32 case gfx::BufferFormat::BGRX_8888: 33 case gfx::BufferFormat::BGRX_8888:
33 case gfx::BufferFormat::BGRA_8888: 34 case gfx::BufferFormat::BGRA_8888:
34 case gfx::BufferFormat::YVU_420: 35 case gfx::BufferFormat::YVU_420:
35 case gfx::BufferFormat::YUV_420_BIPLANAR: 36 case gfx::BufferFormat::YUV_420_BIPLANAR:
36 case gfx::BufferFormat::UYVY_422: 37 case gfx::BufferFormat::UYVY_422:
37 NOTREACHED(); 38 NOTREACHED();
38 return 0; 39 return 0;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 144
144 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSurfaceTexture::GetHandle() 145 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSurfaceTexture::GetHandle()
145 const { 146 const {
146 gfx::GpuMemoryBufferHandle handle; 147 gfx::GpuMemoryBufferHandle handle;
147 handle.type = gfx::SURFACE_TEXTURE_BUFFER; 148 handle.type = gfx::SURFACE_TEXTURE_BUFFER;
148 handle.id = id_; 149 handle.id = id_;
149 return handle; 150 return handle;
150 } 151 }
151 152
152 } // namespace gpu 153 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698