| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_P(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"; | |
| 61 init.bind_generates_resource = true; | 60 init.bind_generates_resource = true; |
| 62 InitDecoder(init); | 61 InitDecoder(init); |
| 63 | 62 |
| 64 // Set up the texture. | 63 // Set up the texture. |
| 65 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 64 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 66 TextureRef* texture_ref = GetTexture(client_texture_id_); | 65 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 67 Texture* texture = texture_ref->texture(); | 66 Texture* texture = texture_ref->texture(); |
| 68 | 67 |
| 69 // Set a mock Async delegate | 68 // Set a mock Async delegate |
| 70 StrictMock<gpu::MockAsyncPixelTransferManager>* manager = | 69 StrictMock<gpu::MockAsyncPixelTransferManager>* manager = |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 311 |
| 313 // Remove PixelTransferManager before the decoder destroys. | 312 // Remove PixelTransferManager before the decoder destroys. |
| 314 EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation(); | 313 EXPECT_CALL(*delegate, Destroy()).RetiresOnSaturation(); |
| 315 decoder_->ResetAsyncPixelTransferManagerForTest(); | 314 decoder_->ResetAsyncPixelTransferManagerForTest(); |
| 316 manager = NULL; | 315 manager = NULL; |
| 317 } | 316 } |
| 318 | 317 |
| 319 TEST_P(GLES2DecoderManualInitTest, AsyncPixelTransferManager) { | 318 TEST_P(GLES2DecoderManualInitTest, AsyncPixelTransferManager) { |
| 320 InitState init; | 319 InitState init; |
| 321 init.extensions = "GL_CHROMIUM_async_pixel_transfers"; | 320 init.extensions = "GL_CHROMIUM_async_pixel_transfers"; |
| 322 init.gl_version = "3.0"; | |
| 323 init.bind_generates_resource = true; | 321 init.bind_generates_resource = true; |
| 324 InitDecoder(init); | 322 InitDecoder(init); |
| 325 | 323 |
| 326 // Set up the texture. | 324 // Set up the texture. |
| 327 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 325 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 328 TextureRef* texture_ref = GetTexture(client_texture_id_); | 326 TextureRef* texture_ref = GetTexture(client_texture_id_); |
| 329 | 327 |
| 330 // Set a mock Async delegate. | 328 // Set a mock Async delegate. |
| 331 StrictMock<gpu::MockAsyncPixelTransferManager>* manager = | 329 StrictMock<gpu::MockAsyncPixelTransferManager>* manager = |
| 332 new StrictMock<gpu::MockAsyncPixelTransferManager>; | 330 new StrictMock<gpu::MockAsyncPixelTransferManager>; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 manager = NULL; | 377 manager = NULL; |
| 380 | 378 |
| 381 // Texture ref still valid. | 379 // Texture ref still valid. |
| 382 EXPECT_EQ(texture_ref, GetTexture(client_texture_id_)); | 380 EXPECT_EQ(texture_ref, GetTexture(client_texture_id_)); |
| 383 EXPECT_EQ(texture_ref->num_observers(), 0); | 381 EXPECT_EQ(texture_ref->num_observers(), 0); |
| 384 } | 382 } |
| 385 } | 383 } |
| 386 | 384 |
| 387 } // namespace gles2 | 385 } // namespace gles2 |
| 388 } // namespace gpu | 386 } // namespace gpu |
| OLD | NEW |