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

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: m_webGLVersion > WebGL1 (for future versions) 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
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14378 matching lines...) Expand 10 before | Expand all | Expand 10 after
14389 GLenum dest_internal_format) { 14389 GLenum dest_internal_format) {
14390 GLenum source_type = 0; 14390 GLenum source_type = 0;
14391 GLenum source_internal_format = 0; 14391 GLenum source_internal_format = 0;
14392 Texture* source_texture = source_texture_ref->texture(); 14392 Texture* source_texture = source_texture_ref->texture();
14393 source_texture->GetLevelType(source_texture->target(), 0, &source_type, 14393 source_texture->GetLevelType(source_texture->target(), 0, &source_type,
14394 &source_internal_format); 14394 &source_internal_format);
14395 14395
14396 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, 14396 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA,
14397 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not 14397 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not
14398 // renderable on some platforms. 14398 // renderable on some platforms.
14399 bool valid_dest_format = dest_internal_format == GL_RGB || 14399 bool valid_dest_format =
14400 dest_internal_format == GL_RGBA || 14400 dest_internal_format == GL_RGB || dest_internal_format == GL_RGBA ||
14401 dest_internal_format == GL_BGRA_EXT; 14401 dest_internal_format == GL_RGB8 || dest_internal_format == GL_RGBA8 ||
14402 dest_internal_format == GL_BGRA_EXT ||
14403 dest_internal_format == GL_BGRA8_EXT;
14402 bool valid_source_format = 14404 bool valid_source_format =
14403 source_internal_format == GL_RED || source_internal_format == GL_ALPHA || 14405 source_internal_format == GL_RED || source_internal_format == GL_ALPHA ||
14404 source_internal_format == GL_RGB || source_internal_format == GL_RGBA || 14406 source_internal_format == GL_RGB || source_internal_format == GL_RGBA ||
14407 source_internal_format == GL_RGB8 || source_internal_format == GL_RGBA8 ||
14405 source_internal_format == GL_LUMINANCE || 14408 source_internal_format == GL_LUMINANCE ||
14406 source_internal_format == GL_LUMINANCE_ALPHA || 14409 source_internal_format == GL_LUMINANCE_ALPHA ||
14407 source_internal_format == GL_BGRA_EXT || 14410 source_internal_format == GL_BGRA_EXT ||
14411 source_internal_format == GL_BGRA8_EXT ||
14408 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || 14412 source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM ||
14409 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; 14413 source_internal_format == GL_RGB_YCBCR_422_CHROMIUM;
14410 if (!valid_source_format || !valid_dest_format) { 14414 if (!valid_source_format || !valid_dest_format) {
14411 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, 14415 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
14412 "invalid internal format"); 14416 "invalid internal format");
14413 return false; 14417 return false;
14414 } 14418 }
14415 return true; 14419 return true;
14416 } 14420 }
14417 14421
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after
17087 } 17091 }
17088 17092
17089 // Include the auto-generated part of this file. We split this because it means 17093 // Include the auto-generated part of this file. We split this because it means
17090 // we can easily edit the non-auto generated parts right here in this file 17094 // we can easily edit the non-auto generated parts right here in this file
17091 // instead of having to edit some template or the code generator. 17095 // instead of having to edit some template or the code generator.
17092 #include "base/macros.h" 17096 #include "base/macros.h"
17093 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17097 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17094 17098
17095 } // namespace gles2 17099 } // namespace gles2
17096 } // namespace gpu 17100 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698