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

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 606113003: Revert of Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host.h » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/test/layer_tree_test.h" 5 #include "cc/test/layer_tree_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 virtual void Layout() OVERRIDE { test_hooks_->Layout(); } 283 virtual void Layout() OVERRIDE { test_hooks_->Layout(); }
284 284
285 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, 285 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
286 float scale, 286 float scale,
287 float top_controls_delta) OVERRIDE { 287 float top_controls_delta) OVERRIDE {
288 test_hooks_->ApplyViewportDeltas(scroll_delta, 288 test_hooks_->ApplyViewportDeltas(scroll_delta,
289 scale, 289 scale,
290 top_controls_delta); 290 top_controls_delta);
291 } 291 }
292 292
293 virtual void RequestNewOutputSurface(bool fallback) OVERRIDE { 293 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
294 test_hooks_->RequestNewOutputSurface(fallback); 294 OVERRIDE {
295 return test_hooks_->CreateOutputSurface(fallback);
295 } 296 }
296 297
297 virtual void DidInitializeOutputSurface() OVERRIDE { 298 virtual void DidInitializeOutputSurface() OVERRIDE {
298 test_hooks_->DidInitializeOutputSurface(); 299 test_hooks_->DidInitializeOutputSurface();
299 } 300 }
300 301
301 virtual void DidFailToInitializeOutputSurface() OVERRIDE { 302 virtual void DidFailToInitializeOutputSurface() OVERRIDE {
302 test_hooks_->DidFailToInitializeOutputSurface(); 303 test_hooks_->DidFailToInitializeOutputSurface();
303 } 304 }
304 305
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 FAIL() << "Test timed out"; 660 FAIL() << "Test timed out";
660 return; 661 return;
661 } 662 }
662 AfterTest(); 663 AfterTest();
663 } 664 }
664 665
665 void LayerTreeTest::RunTestWithImplSidePainting() { 666 void LayerTreeTest::RunTestWithImplSidePainting() {
666 RunTest(true, false, true); 667 RunTest(true, false, true);
667 } 668 }
668 669
669 void LayerTreeTest::RequestNewOutputSurface(bool fallback) {
670 layer_tree_host_->SetOutputSurface(CreateOutputSurface(fallback));
671 }
672
673 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { 670 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) {
674 scoped_ptr<FakeOutputSurface> output_surface = 671 scoped_ptr<FakeOutputSurface> output_surface =
675 CreateFakeOutputSurface(fallback); 672 CreateFakeOutputSurface(fallback);
676 if (output_surface) { 673 if (output_surface) {
677 DCHECK_EQ(delegating_renderer_, 674 DCHECK_EQ(delegating_renderer_,
678 output_surface->capabilities().delegated_rendering); 675 output_surface->capabilities().delegated_rendering);
679 } 676 }
680 output_surface_ = output_surface.get(); 677 output_surface_ = output_surface.get();
681 return output_surface.PassAs<OutputSurface>(); 678 return output_surface.PassAs<OutputSurface>();
682 } 679 }
(...skipping 21 matching lines...) Expand all
704 return -1; 701 return -1;
705 } 702 }
706 703
707 void LayerTreeTest::DestroyLayerTreeHost() { 704 void LayerTreeTest::DestroyLayerTreeHost() {
708 if (layer_tree_host_ && layer_tree_host_->root_layer()) 705 if (layer_tree_host_ && layer_tree_host_->root_layer())
709 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 706 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL);
710 layer_tree_host_.reset(); 707 layer_tree_host_.reset();
711 } 708 }
712 709
713 } // namespace cc 710 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698