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

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

Issue 548153004: Unified BeginFrame scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 6 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 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // associated with this context, then return a SurfaceDisplayOutputSurface 181 // associated with this context, then return a SurfaceDisplayOutputSurface
182 // set up to draw to the display's surface. 182 // set up to draw to the display's surface.
183 cc::SurfaceManager* manager = surface_manager_.get(); 183 cc::SurfaceManager* manager = surface_manager_.get();
184 scoped_ptr<cc::OutputSurface> display_surface; 184 scoped_ptr<cc::OutputSurface> display_surface;
185 if (!context_provider.get()) { 185 if (!context_provider.get()) {
186 display_surface = 186 display_surface =
187 make_scoped_ptr(new SoftwareBrowserCompositorOutputSurface( 187 make_scoped_ptr(new SoftwareBrowserCompositorOutputSurface(
188 output_surface_proxy_, 188 output_surface_proxy_,
189 CreateSoftwareOutputDevice(compositor), 189 CreateSoftwareOutputDevice(compositor),
190 per_compositor_data_[compositor]->surface_id, 190 per_compositor_data_[compositor]->surface_id,
191 &output_surface_map_, 191 &output_surface_map_));
192 compositor->vsync_manager()));
193 } else {
194 display_surface = make_scoped_ptr(new GpuBrowserCompositorOutputSurface(
195 context_provider,
196 per_compositor_data_[compositor]->surface_id,
197 &output_surface_map_,
198 compositor->vsync_manager(),
199 CreateOverlayCandidateValidator(compositor->widget())));
200 } 192 }
201 scoped_ptr<OnscreenDisplayClient> display_client(new OnscreenDisplayClient( 193 scoped_ptr<OnscreenDisplayClient> display_client(new OnscreenDisplayClient(
202 display_surface.Pass(), manager, compositor->task_runner())); 194 display_surface.Pass(), manager, compositor->task_runner()));
203 195
204 scoped_refptr<cc::ContextProvider> offscreen_context_provider; 196 scoped_refptr<cc::ContextProvider> offscreen_context_provider;
205 if (context_provider.get()) { 197 if (context_provider.get()) {
206 offscreen_context_provider = ContextProviderCommandBuffer::Create( 198 offscreen_context_provider = ContextProviderCommandBuffer::Create(
207 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(), 199 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(),
208 "Offscreen-Compositor"); 200 "Offscreen-Compositor");
209 } 201 }
(...skipping 10 matching lines...) Expand all
220 if (compositor_thread_.get()) { 212 if (compositor_thread_.get()) {
221 LOG(FATAL) << "Failed to create UI context, but can't use software" 213 LOG(FATAL) << "Failed to create UI context, but can't use software"
222 " compositing with browser threaded compositing. Aborting."; 214 " compositing with browser threaded compositing. Aborting.";
223 } 215 }
224 216
225 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface( 217 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface(
226 new SoftwareBrowserCompositorOutputSurface( 218 new SoftwareBrowserCompositorOutputSurface(
227 output_surface_proxy_, 219 output_surface_proxy_,
228 CreateSoftwareOutputDevice(compositor), 220 CreateSoftwareOutputDevice(compositor),
229 per_compositor_data_[compositor]->surface_id, 221 per_compositor_data_[compositor]->surface_id,
230 &output_surface_map_, 222 &output_surface_map_));
231 compositor->vsync_manager()));
232 return surface.PassAs<cc::OutputSurface>(); 223 return surface.PassAs<cc::OutputSurface>();
233 } 224 }
234 225
235 scoped_ptr<BrowserCompositorOutputSurface> surface( 226 scoped_ptr<BrowserCompositorOutputSurface> surface(
236 new GpuBrowserCompositorOutputSurface( 227 new GpuBrowserCompositorOutputSurface(
237 context_provider, 228 context_provider,
238 per_compositor_data_[compositor]->surface_id, 229 per_compositor_data_[compositor]->surface_id,
239 &output_surface_map_, 230 &output_surface_map_,
240 compositor->vsync_manager(),
241 CreateOverlayCandidateValidator(compositor->widget()))); 231 CreateOverlayCandidateValidator(compositor->widget())));
242 if (data->reflector.get()) 232 if (data->reflector.get())
243 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get()); 233 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get());
244 234
245 return surface.PassAs<cc::OutputSurface>(); 235 return surface.PassAs<cc::OutputSurface>();
246 } 236 }
247 237
248 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector( 238 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector(
249 ui::Compositor* source, 239 ui::Compositor* source,
250 ui::Layer* target) { 240 ui::Layer* target) {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 450 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
461 observer_list_, 451 observer_list_,
462 OnLostResources()); 452 OnLostResources());
463 453
464 // Kill things that use the shared context before killing the shared context. 454 // Kill things that use the shared context before killing the shared context.
465 lost_gl_helper.reset(); 455 lost_gl_helper.reset();
466 lost_shared_main_thread_contexts = NULL; 456 lost_shared_main_thread_contexts = NULL;
467 } 457 }
468 458
469 } // namespace content 459 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698