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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 if (frame.gl_frame_data->sub_buffer_rect == | 99 if (frame.gl_frame_data->sub_buffer_rect == |
100 gfx::Rect(frame.gl_frame_data->size)) { | 100 gfx::Rect(frame.gl_frame_data->size)) { |
101 context_provider_->ContextSupport()->Swap(); | 101 context_provider_->ContextSupport()->Swap(); |
102 } else { | 102 } else { |
103 context_provider_->ContextSupport()->PartialSwapBuffers( | 103 context_provider_->ContextSupport()->PartialSwapBuffers( |
104 frame.gl_frame_data->sub_buffer_rect); | 104 frame.gl_frame_data->sub_buffer_rect); |
105 } | 105 } |
106 | |
107 client_->DidSwapBuffers(); | |
108 } | 106 } |
109 | 107 |
110 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 108 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
111 const std::vector<ui::LatencyInfo>& latency_info, | 109 const std::vector<ui::LatencyInfo>& latency_info, |
112 gfx::SwapResult result, | 110 gfx::SwapResult result, |
113 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { | 111 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { |
114 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 112 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
115 OnSwapBuffersComplete(); | 113 OnSwapBuffersComplete(); |
116 } | 114 } |
117 | 115 |
118 #if defined(OS_MACOSX) | 116 #if defined(OS_MACOSX) |
119 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( | 117 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
120 bool suspended) {} | 118 bool suspended) {} |
121 #endif | 119 #endif |
122 | 120 |
123 } // namespace content | 121 } // namespace content |
OLD | NEW |