OLD | NEW |
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_surfaceless_browser_compositor_output_s
urface.h" | 5 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "content/browser/compositor/buffer_queue.h" | 8 #include "content/browser/compositor/buffer_queue.h" |
9 #include "content/browser/compositor/reflector_impl.h" | 9 #include "content/browser/compositor/reflector_impl.h" |
10 #include "content/browser/gpu/gpu_surface_tracker.h" | 10 #include "content/browser/gpu/gpu_surface_tracker.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator, | 23 scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator, |
24 unsigned internalformat, | 24 unsigned internalformat, |
25 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) | 25 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) |
26 : GpuBrowserCompositorOutputSurface(context, | 26 : GpuBrowserCompositorOutputSurface(context, |
27 vsync_manager, | 27 vsync_manager, |
28 overlay_candidate_validator.Pass()), | 28 overlay_candidate_validator.Pass()), |
29 internalformat_(internalformat), | 29 internalformat_(internalformat), |
30 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { | 30 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { |
31 capabilities_.uses_default_gl_framebuffer = false; | 31 capabilities_.uses_default_gl_framebuffer = false; |
32 capabilities_.flipped_output_surface = true; | 32 capabilities_.flipped_output_surface = true; |
| 33 // TODO(alexst): Can't enable this on ARM since it hangs the device |
| 34 // (crbug.com/470185). Alternatively remove this entirely once the compositor |
| 35 // scheduling is optimized enough to work well with surfaceless. |
| 36 #if defined(ARCH_CPU_X86_FAMILY) |
| 37 capabilities_.max_frames_pending = 2; |
| 38 #endif |
33 | 39 |
34 gl_helper_.reset(new GLHelper(context_provider_->ContextGL(), | 40 gl_helper_.reset(new GLHelper(context_provider_->ContextGL(), |
35 context_provider_->ContextSupport())); | 41 context_provider_->ContextSupport())); |
36 output_surface_.reset( | 42 output_surface_.reset( |
37 new BufferQueue(context_provider_, internalformat_, gl_helper_.get(), | 43 new BufferQueue(context_provider_, internalformat_, gl_helper_.get(), |
38 gpu_memory_buffer_manager_, surface_id)); | 44 gpu_memory_buffer_manager_, surface_id)); |
39 output_surface_->Initialize(); | 45 output_surface_->Initialize(); |
40 } | 46 } |
41 | 47 |
42 GpuSurfacelessBrowserCompositorOutputSurface:: | 48 GpuSurfacelessBrowserCompositorOutputSurface:: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 84 |
79 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( | 85 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( |
80 const gfx::Size& size, | 86 const gfx::Size& size, |
81 float scale_factor) { | 87 float scale_factor) { |
82 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor); | 88 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor); |
83 DCHECK(output_surface_); | 89 DCHECK(output_surface_); |
84 output_surface_->Reshape(SurfaceSize(), scale_factor); | 90 output_surface_->Reshape(SurfaceSize(), scale_factor); |
85 } | 91 } |
86 | 92 |
87 } // namespace content | 93 } // namespace content |
OLD | NEW |