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/gles2_conform_support/egl/display.h" | 5 #include "gpu/gles2_conform_support/egl/display.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" |
14 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
15 #include "gpu/command_buffer/client/gles2_implementation.h" | 16 #include "gpu/command_buffer/client/gles2_implementation.h" |
16 #include "gpu/command_buffer/client/gles2_lib.h" | 17 #include "gpu/command_buffer/client/gles2_lib.h" |
17 #include "gpu/command_buffer/client/transfer_buffer.h" | 18 #include "gpu/command_buffer/client/transfer_buffer.h" |
18 #include "gpu/command_buffer/common/value_state.h" | 19 #include "gpu/command_buffer/common/value_state.h" |
19 #include "gpu/command_buffer/service/context_group.h" | 20 #include "gpu/command_buffer/service/context_group.h" |
20 #include "gpu/command_buffer/service/mailbox_manager.h" | 21 #include "gpu/command_buffer/service/mailbox_manager.h" |
21 #include "gpu/command_buffer/service/memory_tracking.h" | 22 #include "gpu/command_buffer/service/memory_tracking.h" |
22 #include "gpu/command_buffer/service/transfer_buffer_manager.h" | 23 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
23 #include "gpu/command_buffer/service/valuebuffer_manager.h" | 24 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 if (g_exit_manager_use_count == 0) { | 63 if (g_exit_manager_use_count == 0) { |
63 delete g_exit_manager; | 64 delete g_exit_manager; |
64 g_exit_manager = nullptr; | 65 g_exit_manager = nullptr; |
65 } | 66 } |
66 } | 67 } |
67 } | 68 } |
68 #endif | 69 #endif |
69 | 70 |
70 Display::Display(EGLNativeDisplayType display_id) | 71 Display::Display(EGLNativeDisplayType display_id) |
71 : display_id_(display_id), | 72 : display_id_(display_id), |
| 73 gpu_driver_bug_workarounds_(base::CommandLine::ForCurrentProcess()), |
72 is_initialized_(false), | 74 is_initialized_(false), |
73 create_offscreen_(false), | 75 create_offscreen_(false), |
74 create_offscreen_width_(0), | 76 create_offscreen_width_(0), |
75 create_offscreen_height_(0), | 77 create_offscreen_height_(0), |
76 next_fence_sync_release_(1) { | 78 next_fence_sync_release_(1) { |
77 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) | 79 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) |
78 RefAtExitManager(); | 80 RefAtExitManager(); |
79 #endif | 81 #endif |
80 } | 82 } |
81 | 83 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 gpu::TransferBufferManager* manager = | 160 gpu::TransferBufferManager* manager = |
159 new gpu::TransferBufferManager(nullptr); | 161 new gpu::TransferBufferManager(nullptr); |
160 transfer_buffer_manager_ = manager; | 162 transfer_buffer_manager_ = manager; |
161 manager->Initialize(); | 163 manager->Initialize(); |
162 } | 164 } |
163 scoped_ptr<gpu::CommandBufferService> command_buffer( | 165 scoped_ptr<gpu::CommandBufferService> command_buffer( |
164 new gpu::CommandBufferService(transfer_buffer_manager_.get())); | 166 new gpu::CommandBufferService(transfer_buffer_manager_.get())); |
165 if (!command_buffer->Initialize()) | 167 if (!command_buffer->Initialize()) |
166 return NULL; | 168 return NULL; |
167 | 169 |
| 170 scoped_refptr<gpu::gles2::FeatureInfo> feature_info( |
| 171 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); |
168 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( | 172 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( |
169 gpu_preferences_, NULL, NULL, | 173 gpu_preferences_, NULL, NULL, |
170 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), | 174 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), |
171 new gpu::gles2::FramebufferCompletenessCache, NULL, NULL, NULL, true)); | 175 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, |
| 176 true)); |
172 | 177 |
173 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); | 178 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); |
174 if (!decoder_.get()) | 179 if (!decoder_.get()) |
175 return EGL_NO_SURFACE; | 180 return EGL_NO_SURFACE; |
176 | 181 |
177 executor_.reset( | 182 executor_.reset( |
178 new gpu::CommandExecutor(command_buffer.get(), decoder_.get(), NULL)); | 183 new gpu::CommandExecutor(command_buffer.get(), decoder_.get(), NULL)); |
179 | 184 |
180 decoder_->set_engine(executor_.get()); | 185 decoder_->set_engine(executor_.get()); |
181 gfx::Size size(create_offscreen_width_, create_offscreen_height_); | 186 gfx::Size size(create_offscreen_width_, create_offscreen_height_); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, | 403 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, |
399 const base::Closure& callback) { | 404 const base::Closure& callback) { |
400 NOTIMPLEMENTED(); | 405 NOTIMPLEMENTED(); |
401 } | 406 } |
402 | 407 |
403 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 408 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
404 return false; | 409 return false; |
405 } | 410 } |
406 | 411 |
407 } // namespace egl | 412 } // namespace egl |
OLD | NEW |