Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: gpu/gles2_conform_support/egl/context.cc

Issue 2275113002: Provide task runner to GLES2Impl / CommandBuffer at creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cleanup4
Patch Set: cleanup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698