| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tests/gl_manager.h" | 5 #include "gpu/command_buffer/tests/gl_manager.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
| 16 #include "base/bind.h" | 16 #include "base/bind.h" |
| 17 #include "base/memory/ref_counted_memory.h" | 17 #include "base/memory/ref_counted_memory.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 19 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 20 #include "gpu/command_buffer/client/gles2_implementation.h" | 20 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 21 #include "gpu/command_buffer/client/gles2_lib.h" | 21 #include "gpu/command_buffer/client/gles2_lib.h" |
| 22 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 22 #include "gpu/command_buffer/client/transfer_buffer.h" | 23 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 23 #include "gpu/command_buffer/common/constants.h" | 24 #include "gpu/command_buffer/common/constants.h" |
| 24 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 25 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 25 #include "gpu/command_buffer/common/sync_token.h" | 26 #include "gpu/command_buffer/common/sync_token.h" |
| 26 #include "gpu/command_buffer/common/value_state.h" | 27 #include "gpu/command_buffer/common/value_state.h" |
| 27 #include "gpu/command_buffer/service/command_buffer_service.h" | 28 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 28 #include "gpu/command_buffer/service/command_executor.h" | 29 #include "gpu/command_buffer/service/command_executor.h" |
| 29 #include "gpu/command_buffer/service/context_group.h" | 30 #include "gpu/command_buffer/service/context_group.h" |
| 30 #include "gpu/command_buffer/service/gl_context_virtual.h" | 31 #include "gpu/command_buffer/service/gl_context_virtual.h" |
| 31 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 32 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 gles2_implementation_.reset( | 376 gles2_implementation_.reset( |
| 376 new gles2::GLES2Implementation(gles2_helper_.get(), | 377 new gles2::GLES2Implementation(gles2_helper_.get(), |
| 377 client_share_group, | 378 client_share_group, |
| 378 transfer_buffer_.get(), | 379 transfer_buffer_.get(), |
| 379 options.bind_generates_resource, | 380 options.bind_generates_resource, |
| 380 options.lose_context_when_out_of_memory, | 381 options.lose_context_when_out_of_memory, |
| 381 support_client_side_arrays, | 382 support_client_side_arrays, |
| 382 this)); | 383 this)); |
| 383 | 384 |
| 384 ASSERT_TRUE(gles2_implementation_->Initialize( | 385 ASSERT_TRUE(gles2_implementation_->Initialize( |
| 385 kStartTransferBufferSize, | 386 kStartTransferBufferSize, kMinTransferBufferSize, kMaxTransferBufferSize, |
| 386 kMinTransferBufferSize, | 387 SharedMemoryLimits::kNoLimit)) |
| 387 kMaxTransferBufferSize, | 388 << "Could not init GLES2Implementation"; |
| 388 gpu::gles2::GLES2Implementation::kNoLimit)) | |
| 389 << "Could not init GLES2Implementation"; | |
| 390 | 389 |
| 391 MakeCurrent(); | 390 MakeCurrent(); |
| 392 } | 391 } |
| 393 | 392 |
| 394 void GLManager::SetupBaseContext() { | 393 void GLManager::SetupBaseContext() { |
| 395 if (use_count_) { | 394 if (use_count_) { |
| 396 #if defined(OS_ANDROID) | 395 #if defined(OS_ANDROID) |
| 397 base_share_group_ = new scoped_refptr<gfx::GLShareGroup>( | 396 base_share_group_ = new scoped_refptr<gfx::GLShareGroup>( |
| 398 new gfx::GLShareGroup); | 397 new gfx::GLShareGroup); |
| 399 gfx::Size size(4, 4); | 398 gfx::Size size(4, 4); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 | 637 |
| 639 // Something went wrong, just run the callback now. | 638 // Something went wrong, just run the callback now. |
| 640 callback.Run(); | 639 callback.Run(); |
| 641 } | 640 } |
| 642 | 641 |
| 643 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 642 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
| 644 return false; | 643 return false; |
| 645 } | 644 } |
| 646 | 645 |
| 647 } // namespace gpu | 646 } // namespace gpu |
| OLD | NEW |