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

Side by Side Diff: cc/trees/layer_tree_host_unittest.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
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/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 }; 1229 };
1230 1230
1231 MULTI_THREAD_TEST_F(LayerTreeHostTestSetVisible); 1231 MULTI_THREAD_TEST_F(LayerTreeHostTestSetVisible);
1232 1232
1233 class TestOpacityChangeLayerDelegate : public ContentLayerClient { 1233 class TestOpacityChangeLayerDelegate : public ContentLayerClient {
1234 public: 1234 public:
1235 TestOpacityChangeLayerDelegate() : test_layer_(0) {} 1235 TestOpacityChangeLayerDelegate() : test_layer_(0) {}
1236 1236
1237 void SetTestLayer(Layer* test_layer) { test_layer_ = test_layer; } 1237 void SetTestLayer(Layer* test_layer) { test_layer_ = test_layer; }
1238 1238
1239 virtual void PaintContents(SkCanvas*, gfx::Rect, gfx::RectF*) OVERRIDE { 1239 virtual void PaintContents(SkCanvas*, const gfx::Rect&,
1240 gfx::RectF*) OVERRIDE {
1240 // Set layer opacity to 0. 1241 // Set layer opacity to 0.
1241 if (test_layer_) 1242 if (test_layer_)
1242 test_layer_->SetOpacity(0.f); 1243 test_layer_->SetOpacity(0.f);
1243 } 1244 }
1244 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {} 1245 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
1245 1246
1246 private: 1247 private:
1247 Layer* test_layer_; 1248 Layer* test_layer_;
1248 }; 1249 };
1249 1250
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 class NotificationClient : public ContentLayerClient { 2507 class NotificationClient : public ContentLayerClient {
2507 public: 2508 public:
2508 NotificationClient() 2509 NotificationClient()
2509 : layer_(0), paint_count_(0), lcd_notification_count_(0) {} 2510 : layer_(0), paint_count_(0), lcd_notification_count_(0) {}
2510 2511
2511 void set_layer(Layer* layer) { layer_ = layer; } 2512 void set_layer(Layer* layer) { layer_ = layer; }
2512 int paint_count() const { return paint_count_; } 2513 int paint_count() const { return paint_count_; }
2513 int lcd_notification_count() const { return lcd_notification_count_; } 2514 int lcd_notification_count() const { return lcd_notification_count_; }
2514 2515
2515 virtual void PaintContents(SkCanvas* canvas, 2516 virtual void PaintContents(SkCanvas* canvas,
2516 gfx::Rect clip, 2517 const gfx::Rect& clip,
2517 gfx::RectF* opaque) OVERRIDE { 2518 gfx::RectF* opaque) OVERRIDE {
2518 ++paint_count_; 2519 ++paint_count_;
2519 } 2520 }
2520 virtual void DidChangeLayerCanUseLCDText() OVERRIDE { 2521 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {
2521 ++lcd_notification_count_; 2522 ++lcd_notification_count_;
2522 layer_->SetNeedsDisplay(); 2523 layer_->SetNeedsDisplay();
2523 } 2524 }
2524 2525
2525 private: 2526 private:
2526 Layer* layer_; 2527 Layer* layer_;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2749 class LayerTreeHostTestChangeLayerPropertiesInPaintContents 2750 class LayerTreeHostTestChangeLayerPropertiesInPaintContents
2750 : public LayerTreeHostTest { 2751 : public LayerTreeHostTest {
2751 public: 2752 public:
2752 class SetBoundsClient : public ContentLayerClient { 2753 class SetBoundsClient : public ContentLayerClient {
2753 public: 2754 public:
2754 SetBoundsClient() : layer_(0) {} 2755 SetBoundsClient() : layer_(0) {}
2755 2756
2756 void set_layer(Layer* layer) { layer_ = layer; } 2757 void set_layer(Layer* layer) { layer_ = layer; }
2757 2758
2758 virtual void PaintContents(SkCanvas* canvas, 2759 virtual void PaintContents(SkCanvas* canvas,
2759 gfx::Rect clip, 2760 const gfx::Rect& clip,
2760 gfx::RectF* opaque) OVERRIDE { 2761 gfx::RectF* opaque) OVERRIDE {
2761 layer_->SetBounds(gfx::Size(2, 2)); 2762 layer_->SetBounds(gfx::Size(2, 2));
2762 } 2763 }
2763 2764
2764 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {} 2765 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
2765 2766
2766 private: 2767 private:
2767 Layer* layer_; 2768 Layer* layer_;
2768 }; 2769 };
2769 2770
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
4766 4767
4767 EndTest(); 4768 EndTest();
4768 } 4769 }
4769 4770
4770 virtual void AfterTest() OVERRIDE {} 4771 virtual void AfterTest() OVERRIDE {}
4771 }; 4772 };
4772 4773
4773 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); 4774 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
4774 4775
4775 } // namespace cc 4776 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc ('k') | cc/trees/layer_tree_host_unittest_delegated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698