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

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

Issue 1434453008: cc: Fix R_8 GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove GetResourceTextureTarget Created 5 years, 1 month 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
« no previous file with comments | « ui/gl/gl_image_io_surface.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/gl/gl_image_memory.h" 5 #include "ui/gl/gl_image_memory.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 "ui/gfx/buffer_format_util.h" 9 #include "ui/gfx/buffer_format_util.h"
10 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_bindings.h"
11 #include "ui/gl/gl_context.h" 11 #include "ui/gl/gl_context.h"
12 #include "ui/gl/gl_version_info.h" 12 #include "ui/gl/gl_version_info.h"
13 13
14 using gfx::BufferFormat; 14 using gfx::BufferFormat;
15 15
16 namespace gl { 16 namespace gl {
17 namespace { 17 namespace {
18 18
19 bool ValidInternalFormat(unsigned internalformat) { 19 bool ValidInternalFormat(unsigned internalformat) {
20 switch (internalformat) { 20 switch (internalformat) {
21 case GL_ATC_RGB_AMD: 21 case GL_ATC_RGB_AMD:
22 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: 22 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
23 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: 23 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
24 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: 24 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
25 case GL_ETC1_RGB8_OES: 25 case GL_ETC1_RGB8_OES:
26 case GL_R8: 26 case GL_RED:
27 case GL_RGB: 27 case GL_RGB:
28 case GL_RGBA: 28 case GL_RGBA:
29 case GL_BGRA_EXT: 29 case GL_BGRA_EXT:
30 return true; 30 return true;
31 default: 31 default:
32 return false; 32 return false;
33 } 33 }
34 } 34 }
35 35
36 bool ValidFormat(BufferFormat format) { 36 bool ValidFormat(BufferFormat format) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 return false; 364 return false;
365 } 365 }
366 366
367 // static 367 // static
368 unsigned GLImageMemory::GetInternalFormatForTesting(BufferFormat format) { 368 unsigned GLImageMemory::GetInternalFormatForTesting(BufferFormat format) {
369 DCHECK(ValidFormat(format)); 369 DCHECK(ValidFormat(format));
370 return TextureFormat(format); 370 return TextureFormat(format);
371 } 371 }
372 372
373 } // namespace gl 373 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_image_io_surface.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698