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

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

Issue 775143003: cc: Implement unified BeginFrame on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unittest Created 5 years, 9 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 cause, base::Bind(&GpuProcessTransportFactory::EstablishedGpuChannel, 214 cause, base::Bind(&GpuProcessTransportFactory::EstablishedGpuChannel,
215 callback_factory_.GetWeakPtr(), compositor, 215 callback_factory_.GetWeakPtr(), compositor,
216 create_gpu_output_surface, num_attempts + 1)); 216 create_gpu_output_surface, num_attempts + 1));
217 return; 217 return;
218 } 218 }
219 } 219 }
220 220
221 scoped_ptr<BrowserCompositorOutputSurface> surface; 221 scoped_ptr<BrowserCompositorOutputSurface> surface;
222 if (!create_gpu_output_surface) { 222 if (!create_gpu_output_surface) {
223 surface = make_scoped_ptr(new SoftwareBrowserCompositorOutputSurface( 223 surface = make_scoped_ptr(new SoftwareBrowserCompositorOutputSurface(
224 CreateSoftwareOutputDevice(compositor.get()), 224 CreateSoftwareOutputDevice(compositor.get())));
225 compositor->vsync_manager()));
226 } else { 225 } else {
227 DCHECK(context_provider); 226 DCHECK(context_provider);
228 #if defined(USE_OZONE) 227 #if defined(USE_OZONE)
229 if (ui::SurfaceFactoryOzone::GetInstance() 228 if (ui::SurfaceFactoryOzone::GetInstance()
230 ->CanShowPrimaryPlaneAsOverlay()) { 229 ->CanShowPrimaryPlaneAsOverlay()) {
231 surface = 230 surface =
232 make_scoped_ptr(new GpuSurfacelessBrowserCompositorOutputSurface( 231 make_scoped_ptr(new GpuSurfacelessBrowserCompositorOutputSurface(
233 context_provider, data->surface_id, compositor->vsync_manager(), 232 context_provider, data->surface_id,
234 CreateOverlayCandidateValidator(compositor->widget()), GL_RGB, 233 CreateOverlayCandidateValidator(compositor->widget()), GL_RGB,
235 BrowserGpuMemoryBufferManager::current())); 234 BrowserGpuMemoryBufferManager::current()));
236 } else 235 } else
237 #endif 236 #endif
238 { 237 {
239 surface = make_scoped_ptr(new GpuBrowserCompositorOutputSurface( 238 surface = make_scoped_ptr(new GpuBrowserCompositorOutputSurface(
240 context_provider, compositor->vsync_manager(), 239 context_provider,
241 CreateOverlayCandidateValidator(compositor->widget()))); 240 CreateOverlayCandidateValidator(compositor->widget())));
242 } 241 }
243 } 242 }
244 243
245 // TODO(piman): Use GpuSurfaceTracker to map ids to surfaces instead of an 244 // TODO(piman): Use GpuSurfaceTracker to map ids to surfaces instead of an
246 // output_surface_map_ here. 245 // output_surface_map_ here.
247 output_surface_map_.AddWithID(surface.get(), data->surface_id); 246 output_surface_map_.AddWithID(surface.get(), data->surface_id);
248 data->surface = surface.get(); 247 data->surface = surface.get();
249 if (data->reflector) 248 if (data->reflector)
250 data->reflector->OnSourceSurfaceReady(data->surface); 249 data->reflector->OnSourceSurfaceReady(data->surface);
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 521 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
523 observer_list_, 522 observer_list_,
524 OnLostResources()); 523 OnLostResources());
525 524
526 // Kill things that use the shared context before killing the shared context. 525 // Kill things that use the shared context before killing the shared context.
527 lost_gl_helper.reset(); 526 lost_gl_helper.reset();
528 lost_shared_main_thread_contexts = NULL; 527 lost_shared_main_thread_contexts = NULL;
529 } 528 }
530 529
531 } // namespace content 530 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698