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; | 33 capabilities_.max_frames_pending = 2; |
38 #endif | |
39 | 34 |
40 gl_helper_.reset(new GLHelper(context_provider_->ContextGL(), | 35 gl_helper_.reset(new GLHelper(context_provider_->ContextGL(), |
41 context_provider_->ContextSupport())); | 36 context_provider_->ContextSupport())); |
42 output_surface_.reset( | 37 output_surface_.reset( |
43 new BufferQueue(context_provider_, internalformat_, gl_helper_.get(), | 38 new BufferQueue(context_provider_, internalformat_, gl_helper_.get(), |
44 gpu_memory_buffer_manager_, surface_id)); | 39 gpu_memory_buffer_manager_, surface_id)); |
45 output_surface_->Initialize(); | 40 output_surface_->Initialize(); |
46 } | 41 } |
47 | 42 |
48 GpuSurfacelessBrowserCompositorOutputSurface:: | 43 GpuSurfacelessBrowserCompositorOutputSurface:: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 79 |
85 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( | 80 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( |
86 const gfx::Size& size, | 81 const gfx::Size& size, |
87 float scale_factor) { | 82 float scale_factor) { |
88 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor); | 83 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor); |
89 DCHECK(output_surface_); | 84 DCHECK(output_surface_); |
90 output_surface_->Reshape(SurfaceSize(), scale_factor); | 85 output_surface_->Reshape(SurfaceSize(), scale_factor); |
91 } | 86 } |
92 | 87 |
93 } // namespace content | 88 } // namespace content |
OLD | NEW |