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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc

Issue 1415723006: ui: Add RGBX_8888 buffer format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gles but no conversion needed case Created 5 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 "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h" 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "content/common/android/surface_texture_manager.h" 9 #include "content/common/android/surface_texture_manager.h"
10 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" 10 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h"
11 #include "ui/gfx/buffer_format_util.h" 11 #include "ui/gfx/buffer_format_util.h"
12 #include "ui/gl/android/surface_texture.h" 12 #include "ui/gl/android/surface_texture.h"
13 #include "ui/gl/gl_bindings.h" 13 #include "ui/gl/gl_bindings.h"
14 14
15 namespace content { 15 namespace content {
16 namespace { 16 namespace {
17 17
18 int WindowFormat(gfx::BufferFormat format) { 18 int WindowFormat(gfx::BufferFormat format) {
19 switch (format) { 19 switch (format) {
20 case gfx::BufferFormat::RGBA_8888: 20 case gfx::BufferFormat::RGBA_8888:
21 return WINDOW_FORMAT_RGBA_8888; 21 return WINDOW_FORMAT_RGBA_8888;
22 case gfx::BufferFormat::ATC: 22 case gfx::BufferFormat::ATC:
23 case gfx::BufferFormat::ATCIA: 23 case gfx::BufferFormat::ATCIA:
24 case gfx::BufferFormat::DXT1: 24 case gfx::BufferFormat::DXT1:
25 case gfx::BufferFormat::DXT5: 25 case gfx::BufferFormat::DXT5:
26 case gfx::BufferFormat::ETC1: 26 case gfx::BufferFormat::ETC1:
27 case gfx::BufferFormat::R_8: 27 case gfx::BufferFormat::R_8:
28 case gfx::BufferFormat::RGBA_4444: 28 case gfx::BufferFormat::RGBA_4444:
29 case gfx::BufferFormat::RGBX_8888:
29 case gfx::BufferFormat::BGRX_8888: 30 case gfx::BufferFormat::BGRX_8888:
30 case gfx::BufferFormat::BGRA_8888: 31 case gfx::BufferFormat::BGRA_8888:
31 case gfx::BufferFormat::YUV_420: 32 case gfx::BufferFormat::YUV_420:
32 case gfx::BufferFormat::YUV_420_BIPLANAR: 33 case gfx::BufferFormat::YUV_420_BIPLANAR:
33 case gfx::BufferFormat::UYVY_422: 34 case gfx::BufferFormat::UYVY_422:
34 NOTREACHED(); 35 NOTREACHED();
35 return 0; 36 return 0;
36 } 37 }
37 38
38 NOTREACHED(); 39 NOTREACHED();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 142
142 gfx::GpuMemoryBufferHandle 143 gfx::GpuMemoryBufferHandle
143 GpuMemoryBufferImplSurfaceTexture::GetHandle() const { 144 GpuMemoryBufferImplSurfaceTexture::GetHandle() const {
144 gfx::GpuMemoryBufferHandle handle; 145 gfx::GpuMemoryBufferHandle handle;
145 handle.type = gfx::SURFACE_TEXTURE_BUFFER; 146 handle.type = gfx::SURFACE_TEXTURE_BUFFER;
146 handle.id = id_; 147 handle.id = id_;
147 return handle; 148 return handle;
148 } 149 }
149 150
150 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698