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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2125023002: Reland "webgl: use immutable texture for the default FBO." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add GL_BGRA8_EXT Created 4 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 14360 matching lines...) Expand 10 before | Expand all | Expand 10 after
14371 GLenum dest_internal_format) { 14371 GLenum dest_internal_format) {
14372 GLenum source_type = 0; 14372 GLenum source_type = 0;
14373 GLenum source_internal_format = 0; 14373 GLenum source_internal_format = 0;
14374 Texture* source_texture = source_texture_ref->texture(); 14374 Texture* source_texture = source_texture_ref->texture();
14375 source_texture->GetLevelType(source_texture->target(), 0, &source_type, 14375 source_texture->GetLevelType(source_texture->target(), 0, &source_type,
14376 &source_internal_format); 14376 &source_internal_format);
14377 14377
14378 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, 14378 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA,
14379 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not 14379 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not
14380 // renderable on some platforms. 14380 // renderable on some platforms.
14381 bool valid_dest_format = dest_internal_format == GL_RGB || 14381 bool valid_dest_format =
14382 dest_internal_format == GL_RGBA || 14382 dest_internal_format == GL_RGB || dest_internal_format == GL_RGBA ||
14383 dest_internal_format == GL_BGRA_EXT; 14383 dest_internal_format == GL_RGB8 || dest_internal_format == GL_RGBA8 ||
14384 dest_internal_format == GL_BGRA_EXT ||
14385 dest_internal_format == GL_BGRA8_EXT;
14384 bool valid_source_format = 14386 bool valid_source_format =
14385 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || 14387 source_internal_format == GL_RED || source_internal_format == GL_ALPHA ||
14386 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || 14388 source_internal_format == GL_RGB || source_internal_format == GL_RGBA ||
14389 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 ||
14387 source_internal_format == GL_LUMINANCE || 14390 source_internal_format == GL_LUMINANCE ||
14388 source_internal_format == GL_LUMINANCE_ALPHA || 14391 source_internal_format == GL_LUMINANCE_ALPHA ||
14389 source_internal_format == GL_BGRA_EXT || 14392 source_internal_format == GL_BGRA_EXT ||
14393 source_internal_format == GL_BGRA8_EXT ||
14390 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || 14394 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM ||
14391 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; 14395 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM;
14392 if (!valid_source_format || !valid_dest_format) { 14396 if (!valid_source_format || !valid_dest_format) {
14393 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, 14397 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
14394 "invalid internal format"); 14398 "invalid internal format");
14395 return false; 14399 return false;
14396 } 14400 }
14397 return true; 14401 return true;
14398 } 14402 }
14399 14403
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after
17069 } 17073 }
17070 17074
17071 // Include the auto-generated part of this file. We split this because it means 17075 // Include the auto-generated part of this file. We split this because it means
17072 // we can easily edit the non-auto generated parts right here in this file 17076 // we can easily edit the non-auto generated parts right here in this file
17073 // instead of having to edit some template or the code generator. 17077 // instead of having to edit some template or the code generator.
17074 #include "base/macros.h" 17078 #include "base/macros.h"
17075 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17079 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17076 17080
17077 } // namespace gles2 17081 } // namespace gles2
17078 } // namespace gpu 17082 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698