| 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> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // We do not support more than one window surface. | 155 // We do not support more than one window surface. |
| 156 return EGL_NO_SURFACE; | 156 return EGL_NO_SURFACE; |
| 157 } | 157 } |
| 158 | 158 |
| 159 { | 159 { |
| 160 gpu::TransferBufferManager* manager = | 160 gpu::TransferBufferManager* manager = |
| 161 new gpu::TransferBufferManager(nullptr); | 161 new gpu::TransferBufferManager(nullptr); |
| 162 transfer_buffer_manager_ = manager; | 162 transfer_buffer_manager_ = manager; |
| 163 manager->Initialize(); | 163 manager->Initialize(); |
| 164 } | 164 } |
| 165 scoped_ptr<gpu::CommandBufferService> command_buffer( | 165 std::unique_ptr<gpu::CommandBufferService> command_buffer( |
| 166 new gpu::CommandBufferService(transfer_buffer_manager_.get())); | 166 new gpu::CommandBufferService(transfer_buffer_manager_.get())); |
| 167 if (!command_buffer->Initialize()) | 167 if (!command_buffer->Initialize()) |
| 168 return NULL; | 168 return NULL; |
| 169 | 169 |
| 170 scoped_refptr<gpu::gles2::FeatureInfo> feature_info( | 170 scoped_refptr<gpu::gles2::FeatureInfo> feature_info( |
| 171 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); | 171 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); |
| 172 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( | 172 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( |
| 173 gpu_preferences_, NULL, NULL, | 173 gpu_preferences_, NULL, NULL, |
| 174 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), | 174 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), |
| 175 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, | 175 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 gpu::gles2::DisallowedFeatures(), | 226 gpu::gles2::DisallowedFeatures(), |
| 227 attribs)) { | 227 attribs)) { |
| 228 return EGL_NO_SURFACE; | 228 return EGL_NO_SURFACE; |
| 229 } | 229 } |
| 230 | 230 |
| 231 command_buffer->SetPutOffsetChangeCallback(base::Bind( | 231 command_buffer->SetPutOffsetChangeCallback(base::Bind( |
| 232 &gpu::CommandExecutor::PutChanged, base::Unretained(executor_.get()))); | 232 &gpu::CommandExecutor::PutChanged, base::Unretained(executor_.get()))); |
| 233 command_buffer->SetGetBufferChangeCallback(base::Bind( | 233 command_buffer->SetGetBufferChangeCallback(base::Bind( |
| 234 &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); | 234 &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); |
| 235 | 235 |
| 236 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( | 236 std::unique_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( |
| 237 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); | 237 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); |
| 238 if (!cmd_helper->Initialize(kCommandBufferSize)) | 238 if (!cmd_helper->Initialize(kCommandBufferSize)) |
| 239 return NULL; | 239 return NULL; |
| 240 | 240 |
| 241 scoped_ptr<gpu::TransferBuffer> transfer_buffer(new gpu::TransferBuffer( | 241 std::unique_ptr<gpu::TransferBuffer> transfer_buffer( |
| 242 cmd_helper.get())); | 242 new gpu::TransferBuffer(cmd_helper.get())); |
| 243 | 243 |
| 244 command_buffer_.reset(command_buffer.release()); | 244 command_buffer_.reset(command_buffer.release()); |
| 245 transfer_buffer_.reset(transfer_buffer.release()); | 245 transfer_buffer_.reset(transfer_buffer.release()); |
| 246 gles2_cmd_helper_.reset(cmd_helper.release()); | 246 gles2_cmd_helper_.reset(cmd_helper.release()); |
| 247 surface_.reset(new Surface(win)); | 247 surface_.reset(new Surface(win)); |
| 248 | 248 |
| 249 return surface_.get(); | 249 return surface_.get(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void Display::DestroySurface(EGLSurface surface) { | 252 void Display::DestroySurface(EGLSurface surface) { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, | 403 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, |
| 404 const base::Closure& callback) { | 404 const base::Closure& callback) { |
| 405 NOTIMPLEMENTED(); | 405 NOTIMPLEMENTED(); |
| 406 } | 406 } |
| 407 | 407 |
| 408 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 408 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
| 409 return false; | 409 return false; |
| 410 } | 410 } |
| 411 | 411 |
| 412 } // namespace egl | 412 } // namespace egl |
| OLD | NEW |