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

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

Issue 539703002: gpu: Make CopyTexture work with GL_BGRA_EXT destination textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update unit test Created 6 years, 3 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 <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 10048 matching lines...) Expand 10 before | Expand all | Expand 10 after
10059 } 10059 }
10060 10060
10061 GLenum source_type = 0; 10061 GLenum source_type = 0;
10062 GLenum source_internal_format = 0; 10062 GLenum source_internal_format = 0;
10063 source_texture->GetLevelType( 10063 source_texture->GetLevelType(
10064 source_texture->target(), 0, &source_type, &source_internal_format); 10064 source_texture->target(), 0, &source_type, &source_internal_format);
10065 10065
10066 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA, 10066 // The destination format should be GL_RGB, or GL_RGBA. GL_ALPHA,
10067 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not 10067 // GL_LUMINANCE, and GL_LUMINANCE_ALPHA are not supported because they are not
10068 // renderable on some platforms. 10068 // renderable on some platforms.
10069 bool valid_dest_format = 10069 bool valid_dest_format = internal_format == GL_RGB ||
10070 internal_format == GL_RGB || internal_format == GL_RGBA; 10070 internal_format == GL_RGBA ||
10071 internal_format == GL_BGRA_EXT;
10071 bool valid_source_format = source_internal_format == GL_ALPHA || 10072 bool valid_source_format = source_internal_format == GL_ALPHA ||
10072 source_internal_format == GL_RGB || 10073 source_internal_format == GL_RGB ||
10073 source_internal_format == GL_RGBA || 10074 source_internal_format == GL_RGBA ||
10074 source_internal_format == GL_LUMINANCE || 10075 source_internal_format == GL_LUMINANCE ||
10075 source_internal_format == GL_LUMINANCE_ALPHA || 10076 source_internal_format == GL_LUMINANCE_ALPHA ||
10076 source_internal_format == GL_BGRA_EXT; 10077 source_internal_format == GL_BGRA_EXT;
10077 if (!valid_source_format || !valid_dest_format) { 10078 if (!valid_source_format || !valid_dest_format) {
10078 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, 10079 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
10079 "glCopyTextureCHROMIUM", 10080 "glCopyTextureCHROMIUM",
10080 "invalid internal format"); 10081 "invalid internal format");
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
11016 } 11017 }
11017 } 11018 }
11018 11019
11019 // Include the auto-generated part of this file. We split this because it means 11020 // Include the auto-generated part of this file. We split this because it means
11020 // we can easily edit the non-auto generated parts right here in this file 11021 // we can easily edit the non-auto generated parts right here in this file
11021 // instead of having to edit some template or the code generator. 11022 // instead of having to edit some template or the code generator.
11022 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 11023 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
11023 11024
11024 } // namespace gles2 11025 } // namespace gles2
11025 } // namespace gpu 11026 } // 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