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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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 | « cc/test/layer_tree_test.h ('k') | cc/test/occlusion_tracker_test_common.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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 virtual void CommitComplete() OVERRIDE { 97 virtual void CommitComplete() OVERRIDE {
98 LayerTreeHostImpl::CommitComplete(); 98 LayerTreeHostImpl::CommitComplete();
99 test_hooks_->CommitCompleteOnThread(this); 99 test_hooks_->CommitCompleteOnThread(this);
100 100
101 if (!settings().impl_side_painting) { 101 if (!settings().impl_side_painting) {
102 test_hooks_->WillActivateTreeOnThread(this); 102 test_hooks_->WillActivateTreeOnThread(this);
103 test_hooks_->DidActivateTreeOnThread(this); 103 test_hooks_->DidActivateTreeOnThread(this);
104 } 104 }
105 } 105 }
106 106
107 virtual bool PrepareToDraw(FrameData* frame, gfx::Rect damage_rect) OVERRIDE { 107 virtual bool PrepareToDraw(FrameData* frame,
108 const gfx::Rect& damage_rect) OVERRIDE {
108 bool result = LayerTreeHostImpl::PrepareToDraw(frame, damage_rect); 109 bool result = LayerTreeHostImpl::PrepareToDraw(frame, damage_rect);
109 if (!test_hooks_->PrepareToDrawOnThread(this, frame, result)) 110 if (!test_hooks_->PrepareToDrawOnThread(this, frame, result))
110 result = false; 111 result = false;
111 return result; 112 return result;
112 } 113 }
113 114
114 virtual void DrawLayers(FrameData* frame, 115 virtual void DrawLayers(FrameData* frame,
115 base::TimeTicks frame_begin_time) OVERRIDE { 116 base::TimeTicks frame_begin_time) OVERRIDE {
116 LayerTreeHostImpl::DrawLayers(frame, frame_begin_time); 117 LayerTreeHostImpl::DrawLayers(frame, frame_begin_time);
117 test_hooks_->DrawLayersOnThread(this); 118 test_hooks_->DrawLayersOnThread(this);
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 base::Bind(&LayerTreeTest::DispatchAcquireLayerTextures, 433 base::Bind(&LayerTreeTest::DispatchAcquireLayerTextures,
433 main_thread_weak_ptr_)); 434 main_thread_weak_ptr_));
434 } 435 }
435 436
436 void LayerTreeTest::PostSetNeedsRedrawToMainThread() { 437 void LayerTreeTest::PostSetNeedsRedrawToMainThread() {
437 main_task_runner_->PostTask(FROM_HERE, 438 main_task_runner_->PostTask(FROM_HERE,
438 base::Bind(&LayerTreeTest::DispatchSetNeedsRedraw, 439 base::Bind(&LayerTreeTest::DispatchSetNeedsRedraw,
439 main_thread_weak_ptr_)); 440 main_thread_weak_ptr_));
440 } 441 }
441 442
442 void LayerTreeTest::PostSetNeedsRedrawRectToMainThread(gfx::Rect damage_rect) { 443 void LayerTreeTest::PostSetNeedsRedrawRectToMainThread(
444 const gfx::Rect& damage_rect) {
443 main_task_runner_->PostTask( 445 main_task_runner_->PostTask(
444 FROM_HERE, 446 FROM_HERE,
445 base::Bind(&LayerTreeTest::DispatchSetNeedsRedrawRect, 447 base::Bind(&LayerTreeTest::DispatchSetNeedsRedrawRect,
446 main_thread_weak_ptr_, 448 main_thread_weak_ptr_,
447 damage_rect)); 449 damage_rect));
448 } 450 }
449 451
450 void LayerTreeTest::PostSetVisibleToMainThread(bool visible) { 452 void LayerTreeTest::PostSetVisibleToMainThread(bool visible) {
451 main_task_runner_->PostTask( 453 main_task_runner_->PostTask(
452 FROM_HERE, 454 FROM_HERE,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 layer_tree_host_->AcquireLayerTextures(); 578 layer_tree_host_->AcquireLayerTextures();
577 } 579 }
578 580
579 void LayerTreeTest::DispatchSetNeedsRedraw() { 581 void LayerTreeTest::DispatchSetNeedsRedraw() {
580 DCHECK(!proxy() || proxy()->IsMainThread()); 582 DCHECK(!proxy() || proxy()->IsMainThread());
581 583
582 if (layer_tree_host_) 584 if (layer_tree_host_)
583 layer_tree_host_->SetNeedsRedraw(); 585 layer_tree_host_->SetNeedsRedraw();
584 } 586 }
585 587
586 void LayerTreeTest::DispatchSetNeedsRedrawRect(gfx::Rect damage_rect) { 588 void LayerTreeTest::DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect) {
587 DCHECK(!proxy() || proxy()->IsMainThread()); 589 DCHECK(!proxy() || proxy()->IsMainThread());
588 590
589 if (layer_tree_host_) 591 if (layer_tree_host_)
590 layer_tree_host_->SetNeedsRedrawRect(damage_rect); 592 layer_tree_host_->SetNeedsRedrawRect(damage_rect);
591 } 593 }
592 594
593 void LayerTreeTest::DispatchSetVisible(bool visible) { 595 void LayerTreeTest::DispatchSetVisible(bool visible) {
594 DCHECK(!proxy() || proxy()->IsMainThread()); 596 DCHECK(!proxy() || proxy()->IsMainThread());
595 597
596 if (!layer_tree_host_) 598 if (!layer_tree_host_)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 } 696 }
695 697
696 scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() { 698 scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() {
697 if (!compositor_contexts_.get() || 699 if (!compositor_contexts_.get() ||
698 compositor_contexts_->DestroyedOnMainThread()) 700 compositor_contexts_->DestroyedOnMainThread())
699 compositor_contexts_ = TestContextProvider::Create(); 701 compositor_contexts_ = TestContextProvider::Create();
700 return compositor_contexts_; 702 return compositor_contexts_;
701 } 703 }
702 704
703 } // namespace cc 705 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/test/occlusion_tracker_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698