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

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

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Make sure the lost context callback doesn't try to run during destruction. 122 // Make sure the lost context callback doesn't try to run during destruction.
123 callback_factory_.InvalidateWeakPtrs(); 123 callback_factory_.InvalidateWeakPtrs();
124 124
125 task_graph_runner_->Shutdown(); 125 task_graph_runner_->Shutdown();
126 if (raster_thread_) 126 if (raster_thread_)
127 raster_thread_->Join(); 127 raster_thread_->Join();
128 } 128 }
129 129
130 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 130 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
131 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { 131 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
132 CauseForGpuLaunch cause = 132 // CauseForGpuLaunch cause =
133 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; 133 // CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE;
134 scoped_refptr<GpuChannelHost> gpu_channel_host( 134 // scoped_refptr<GpuChannelHost> gpu_channel_host(
135 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); 135 // BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause) );
136 return CreateContextCommon(gpu_channel_host, 0); 136 // return CreateContextCommon(gpu_channel_host, 0);
137 return CreateContextCommon(scoped_refptr<GpuChannelHost>(nullptr), 0);
137 } 138 }
138 139
139 scoped_ptr<cc::SoftwareOutputDevice> 140 scoped_ptr<cc::SoftwareOutputDevice>
140 GpuProcessTransportFactory::CreateSoftwareOutputDevice( 141 GpuProcessTransportFactory::CreateSoftwareOutputDevice(
141 ui::Compositor* compositor) { 142 ui::Compositor* compositor) {
142 #if defined(OS_WIN) 143 #if defined(OS_WIN)
143 return scoped_ptr<cc::SoftwareOutputDevice>( 144 return scoped_ptr<cc::SoftwareOutputDevice>(
144 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); 145 new SoftwareOutputDeviceWin(software_backing_.get(), compositor));
145 #elif defined(USE_OZONE) 146 #elif defined(USE_OZONE)
146 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone( 147 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone(
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 528
528 gfx::AcceleratedWidget widget = compositor->widget(); 529 gfx::AcceleratedWidget widget = compositor->widget();
529 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); 530 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get();
530 531
531 PerCompositorData* data = new PerCompositorData; 532 PerCompositorData* data = new PerCompositorData;
532 if (compositor->widget() == gfx::kNullAcceleratedWidget) { 533 if (compositor->widget() == gfx::kNullAcceleratedWidget) {
533 data->surface_id = 0; 534 data->surface_id = 0;
534 } else { 535 } else {
535 data->surface_id = tracker->AddSurfaceForNativeWidget(widget); 536 data->surface_id = tracker->AddSurfaceForNativeWidget(widget);
536 tracker->SetSurfaceHandle(data->surface_id, 537 tracker->SetSurfaceHandle(data->surface_id,
537 gfx::GLSurfaceHandle(widget, gfx::NATIVE_DIRECT)); 538 gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx:: NATIVE_DIRECT));
no sievers 2015/10/20 19:24:22 this is fixed upstream and should compile on andro
538 } 539 }
539 540
540 per_compositor_data_[compositor] = data; 541 per_compositor_data_[compositor] = data;
541 542
542 return data; 543 return data;
543 } 544 }
544 545
545 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 546 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
546 GpuProcessTransportFactory::CreateContextCommon( 547 GpuProcessTransportFactory::CreateContextCommon(
547 scoped_refptr<GpuChannelHost> gpu_channel_host, 548 scoped_refptr<GpuChannelHost> gpu_channel_host,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 596 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
596 observer_list_, 597 observer_list_,
597 OnLostResources()); 598 OnLostResources());
598 599
599 // Kill things that use the shared context before killing the shared context. 600 // Kill things that use the shared context before killing the shared context.
600 lost_gl_helper.reset(); 601 lost_gl_helper.reset();
601 lost_shared_main_thread_contexts = NULL; 602 lost_shared_main_thread_contexts = NULL;
602 } 603 }
603 604
604 } // namespace content 605 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698