| 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> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 share_group_manager(NULL), | 180 share_group_manager(NULL), |
| 181 share_mailbox_manager(NULL), | 181 share_mailbox_manager(NULL), |
| 182 virtual_manager(NULL), | 182 virtual_manager(NULL), |
| 183 bind_generates_resource(false), | 183 bind_generates_resource(false), |
| 184 lose_context_when_out_of_memory(false), | 184 lose_context_when_out_of_memory(false), |
| 185 context_lost_allowed(false), | 185 context_lost_allowed(false), |
| 186 context_type(gles2::CONTEXT_TYPE_OPENGLES2), | 186 context_type(gles2::CONTEXT_TYPE_OPENGLES2), |
| 187 force_shader_name_hashing(false), | 187 force_shader_name_hashing(false), |
| 188 multisampled(false), | 188 multisampled(false), |
| 189 backbuffer_alpha(true), | 189 backbuffer_alpha(true), |
| 190 image_factory(nullptr), | 190 image_factory(nullptr) {} |
| 191 enable_arb_texture_rectangle(false) {} | |
| 192 | 191 |
| 193 GLManager::GLManager() | 192 GLManager::GLManager() |
| 194 : sync_point_manager_(nullptr), | 193 : sync_point_manager_(nullptr), |
| 195 context_lost_allowed_(false), | 194 context_lost_allowed_(false), |
| 196 pause_commands_(false), | 195 pause_commands_(false), |
| 197 paused_order_num_(0), | 196 paused_order_num_(0), |
| 198 command_buffer_id_( | 197 command_buffer_id_( |
| 199 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id++)), | 198 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id++)), |
| 200 next_fence_sync_release_(1) { | 199 next_fence_sync_release_(1) { |
| 201 SetupBaseContext(); | 200 SetupBaseContext(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 attribs.sample_buffers = options.multisampled ? 1 : 0; | 290 attribs.sample_buffers = options.multisampled ? 1 : 0; |
| 292 attribs.alpha_size = options.backbuffer_alpha ? 8 : 0; | 291 attribs.alpha_size = options.backbuffer_alpha ? 8 : 0; |
| 293 attribs.should_use_native_gmb_for_backbuffer = | 292 attribs.should_use_native_gmb_for_backbuffer = |
| 294 options.image_factory != nullptr; | 293 options.image_factory != nullptr; |
| 295 attribs.offscreen_framebuffer_size = options.size; | 294 attribs.offscreen_framebuffer_size = options.size; |
| 296 | 295 |
| 297 if (!context_group) { | 296 if (!context_group) { |
| 298 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); | 297 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); |
| 299 scoped_refptr<gles2::FeatureInfo> feature_info = | 298 scoped_refptr<gles2::FeatureInfo> feature_info = |
| 300 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); | 299 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); |
| 301 if (options.enable_arb_texture_rectangle) { | |
| 302 gles2::FeatureInfo::FeatureFlags& flags = | |
| 303 const_cast<gles2::FeatureInfo::FeatureFlags&>( | |
| 304 feature_info->feature_flags()); | |
| 305 flags.arb_texture_rectangle = true; | |
| 306 } | |
| 307 context_group = new gles2::ContextGroup( | 300 context_group = new gles2::ContextGroup( |
| 308 gpu_preferences_, mailbox_manager_.get(), NULL, | 301 gpu_preferences_, mailbox_manager_.get(), NULL, |
| 309 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), | 302 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), |
| 310 new gpu::gles2::FramebufferCompletenessCache, feature_info, | 303 new gpu::gles2::FramebufferCompletenessCache, feature_info, |
| 311 options.bind_generates_resource, options.image_factory); | 304 options.bind_generates_resource, options.image_factory); |
| 312 } | 305 } |
| 313 | 306 |
| 314 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); | 307 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); |
| 315 if (options.force_shader_name_hashing) { | 308 if (options.force_shader_name_hashing) { |
| 316 decoder_->SetForceShaderNameHashingForTest(true); | 309 decoder_->SetForceShaderNameHashingForTest(true); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 | 646 |
| 654 // Something went wrong, just run the callback now. | 647 // Something went wrong, just run the callback now. |
| 655 callback.Run(); | 648 callback.Run(); |
| 656 } | 649 } |
| 657 | 650 |
| 658 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 651 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
| 659 return false; | 652 return false; |
| 660 } | 653 } |
| 661 | 654 |
| 662 } // namespace gpu | 655 } // namespace gpu |
| OLD | NEW |