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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1418273002: cc: Move draw params from SetExternalDrawConstraints to OnDraw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests fixed Created 5 years, 1 month 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
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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 FROM_HERE, 2095 FROM_HERE,
2096 base::Bind( 2096 base::Bind(
2097 &LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor:: 2097 &LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor::
2098 CallOnDraw, 2098 CallOnDraw,
2099 base::Unretained(this))); 2099 base::Unretained(this)));
2100 } 2100 }
2101 2101
2102 void CallOnDraw() { 2102 void CallOnDraw() {
2103 // Synchronous compositor does not draw unless told to do so by the output 2103 // Synchronous compositor does not draw unless told to do so by the output
2104 // surface. 2104 // surface.
2105 output_surface()->client()->OnDraw(); 2105 gfx::Transform identity;
2106 gfx::Rect empty_rect;
2107 bool resourceless_software_draw = false;
2108 output_surface()->client()->OnDraw(identity, empty_rect, empty_rect,
2109 resourceless_software_draw);
2106 } 2110 }
2107 }; 2111 };
2108 2112
2109 MULTI_THREAD_TEST_F( 2113 MULTI_THREAD_TEST_F(
2110 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor); 2114 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor);
2111 2115
2112 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync 2116 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync
2113 : public LayerTreeHostTestAbortedCommitDoesntStall { 2117 : public LayerTreeHostTestAbortedCommitDoesntStall {
2114 void InitializeSettings(LayerTreeSettings* settings) override { 2118 void InitializeSettings(LayerTreeSettings* settings) override {
2115 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); 2119 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 } 2459 }
2456 return draw_result; 2460 return draw_result;
2457 } 2461 }
2458 2462
2459 void SwapBuffersCompleteOnThread(LayerTreeHostImpl* host_impl) override { 2463 void SwapBuffersCompleteOnThread(LayerTreeHostImpl* host_impl) override {
2460 swap_count_++; 2464 swap_count_++;
2461 switch (swap_count_) { 2465 switch (swap_count_) {
2462 case 1: { 2466 case 1: {
2463 gfx::Transform identity; 2467 gfx::Transform identity;
2464 gfx::Rect empty_rect; 2468 gfx::Rect empty_rect;
2469 host_impl->SetExternalDrawConstraints(empty_rect, identity);
2465 bool resourceless_software_draw = true; 2470 bool resourceless_software_draw = true;
2466 host_impl->SetExternalDrawConstraints(identity, empty_rect, empty_rect, 2471 host_impl->SetResourcelessSoftwareDrawForTesting(
2467 empty_rect, identity, 2472 resourceless_software_draw);
2468 resourceless_software_draw);
2469 host_impl->SetFullRootLayerDamage(); 2473 host_impl->SetFullRootLayerDamage();
2470 host_impl->SetNeedsRedraw(); 2474 host_impl->SetNeedsRedraw();
2471 break; 2475 break;
2472 } 2476 }
2473 case 2: 2477 case 2:
2474 EndTest(); 2478 EndTest();
2475 break; 2479 break;
2476 default: 2480 default:
2477 NOTREACHED(); 2481 NOTREACHED();
2478 } 2482 }
(...skipping 3922 matching lines...) Expand 10 before | Expand all | Expand 10 after
6401 EndTest(); 6405 EndTest();
6402 } 6406 }
6403 6407
6404 void AfterTest() override {} 6408 void AfterTest() override {}
6405 }; 6409 };
6406 6410
6407 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6411 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6408 6412
6409 } // namespace 6413 } // namespace
6410 } // namespace cc 6414 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698