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

Side by Side Diff: gpu/command_buffer/service/image_factory.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
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/command_buffer/service/image_factory.h" 5 #include "gpu/command_buffer/service/image_factory.h"
6 6
7 #include "gpu/command_buffer/common/capabilities.h" 7 #include "gpu/command_buffer/common/capabilities.h"
8 #include "ui/gl/gl_bindings.h" 8 #include "ui/gl/gl_bindings.h"
9 9
10 namespace gpu { 10 namespace gpu {
11 11
12 ImageFactory::ImageFactory() { 12 ImageFactory::ImageFactory() {
13 } 13 }
14 14
15 ImageFactory::~ImageFactory() { 15 ImageFactory::~ImageFactory() {
16 } 16 }
17 17
18 // static 18 // static
19 gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat( 19 gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat(
20 unsigned internalformat) { 20 unsigned internalformat) {
21 switch (internalformat) { 21 switch (internalformat) {
22 case GL_R8: 22 case GL_RED:
23 return gfx::BufferFormat::R_8; 23 return gfx::BufferFormat::R_8;
24 case GL_RGB: 24 case GL_RGB:
25 return gfx::BufferFormat::BGRX_8888; 25 return gfx::BufferFormat::BGRX_8888;
26 case GL_RGBA: 26 case GL_RGBA:
27 return gfx::BufferFormat::RGBA_8888; 27 return gfx::BufferFormat::RGBA_8888;
28 case GL_BGRA_EXT: 28 case GL_BGRA_EXT:
29 return gfx::BufferFormat::BGRA_8888; 29 return gfx::BufferFormat::BGRA_8888;
30 case GL_ATC_RGB_AMD: 30 case GL_ATC_RGB_AMD:
31 return gfx::BufferFormat::ATC; 31 return gfx::BufferFormat::ATC;
32 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: 32 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return size.width() % 2 == 0 && size.height() % 2 == 0; 134 return size.width() % 2 == 0 && size.height() % 2 == 0;
135 case gfx::BufferFormat::UYVY_422: 135 case gfx::BufferFormat::UYVY_422:
136 return size.width() % 2 == 0; 136 return size.width() % 2 == 0;
137 } 137 }
138 138
139 NOTREACHED(); 139 NOTREACHED();
140 return false; 140 return false;
141 } 141 }
142 142
143 } // namespace gpu 143 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698