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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 1916923004: Request context sharing via content::ContextProviderCommandBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sharegroup: . Created 4 years, 7 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
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/command_buffer/tests/gl_manager.h" 5 #include "gpu/command_buffer/tests/gl_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 gfx::GLShareGroup* share_group = NULL; 254 gfx::GLShareGroup* share_group = NULL;
255 if (options.share_group_manager) { 255 if (options.share_group_manager) {
256 share_group = options.share_group_manager->share_group(); 256 share_group = options.share_group_manager->share_group();
257 } else if (options.share_mailbox_manager) { 257 } else if (options.share_mailbox_manager) {
258 share_group = options.share_mailbox_manager->share_group(); 258 share_group = options.share_mailbox_manager->share_group();
259 } 259 }
260 260
261 gles2::ContextGroup* context_group = NULL; 261 gles2::ContextGroup* context_group = NULL;
262 gles2::ShareGroup* client_share_group = NULL; 262 scoped_refptr<gles2::ShareGroup> client_share_group;
263 if (options.share_group_manager) { 263 if (options.share_group_manager) {
264 context_group = options.share_group_manager->decoder_->GetContextGroup(); 264 context_group = options.share_group_manager->decoder_->GetContextGroup();
265 client_share_group = 265 client_share_group =
266 options.share_group_manager->gles2_implementation()->share_group(); 266 options.share_group_manager->gles2_implementation()->share_group();
267 } 267 }
268 268
269 gfx::GLContext* real_gl_context = NULL; 269 gfx::GLContext* real_gl_context = NULL;
270 if (options.virtual_manager) { 270 if (options.virtual_manager) {
271 real_gl_context = options.virtual_manager->context(); 271 real_gl_context = options.virtual_manager->context();
272 } 272 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 // Create the GLES2 helper, which writes the command buffer protocol. 367 // Create the GLES2 helper, which writes the command buffer protocol.
368 gles2_helper_.reset(new gles2::GLES2CmdHelper(command_buffer_.get())); 368 gles2_helper_.reset(new gles2::GLES2CmdHelper(command_buffer_.get()));
369 ASSERT_TRUE(gles2_helper_->Initialize(kCommandBufferSize)); 369 ASSERT_TRUE(gles2_helper_->Initialize(kCommandBufferSize));
370 370
371 // Create a transfer buffer. 371 // Create a transfer buffer.
372 transfer_buffer_.reset(new TransferBuffer(gles2_helper_.get())); 372 transfer_buffer_.reset(new TransferBuffer(gles2_helper_.get()));
373 373
374 // Create the object exposing the OpenGL API. 374 // Create the object exposing the OpenGL API.
375 const bool support_client_side_arrays = true; 375 const bool support_client_side_arrays = true;
376 gles2_implementation_.reset( 376 gles2_implementation_.reset(new gles2::GLES2Implementation(
377 new gles2::GLES2Implementation(gles2_helper_.get(), 377 gles2_helper_.get(), std::move(client_share_group),
378 client_share_group, 378 transfer_buffer_.get(), options.bind_generates_resource,
379 transfer_buffer_.get(), 379 options.lose_context_when_out_of_memory, support_client_side_arrays,
380 options.bind_generates_resource, 380 this));
381 options.lose_context_when_out_of_memory,
382 support_client_side_arrays,
383 this));
384 381
385 ASSERT_TRUE(gles2_implementation_->Initialize( 382 ASSERT_TRUE(gles2_implementation_->Initialize(
386 kStartTransferBufferSize, kMinTransferBufferSize, kMaxTransferBufferSize, 383 kStartTransferBufferSize, kMinTransferBufferSize, kMaxTransferBufferSize,
387 SharedMemoryLimits::kNoLimit)) 384 SharedMemoryLimits::kNoLimit))
388 << "Could not init GLES2Implementation"; 385 << "Could not init GLES2Implementation";
389 386
390 MakeCurrent(); 387 MakeCurrent();
391 } 388 }
392 389
393 void GLManager::SetupBaseContext() { 390 void GLManager::SetupBaseContext() {
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 629
633 // Something went wrong, just run the callback now. 630 // Something went wrong, just run the callback now.
634 callback.Run(); 631 callback.Run();
635 } 632 }
636 633
637 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 634 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
638 return false; 635 return false;
639 } 636 }
640 637
641 } // namespace gpu 638 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698