Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: content/renderer/gpu/render_widget_compositor_unittest.cc

Issue 2270573002: cc: Get rid of LayerTreeHost::output_surface_lost_ state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-caps
Patch Set: lth-outputsurface-lost: android-build-and-earlyout-sooner Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | ui/aura/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | ui/aura/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698