| 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" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 transfer_buffer_.reset(transfer_buffer.release()); | 319 transfer_buffer_.reset(transfer_buffer.release()); |
| 320 command_buffer_.reset(command_buffer.release()); | 320 command_buffer_.reset(command_buffer.release()); |
| 321 command_executor_.reset(command_executor.release()); | 321 command_executor_.reset(command_executor.release()); |
| 322 decoder_.reset(decoder.release()); | 322 decoder_.reset(decoder.release()); |
| 323 gl_context_ = gl_context.get(); | 323 gl_context_ = gl_context.get(); |
| 324 | 324 |
| 325 std::unique_ptr<gpu::gles2::GLES2Implementation> context( | 325 std::unique_ptr<gpu::gles2::GLES2Implementation> context( |
| 326 new gpu::gles2::GLES2Implementation( | 326 new gpu::gles2::GLES2Implementation( |
| 327 gles2_cmd_helper_.get(), nullptr, transfer_buffer_.get(), | 327 gles2_cmd_helper_.get(), nullptr, transfer_buffer_.get(), |
| 328 kBindGeneratesResources, kLoseContextWhenOutOfMemory, | 328 kBindGeneratesResources, kLoseContextWhenOutOfMemory, |
| 329 kSupportClientSideArrays, this)); | 329 kSupportClientSideArrays, this, nullptr)); |
| 330 | 330 |
| 331 if (!context->Initialize(kTransferBufferSize, kTransferBufferSize / 2, | 331 if (!context->Initialize(kTransferBufferSize, kTransferBufferSize / 2, |
| 332 kTransferBufferSize * 2, | 332 kTransferBufferSize * 2, |
| 333 gpu::SharedMemoryLimits::kNoLimit)) { | 333 gpu::SharedMemoryLimits::kNoLimit)) { |
| 334 DestroyService(); | 334 DestroyService(); |
| 335 return false; | 335 return false; |
| 336 } | 336 } |
| 337 | 337 |
| 338 context->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); | 338 context->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); |
| 339 context->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs"); | 339 context->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs"); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 return false; | 388 return false; |
| 389 if (!gl_context_->MakeCurrent(gl_surface)) { | 389 if (!gl_context_->MakeCurrent(gl_surface)) { |
| 390 MarkServiceContextLost(); | 390 MarkServiceContextLost(); |
| 391 return false; | 391 return false; |
| 392 } | 392 } |
| 393 client_gl_context_->Flush(); | 393 client_gl_context_->Flush(); |
| 394 return true; | 394 return true; |
| 395 } | 395 } |
| 396 | 396 |
| 397 } // namespace egl | 397 } // namespace egl |
| OLD | NEW |