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

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

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

Powered by Google App Engine
This is Rietveld 408576698