| 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/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 19 #include "base/memory/ref_counted_memory.h" | 19 #include "base/memory/ref_counted_memory.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 21 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 22 #include "gpu/command_buffer/client/gles2_implementation.h" | 22 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 23 #include "gpu/command_buffer/client/gles2_lib.h" | 23 #include "gpu/command_buffer/client/gles2_lib.h" |
| 24 #include "gpu/command_buffer/client/transfer_buffer.h" | 24 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 25 #include "gpu/command_buffer/common/constants.h" | 25 #include "gpu/command_buffer/common/constants.h" |
| 26 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 26 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 27 #include "gpu/command_buffer/common/sync_token.h" | 27 #include "gpu/command_buffer/common/sync_token.h" |
| 28 #include "gpu/command_buffer/common/value_state.h" | |
| 29 #include "gpu/command_buffer/service/command_buffer_service.h" | 28 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 30 #include "gpu/command_buffer/service/command_executor.h" | 29 #include "gpu/command_buffer/service/command_executor.h" |
| 31 #include "gpu/command_buffer/service/context_group.h" | 30 #include "gpu/command_buffer/service/context_group.h" |
| 32 #include "gpu/command_buffer/service/gl_context_virtual.h" | 31 #include "gpu/command_buffer/service/gl_context_virtual.h" |
| 33 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 32 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 34 #include "gpu/command_buffer/service/image_manager.h" | 33 #include "gpu/command_buffer/service/image_manager.h" |
| 35 #include "gpu/command_buffer/service/mailbox_manager_impl.h" | 34 #include "gpu/command_buffer/service/mailbox_manager_impl.h" |
| 36 #include "gpu/command_buffer/service/memory_tracking.h" | 35 #include "gpu/command_buffer/service/memory_tracking.h" |
| 37 #include "gpu/command_buffer/service/sync_point_manager.h" | 36 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 38 #include "gpu/command_buffer/service/transfer_buffer_manager.h" | 37 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
| 39 #include "gpu/command_buffer/service/valuebuffer_manager.h" | |
| 40 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 41 #include "ui/gfx/buffer_format_util.h" | 39 #include "ui/gfx/buffer_format_util.h" |
| 42 #include "ui/gfx/gpu_memory_buffer.h" | 40 #include "ui/gfx/gpu_memory_buffer.h" |
| 43 #include "ui/gl/gl_context.h" | 41 #include "ui/gl/gl_context.h" |
| 44 #include "ui/gl/gl_image_ref_counted_memory.h" | 42 #include "ui/gl/gl_image_ref_counted_memory.h" |
| 45 #include "ui/gl/gl_share_group.h" | 43 #include "ui/gl/gl_share_group.h" |
| 46 #include "ui/gl/gl_surface.h" | 44 #include "ui/gl/gl_surface.h" |
| 47 | 45 |
| 48 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
| 49 #include "ui/gfx/mac/io_surface.h" | 47 #include "ui/gfx/mac/io_surface.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 288 |
| 291 attrib_helper.Serialize(&attribs); | 289 attrib_helper.Serialize(&attribs); |
| 292 | 290 |
| 293 if (!context_group) { | 291 if (!context_group) { |
| 294 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); | 292 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); |
| 295 scoped_refptr<gles2::FeatureInfo> feature_info = | 293 scoped_refptr<gles2::FeatureInfo> feature_info = |
| 296 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); | 294 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); |
| 297 context_group = new gles2::ContextGroup( | 295 context_group = new gles2::ContextGroup( |
| 298 gpu_preferences_, mailbox_manager_.get(), NULL, | 296 gpu_preferences_, mailbox_manager_.get(), NULL, |
| 299 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), | 297 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), |
| 300 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, | 298 new gpu::gles2::FramebufferCompletenessCache, feature_info, |
| 301 options.bind_generates_resource); | 299 options.bind_generates_resource); |
| 302 } | 300 } |
| 303 | 301 |
| 304 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); | 302 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); |
| 305 if (options.force_shader_name_hashing) { | 303 if (options.force_shader_name_hashing) { |
| 306 decoder_->SetForceShaderNameHashingForTest(true); | 304 decoder_->SetForceShaderNameHashingForTest(true); |
| 307 } | 305 } |
| 308 command_buffer_.reset(new CommandBufferService( | 306 command_buffer_.reset(new CommandBufferService( |
| 309 decoder_->GetContextGroup()->transfer_buffer_manager())); | 307 decoder_->GetContextGroup()->transfer_buffer_manager())); |
| 310 ASSERT_TRUE(command_buffer_->Initialize()) | 308 ASSERT_TRUE(command_buffer_->Initialize()) |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 638 |
| 641 // Something went wrong, just run the callback now. | 639 // Something went wrong, just run the callback now. |
| 642 callback.Run(); | 640 callback.Run(); |
| 643 } | 641 } |
| 644 | 642 |
| 645 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 643 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
| 646 return false; | 644 return false; |
| 647 } | 645 } |
| 648 | 646 |
| 649 } // namespace gpu | 647 } // namespace gpu |
| OLD | NEW |