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

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 267683008: ChromeOS only version of r261563 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1916/src/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/compositor/gpu_process_transport_factory.h" 5 #include "content/browser/compositor/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 421 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
422 GpuProcessTransportFactory::CreateContextCommon(int surface_id) { 422 GpuProcessTransportFactory::CreateContextCommon(int surface_id) {
423 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) 423 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor())
424 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); 424 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
425 blink::WebGraphicsContext3D::Attributes attrs; 425 blink::WebGraphicsContext3D::Attributes attrs;
426 attrs.shareResources = true; 426 attrs.shareResources = true;
427 attrs.depth = false; 427 attrs.depth = false;
428 attrs.stencil = false; 428 attrs.stencil = false;
429 attrs.antialias = false; 429 attrs.antialias = false;
430 attrs.noAutomaticFlushes = true; 430 attrs.noAutomaticFlushes = true;
431 #if !defined(OS_CHROMEOS)
431 bool bind_generates_resources = false; 432 bool bind_generates_resources = false;
433 #endif
432 bool lose_context_when_out_of_memory = true; 434 bool lose_context_when_out_of_memory = true;
433 CauseForGpuLaunch cause = 435 CauseForGpuLaunch cause =
434 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; 436 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE;
435 scoped_refptr<GpuChannelHost> gpu_channel_host( 437 scoped_refptr<GpuChannelHost> gpu_channel_host(
436 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); 438 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause));
437 if (!gpu_channel_host) { 439 if (!gpu_channel_host) {
438 LOG(ERROR) << "Failed to establish GPU channel."; 440 LOG(ERROR) << "Failed to establish GPU channel.";
439 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); 441 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
440 } 442 }
441 GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); 443 GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
442 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( 444 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
443 new WebGraphicsContext3DCommandBufferImpl( 445 new WebGraphicsContext3DCommandBufferImpl(
444 surface_id, 446 surface_id,
445 url, 447 url,
446 gpu_channel_host.get(), 448 gpu_channel_host.get(),
447 attrs, 449 attrs,
450 #if !defined(OS_CHROMEOS)
448 bind_generates_resources, 451 bind_generates_resources,
452 #endif
449 lose_context_when_out_of_memory, 453 lose_context_when_out_of_memory,
450 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), 454 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
451 NULL)); 455 NULL));
452 return context.Pass(); 456 return context.Pass();
453 } 457 }
454 458
455 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { 459 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() {
456 base::MessageLoop::current()->PostTask( 460 base::MessageLoop::current()->PostTask(
457 FROM_HERE, 461 FROM_HERE,
458 base::Bind(&GpuProcessTransportFactory::OnLostMainThreadSharedContext, 462 base::Bind(&GpuProcessTransportFactory::OnLostMainThreadSharedContext,
(...skipping 20 matching lines...) Expand all
479 observer_list_, 483 observer_list_,
480 OnLostResources()); 484 OnLostResources());
481 485
482 // Kill things that use the shared context before killing the shared context. 486 // Kill things that use the shared context before killing the shared context.
483 lost_gl_helper.reset(); 487 lost_gl_helper.reset();
484 lost_offscreen_compositor_contexts = NULL; 488 lost_offscreen_compositor_contexts = NULL;
485 lost_shared_main_thread_contexts = NULL; 489 lost_shared_main_thread_contexts = NULL;
486 } 490 }
487 491
488 } // namespace content 492 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698