OLD | NEW |
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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 .RetiresOnSaturation(); | 119 .RetiresOnSaturation(); |
120 GenerateMipmap cmd; | 120 GenerateMipmap cmd; |
121 cmd.Init(GL_TEXTURE_2D); | 121 cmd.Init(GL_TEXTURE_2D); |
122 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 122 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
123 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 123 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
124 } | 124 } |
125 | 125 |
126 // Same as GenerateMipmapClearsUnclearedTexture, but with workaround | 126 // Same as GenerateMipmapClearsUnclearedTexture, but with workaround |
127 // |set_texture_filters_before_generating_mipmap|. | 127 // |set_texture_filters_before_generating_mipmap|. |
128 TEST_P(GLES2DecoderManualInitTest, SetTextureFiltersBeforeGenerateMipmap) { | 128 TEST_P(GLES2DecoderManualInitTest, SetTextureFiltersBeforeGenerateMipmap) { |
129 CommandLine command_line(0, NULL); | 129 base::CommandLine command_line(0, NULL); |
130 command_line.AppendSwitchASCII( | 130 command_line.AppendSwitchASCII( |
131 switches::kGpuDriverBugWorkarounds, | 131 switches::kGpuDriverBugWorkarounds, |
132 base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP)); | 132 base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP)); |
133 InitState init; | 133 InitState init; |
134 init.gl_version = "3.0"; | 134 init.gl_version = "3.0"; |
135 init.bind_generates_resource = true; | 135 init.bind_generates_resource = true; |
136 InitDecoderWithCommandLine(init, &command_line); | 136 InitDecoderWithCommandLine(init, &command_line); |
137 | 137 |
138 EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); | 138 EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); |
139 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 139 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 GL_UNSIGNED_BYTE, | 1620 GL_UNSIGNED_BYTE, |
1621 shared_memory_address_)) | 1621 shared_memory_address_)) |
1622 .Times(1) | 1622 .Times(1) |
1623 .RetiresOnSaturation(); | 1623 .RetiresOnSaturation(); |
1624 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1624 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
1625 } | 1625 } |
1626 | 1626 |
1627 TEST_P( | 1627 TEST_P( |
1628 GLES2DecoderManualInitTest, | 1628 GLES2DecoderManualInitTest, |
1629 TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster)
{ | 1629 TexSubImage2DDoesNotClearAfterTexImage2DNULLThenDataWithTexImage2DIsFaster)
{ |
1630 CommandLine command_line(0, NULL); | 1630 base::CommandLine command_line(0, NULL); |
1631 command_line.AppendSwitchASCII( | 1631 command_line.AppendSwitchASCII( |
1632 switches::kGpuDriverBugWorkarounds, | 1632 switches::kGpuDriverBugWorkarounds, |
1633 base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D)); | 1633 base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D)); |
1634 InitState init; | 1634 InitState init; |
1635 init.gl_version = "3.0"; | 1635 init.gl_version = "3.0"; |
1636 init.bind_generates_resource = true; | 1636 init.bind_generates_resource = true; |
1637 InitDecoderWithCommandLine(init, &command_line); | 1637 InitDecoderWithCommandLine(init, &command_line); |
1638 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 1638 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
1639 DoTexImage2D( | 1639 DoTexImage2D( |
1640 GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); | 1640 GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); |
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 // TODO(gman): CompressedTexSubImage2DImmediate | 2833 // TODO(gman): CompressedTexSubImage2DImmediate |
2834 | 2834 |
2835 // TODO(gman): TexImage2D | 2835 // TODO(gman): TexImage2D |
2836 | 2836 |
2837 // TODO(gman): TexImage2DImmediate | 2837 // TODO(gman): TexImage2DImmediate |
2838 | 2838 |
2839 // TODO(gman): TexSubImage2DImmediate | 2839 // TODO(gman): TexSubImage2DImmediate |
2840 | 2840 |
2841 } // namespace gles2 | 2841 } // namespace gles2 |
2842 } // namespace gpu | 2842 } // namespace gpu |
OLD | NEW |