| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/gles2_conform_support/egl/context.h" | 5 #include "gpu/gles2_conform_support/egl/context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 11 #include "gpu/command_buffer/client/gles2_lib.h" | 11 #include "gpu/command_buffer/client/gles2_lib.h" |
| 12 #include "gpu/command_buffer/client/shared_memory_limits.h" | 12 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 13 #include "gpu/command_buffer/client/transfer_buffer.h" | 13 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 14 #include "gpu/command_buffer/service/context_group.h" | 14 #include "gpu/command_buffer/service/context_group.h" |
| 15 #include "gpu/command_buffer/service/mailbox_manager.h" | 15 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 16 #include "gpu/command_buffer/service/memory_tracking.h" | 16 #include "gpu/command_buffer/service/memory_tracking.h" |
| 17 #include "gpu/command_buffer/service/progress_reporter.h" |
| 17 #include "gpu/command_buffer/service/transfer_buffer_manager.h" | 18 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
| 18 #include "gpu/gles2_conform_support/egl/config.h" | 19 #include "gpu/gles2_conform_support/egl/config.h" |
| 19 #include "gpu/gles2_conform_support/egl/display.h" | 20 #include "gpu/gles2_conform_support/egl/display.h" |
| 20 #include "gpu/gles2_conform_support/egl/surface.h" | 21 #include "gpu/gles2_conform_support/egl/surface.h" |
| 21 #include "gpu/gles2_conform_support/egl/thread_state.h" | 22 #include "gpu/gles2_conform_support/egl/thread_state.h" |
| 22 #include "ui/gl/init/gl_factory.h" | 23 #include "ui/gl/init/gl_factory.h" |
| 23 | 24 |
| 24 // The slight complexification in this file comes from following properties: | 25 // The slight complexification in this file comes from following properties: |
| 25 // 1) Command buffer connection (context) can not be established without a | 26 // 1) Command buffer connection (context) can not be established without a |
| 26 // GLSurface. EGL Context can be created independent of a surface. This is why | 27 // GLSurface. EGL Context can be created independent of a surface. This is why |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 transfer_buffer_manager->Initialize(); | 253 transfer_buffer_manager->Initialize(); |
| 253 | 254 |
| 254 std::unique_ptr<gpu::CommandBufferService> command_buffer( | 255 std::unique_ptr<gpu::CommandBufferService> command_buffer( |
| 255 new gpu::CommandBufferService(transfer_buffer_manager.get())); | 256 new gpu::CommandBufferService(transfer_buffer_manager.get())); |
| 256 | 257 |
| 257 scoped_refptr<gpu::gles2::FeatureInfo> feature_info( | 258 scoped_refptr<gpu::gles2::FeatureInfo> feature_info( |
| 258 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); | 259 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); |
| 259 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( | 260 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( |
| 260 gpu_preferences_, nullptr, nullptr, | 261 gpu_preferences_, nullptr, nullptr, |
| 261 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), | 262 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), |
| 262 new gpu::gles2::FramebufferCompletenessCache, feature_info, true, | 263 new gpu::gles2::FramebufferCompletenessCache, feature_info, true, nullptr, |
| 263 nullptr)); | 264 nullptr)); |
| 264 | 265 |
| 265 std::unique_ptr<gpu::gles2::GLES2Decoder> decoder( | 266 std::unique_ptr<gpu::gles2::GLES2Decoder> decoder( |
| 266 gpu::gles2::GLES2Decoder::Create(group.get())); | 267 gpu::gles2::GLES2Decoder::Create(group.get())); |
| 267 if (!decoder.get()) | 268 if (!decoder.get()) |
| 268 return false; | 269 return false; |
| 269 | 270 |
| 270 std::unique_ptr<gpu::CommandExecutor> command_executor( | 271 std::unique_ptr<gpu::CommandExecutor> command_executor( |
| 271 new gpu::CommandExecutor(command_buffer.get(), decoder.get(), | 272 new gpu::CommandExecutor(command_buffer.get(), decoder.get(), |
| 272 decoder.get())); | 273 decoder.get())); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 return false; | 389 return false; |
| 389 if (!gl_context_->MakeCurrent(gl_surface)) { | 390 if (!gl_context_->MakeCurrent(gl_surface)) { |
| 390 MarkServiceContextLost(); | 391 MarkServiceContextLost(); |
| 391 return false; | 392 return false; |
| 392 } | 393 } |
| 393 client_gl_context_->Flush(); | 394 client_gl_context_->Flush(); |
| 394 return true; | 395 return true; |
| 395 } | 396 } |
| 396 | 397 |
| 397 } // namespace egl | 398 } // namespace egl |
| OLD | NEW |