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

Side by Side Diff: ui/gl/gl_utils.cc

Issue 1484473003: gl, ozone: enable GLImageBindTest unittests Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix for win and mac, but cros need crrev.com/1208603002 Created 4 years, 11 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/gl/gl_utils.h"
6
7 #include "ui/gl/gl_bindings.h"
8
9 namespace gl {
10
11 GLenum GetTextureFormatFrom(gfx::BufferFormat format) {
12 switch (format) {
13 case gfx::BufferFormat::ATC:
14 return GL_ATC_RGB_AMD;
15 case gfx::BufferFormat::ATCIA:
16 return GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD;
17 case gfx::BufferFormat::DXT1:
18 return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
19 case gfx::BufferFormat::DXT5:
20 return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
21 case gfx::BufferFormat::ETC1:
22 return GL_ETC1_RGB8_OES;
23 case gfx::BufferFormat::R_8:
24 return GL_RED;
25 case gfx::BufferFormat::RGBA_4444:
26 case gfx::BufferFormat::RGBA_8888:
27 return GL_RGBA;
28 case gfx::BufferFormat::BGRA_8888:
29 return GL_BGRA_EXT;
30 case gfx::BufferFormat::RGBX_8888:
31 case gfx::BufferFormat::BGRX_8888:
32 return GL_RGB;
33 case gfx::BufferFormat::YUV_420:
34 case gfx::BufferFormat::YUV_420_BIPLANAR:
35 case gfx::BufferFormat::UYVY_422:
36 NOTREACHED();
37 return 0;
38 }
39
40 NOTREACHED();
41 return 0;
42 }
43
44 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698