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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 #if defined(OS_MACOSX) | 87 #if defined(OS_MACOSX) |
88 if (should_show_frames_state_ == | 88 if (should_show_frames_state_ == |
89 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { | 89 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { |
90 should_show_frames_state_ = SHOULD_SHOW_FRAMES; | 90 should_show_frames_state_ = SHOULD_SHOW_FRAMES; |
91 } | 91 } |
92 #endif | 92 #endif |
93 } | 93 } |
94 | 94 |
95 void GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted( | 95 void GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted( |
96 const std::vector<ui::LatencyInfo>& latency_info) { | 96 const std::vector<ui::LatencyInfo>& latency_info, |
| 97 gfx::SwapResult result) { |
97 #if defined(OS_MACOSX) | 98 #if defined(OS_MACOSX) |
98 // On Mac, delay acknowledging the swap to the output surface client until | 99 // On Mac, delay acknowledging the swap to the output surface client until |
99 // it has been drawn, see OnSurfaceDisplayed(); | 100 // it has been drawn, see OnSurfaceDisplayed(); |
100 NOTREACHED(); | 101 NOTREACHED(); |
101 #else | 102 #else |
102 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 103 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
103 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 104 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
104 } else { | 105 } else { |
105 BrowserThread::PostTask( | 106 BrowserThread::PostTask( |
106 BrowserThread::UI, | 107 BrowserThread::UI, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 } | 143 } |
143 | 144 |
144 bool GpuBrowserCompositorOutputSurface:: | 145 bool GpuBrowserCompositorOutputSurface:: |
145 SurfaceShouldNotShowFramesAfterSuspendForRecycle() const { | 146 SurfaceShouldNotShowFramesAfterSuspendForRecycle() const { |
146 return should_show_frames_state_ != SHOULD_SHOW_FRAMES; | 147 return should_show_frames_state_ != SHOULD_SHOW_FRAMES; |
147 } | 148 } |
148 #endif | 149 #endif |
149 | 150 |
150 } // namespace content | 151 } // namespace content |
OLD | NEW |