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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 using ::testing::SetArgumentPointee; | 47 using ::testing::SetArgumentPointee; |
48 using ::testing::SetArgPointee; | 48 using ::testing::SetArgPointee; |
49 using ::testing::StrEq; | 49 using ::testing::StrEq; |
50 using ::testing::StrictMock; | 50 using ::testing::StrictMock; |
51 | 51 |
52 namespace gpu { | 52 namespace gpu { |
53 namespace gles2 { | 53 namespace gles2 { |
54 | 54 |
55 using namespace cmds; | 55 using namespace cmds; |
56 | 56 |
57 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) { | 57 TEST_P(GLES2DecoderManualInitTest, AsyncPixelTransfers) { |
58 InitState init; | 58 InitState init; |
59 init.extensions = "GL_CHROMIUM_async_pixel_transfers"; | 59 init.extensions = "GL_CHROMIUM_async_pixel_transfers"; |
60 init.gl_version = "3.0"; | 60 init.gl_version = "3.0"; |
61 init.bind_generates_resource = true; | 61 init.bind_generates_resource = true; |
62 InitDecoder(init); | 62 InitDecoder(init); |
63 | 63 |
64 // Set up the texture. | 64 // Set up the texture. |
65 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 65 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
66 TextureRef* texture_ref = GetTexture(client_texture_id_); | 66 TextureRef* texture_ref = GetTexture(client_texture_id_); |
67 Texture* texture = texture_ref->texture(); | 67 Texture* texture = texture_ref->texture(); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 EXPECT_EQ(error::kNoError, ExecuteCmd(wait_all_cmd)); | 310 EXPECT_EQ(error::kNoError, ExecuteCmd(wait_all_cmd)); |
311 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 311 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
312 } | 312 } |
313 | 313 |
314 // Remove PixelTransferManager before the decoder destroys. | 314 // Remove PixelTransferManager before the decoder destroys. |
315 EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation(); | 315 EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation(); |
316 decoder_->ResetAsyncPixelTransferManagerForTest(); | 316 decoder_->ResetAsyncPixelTransferManagerForTest(); |
317 manager = NULL; | 317 manager = NULL; |
318 } | 318 } |
319 | 319 |
320 TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransferManager) { | 320 TEST_P(GLES2DecoderManualInitTest, AsyncPixelTransferManager) { |
321 InitState init; | 321 InitState init; |
322 init.extensions = "GL_CHROMIUM_async_pixel_transfers"; | 322 init.extensions = "GL_CHROMIUM_async_pixel_transfers"; |
323 init.gl_version = "3.0"; | 323 init.gl_version = "3.0"; |
324 init.bind_generates_resource = true; | 324 init.bind_generates_resource = true; |
325 InitDecoder(init); | 325 InitDecoder(init); |
326 | 326 |
327 // Set up the texture. | 327 // Set up the texture. |
328 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 328 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
329 TextureRef* texture_ref = GetTexture(client_texture_id_); | 329 TextureRef* texture_ref = GetTexture(client_texture_id_); |
330 | 330 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 manager = NULL; | 381 manager = NULL; |
382 | 382 |
383 // Texture ref still valid. | 383 // Texture ref still valid. |
384 EXPECT_EQ(texture_ref, GetTexture(client_texture_id_)); | 384 EXPECT_EQ(texture_ref, GetTexture(client_texture_id_)); |
385 EXPECT_EQ(texture_ref->num_observers(), 0); | 385 EXPECT_EQ(texture_ref->num_observers(), 0); |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 } // namespace gles2 | 389 } // namespace gles2 |
390 } // namespace gpu | 390 } // namespace gpu |
OLD | NEW |