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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 cc::OutputSurfaceClient* client) { | 58 cc::OutputSurfaceClient* client) { |
59 if (!BrowserCompositorOutputSurface::BindToClient(client)) | 59 if (!BrowserCompositorOutputSurface::BindToClient(client)) |
60 return false; | 60 return false; |
61 | 61 |
62 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( | 62 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( |
63 swap_buffers_completion_callback_.callback()); | 63 swap_buffers_completion_callback_.callback()); |
64 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( | 64 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( |
65 update_vsync_parameters_callback_.callback()); | 65 update_vsync_parameters_callback_.callback()); |
66 if (capabilities_.uses_default_gl_framebuffer) { | 66 if (capabilities_.uses_default_gl_framebuffer) { |
67 capabilities_.flipped_output_surface = | 67 capabilities_.flipped_output_surface = |
68 context_provider()->ContextCapabilities().gpu.flips_vertically; | 68 context_provider()->ContextCapabilities().flips_vertically; |
69 } | 69 } |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { | 73 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { |
74 if (!reflector_) { | 74 if (!reflector_) { |
75 reflector_texture_.reset(); | 75 reflector_texture_.reset(); |
76 } else { | 76 } else { |
77 reflector_texture_.reset(new ReflectorTexture(context_provider())); | 77 reflector_texture_.reset(new ReflectorTexture(context_provider())); |
78 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); | 78 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 bool GpuBrowserCompositorOutputSurface::SurfaceIsSuspendForRecycle() const { | 157 bool GpuBrowserCompositorOutputSurface::SurfaceIsSuspendForRecycle() const { |
158 #if defined(OS_MACOSX) | 158 #if defined(OS_MACOSX) |
159 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; | 159 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; |
160 #else | 160 #else |
161 return false; | 161 return false; |
162 #endif | 162 #endif |
163 } | 163 } |
164 | 164 |
165 } // namespace content | 165 } // namespace content |
OLD | NEW |