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

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

Issue 2471853002: remove 'unsafe' from ES3 apis in gpu process (Closed)
Patch Set: forgot to save file Created 4 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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 .RetiresOnSaturation(); 734 .RetiresOnSaturation();
735 CopyTexImage2D cmd; 735 CopyTexImage2D cmd;
736 cmd.Init(target, level, internal_format, 0, 0, width, height); 736 cmd.Init(target, level, internal_format, 0, 0, width, height);
737 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 737 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
738 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError()); 738 EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
739 EXPECT_FALSE( 739 EXPECT_FALSE(
740 texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height, nullptr)); 740 texture->GetLevelSize(GL_TEXTURE_2D, level, &width, &height, nullptr));
741 } 741 }
742 742
743 TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) { 743 TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormat) {
744 base::CommandLine command_line(0, NULL);
745 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
746 InitState init; 744 InitState init;
747 init.gl_version = "OpenGL ES 3.0"; 745 init.gl_version = "OpenGL ES 3.0";
748 init.extensions = "GL_APPLE_texture_format_BGRA8888 GL_EXT_sRGB"; 746 init.extensions = "GL_APPLE_texture_format_BGRA8888 GL_EXT_sRGB";
749 init.has_alpha = true; 747 init.has_alpha = true;
750 init.request_alpha = true; 748 init.request_alpha = true;
751 init.bind_generates_resource = true; 749 init.bind_generates_resource = true;
752 init.context_type = CONTEXT_TYPE_OPENGLES2; 750 init.context_type = CONTEXT_TYPE_OPENGLES2;
753 InitDecoderWithCommandLine(init, &command_line); 751 InitDecoder(init);
754 752
755 GLenum kUnsizedInternalFormats[] = { 753 GLenum kUnsizedInternalFormats[] = {
756 GL_RED, 754 GL_RED,
757 GL_RG, 755 GL_RG,
758 GL_RGB, 756 GL_RGB,
759 GL_RGBA, 757 GL_RGBA,
760 GL_BGRA_EXT, 758 GL_BGRA_EXT,
761 GL_LUMINANCE, 759 GL_LUMINANCE,
762 GL_LUMINANCE_ALPHA, 760 GL_LUMINANCE_ALPHA,
763 GL_SRGB, 761 GL_SRGB,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 823 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
826 if (complete) { 824 if (complete) {
827 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 825 EXPECT_EQ(GL_NO_ERROR, GetGLError());
828 } else { 826 } else {
829 EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError()); 827 EXPECT_EQ(GL_INVALID_FRAMEBUFFER_OPERATION, GetGLError());
830 } 828 }
831 } 829 }
832 } 830 }
833 831
834 TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormatES3) { 832 TEST_P(GLES2DecoderManualInitTest, CopyTexImage2DUnsizedInternalFormatES3) {
835 base::CommandLine command_line(0, NULL);
836 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
837 InitState init; 833 InitState init;
838 init.gl_version = "OpenGL ES 3.0"; 834 init.gl_version = "OpenGL ES 3.0";
839 init.extensions = "GL_APPLE_texture_format_BGRA8888"; 835 init.extensions = "GL_APPLE_texture_format_BGRA8888";
840 init.has_alpha = true; 836 init.has_alpha = true;
841 init.request_alpha = true; 837 init.request_alpha = true;
842 init.bind_generates_resource = true; 838 init.bind_generates_resource = true;
843 init.context_type = CONTEXT_TYPE_OPENGLES3; 839 init.context_type = CONTEXT_TYPE_OPENGLES3;
844 InitDecoderWithCommandLine(init, &command_line); 840 InitDecoder(init);
845 841
846 struct UnsizedSizedInternalFormat { 842 struct UnsizedSizedInternalFormat {
847 GLenum unsized; 843 GLenum unsized;
848 GLenum sized; 844 GLenum sized;
849 }; 845 };
850 UnsizedSizedInternalFormat kUnsizedInternalFormats[] = { 846 UnsizedSizedInternalFormat kUnsizedInternalFormats[] = {
851 {GL_RED, GL_R8}, 847 {GL_RED, GL_R8},
852 {GL_RG, GL_RG8}, 848 {GL_RG, GL_RG8},
853 {GL_RGB, GL_RGB8}, 849 {GL_RGB, GL_RGB8},
854 {GL_RGBA, GL_RGBA8}, 850 {GL_RGBA, GL_RGBA8},
(...skipping 3832 matching lines...) Expand 10 before | Expand all | Expand 10 after
4687 // TODO(gman): CompressedTexSubImage2DImmediate 4683 // TODO(gman): CompressedTexSubImage2DImmediate
4688 4684
4689 // TODO(gman): TexImage2D 4685 // TODO(gman): TexImage2D
4690 4686
4691 // TODO(gman): TexImage2DImmediate 4687 // TODO(gman): TexImage2DImmediate
4692 4688
4693 // TODO(gman): TexSubImage2DImmediate 4689 // TODO(gman): TexSubImage2DImmediate
4694 4690
4695 } // namespace gles2 4691 } // namespace gles2
4696 } // namespace gpu 4692 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_programs.cc ('k') | gpu/command_buffer/service/gpu_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698