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

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

Issue 516663003: Surfaceless OutputSurface implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implement GenRenderbuffers 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface( 223 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface(
224 new SoftwareBrowserCompositorOutputSurface( 224 new SoftwareBrowserCompositorOutputSurface(
225 output_surface_proxy_, 225 output_surface_proxy_,
226 CreateSoftwareOutputDevice(compositor), 226 CreateSoftwareOutputDevice(compositor),
227 per_compositor_data_[compositor]->surface_id, 227 per_compositor_data_[compositor]->surface_id,
228 &output_surface_map_, 228 &output_surface_map_,
229 compositor->vsync_manager())); 229 compositor->vsync_manager()));
230 return surface.PassAs<cc::OutputSurface>(); 230 return surface.PassAs<cc::OutputSurface>();
231 } 231 }
232 232
233 scoped_ptr<BrowserCompositorOutputSurface> surface( 233 scoped_ptr<BrowserCompositorOutputSurface> surface;
234 new GpuBrowserCompositorOutputSurface( 234 #if defined(USE_OZONE)
235 context_provider, 235 if (ui::SurfaceFactoryOzone::GetInstance()->CanShowPrimaryPlaneAsOverlay()) {
236 per_compositor_data_[compositor]->surface_id, 236 surface.reset(new GpuSurfacelessBrowserCompositorOutputSurface(
237 &output_surface_map_, 237 context_provider,
238 compositor->vsync_manager(), 238 per_compositor_data_[compositor]->surface_id,
239 CreateOverlayCandidateValidator(compositor->widget()))); 239 &output_surface_map_,
240 compositor->vsync_manager(),
241 CreateOverlayCandidateValidator(compositor->widget()),
242 GL_RGB8_OES,
243 0));
244 }
245 #endif
246 if (!surface)
247 surface.reset(new GpuBrowserCompositorOutputSurface(
248 context_provider,
249 per_compositor_data_[compositor]->surface_id,
250 &output_surface_map_,
251 compositor->vsync_manager(),
252 CreateOverlayCandidateValidator(compositor->widget())));
253
240 if (data->reflector.get()) 254 if (data->reflector.get())
241 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get()); 255 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get());
242 256
243 return surface.PassAs<cc::OutputSurface>(); 257 return surface.PassAs<cc::OutputSurface>();
244 } 258 }
245 259
246 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector( 260 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector(
247 ui::Compositor* source, 261 ui::Compositor* source,
248 ui::Layer* target) { 262 ui::Layer* target) {
249 PerCompositorData* data = per_compositor_data_[source]; 263 PerCompositorData* data = per_compositor_data_[source];
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 472 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
459 observer_list_, 473 observer_list_,
460 OnLostResources()); 474 OnLostResources());
461 475
462 // Kill things that use the shared context before killing the shared context. 476 // Kill things that use the shared context before killing the shared context.
463 lost_gl_helper.reset(); 477 lost_gl_helper.reset();
464 lost_shared_main_thread_contexts = NULL; 478 lost_shared_main_thread_contexts = NULL;
465 } 479 }
466 480
467 } // namespace content 481 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698