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/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 RenderWidgetCompositorOutputSurface( | 157 RenderWidgetCompositorOutputSurface( |
158 FakeRenderWidgetCompositorDelegate* delegate, | 158 FakeRenderWidgetCompositorDelegate* delegate, |
159 CompositorDependencies* compositor_deps) | 159 CompositorDependencies* compositor_deps) |
160 : RenderWidgetCompositor(delegate, compositor_deps), | 160 : RenderWidgetCompositor(delegate, compositor_deps), |
161 delegate_(delegate) {} | 161 delegate_(delegate) {} |
162 | 162 |
163 using RenderWidgetCompositor::Initialize; | 163 using RenderWidgetCompositor::Initialize; |
164 | 164 |
165 // Force a new output surface to be created. | 165 // Force a new output surface to be created. |
166 void SynchronousComposite() { | 166 void SynchronousComposite() { |
167 layer_tree_host()->DidLoseOutputSurface(); | 167 layer_tree_host()->SetVisible(false); |
| 168 layer_tree_host()->ReleaseOutputSurface(); |
| 169 layer_tree_host()->SetVisible(true); |
168 | 170 |
169 base::TimeTicks some_time; | 171 base::TimeTicks some_time; |
170 layer_tree_host()->Composite(some_time); | 172 layer_tree_host()->Composite(some_time); |
171 } | 173 } |
172 | 174 |
173 void RequestNewOutputSurface() override { | 175 void RequestNewOutputSurface() override { |
174 delegate_->add_request(); | 176 delegate_->add_request(); |
175 RenderWidgetCompositor::RequestNewOutputSurface(); | 177 RenderWidgetCompositor::RequestNewOutputSurface(); |
176 } | 178 } |
177 | 179 |
178 void DidInitializeOutputSurface() override { | 180 void DidInitializeOutputSurface() override { |
179 delegate_->add_success(); | 181 delegate_->add_success(); |
180 if (delegate_->num_requests() == expected_requests_) { | 182 if (delegate_->num_requests() == expected_requests_) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 298 } |
297 | 299 |
298 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { | 300 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { |
299 // The first success is a fallback, but the next should not be a fallback. | 301 // The first success is a fallback, but the next should not be a fallback. |
300 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, | 302 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, |
301 1, 1); | 303 1, 1); |
302 } | 304 } |
303 | 305 |
304 } // namespace | 306 } // namespace |
305 } // namespace content | 307 } // namespace content |
OLD | NEW |