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_browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "cc/output/output_surface_client.h" | 8 #include "cc/output/output_surface_client.h" |
9 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" | 9 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" |
10 #include "content/browser/compositor/reflector_impl.h" | 10 #include "content/browser/compositor/reflector_impl.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 bool GpuBrowserCompositorOutputSurface::BindToClient( | 52 bool GpuBrowserCompositorOutputSurface::BindToClient( |
53 cc::OutputSurfaceClient* client) { | 53 cc::OutputSurfaceClient* client) { |
54 if (!BrowserCompositorOutputSurface::BindToClient(client)) | 54 if (!BrowserCompositorOutputSurface::BindToClient(client)) |
55 return false; | 55 return false; |
56 | 56 |
57 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( | 57 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( |
58 swap_buffers_completion_callback_.callback()); | 58 swap_buffers_completion_callback_.callback()); |
59 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( | 59 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( |
60 update_vsync_parameters_callback_.callback()); | 60 update_vsync_parameters_callback_.callback()); |
| 61 if (capabilities_.uses_default_gl_framebuffer) { |
| 62 capabilities_.flipped_output_surface = |
| 63 context_provider()->ContextCapabilities().gpu.flips_vertically; |
| 64 } |
61 return true; | 65 return true; |
62 } | 66 } |
63 | 67 |
64 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { | 68 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { |
65 if (!reflector_) { | 69 if (!reflector_) { |
66 reflector_texture_.reset(); | 70 reflector_texture_.reset(); |
67 } else { | 71 } else { |
68 reflector_texture_.reset(new ReflectorTexture(context_provider())); | 72 reflector_texture_.reset(new ReflectorTexture(context_provider())); |
69 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); | 73 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); |
70 } | 74 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 151 |
148 bool GpuBrowserCompositorOutputSurface::SurfaceIsSuspendForRecycle() const { | 152 bool GpuBrowserCompositorOutputSurface::SurfaceIsSuspendForRecycle() const { |
149 #if defined(OS_MACOSX) | 153 #if defined(OS_MACOSX) |
150 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; | 154 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; |
151 #else | 155 #else |
152 return false; | 156 return false; |
153 #endif | 157 #endif |
154 } | 158 } |
155 | 159 |
156 } // namespace content | 160 } // namespace content |
OLD | NEW |