OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #define EXPECT_BOTH_NE(expression, x) \ | 43 #define EXPECT_BOTH_NE(expression, x) \ |
44 do { \ | 44 do { \ |
45 EXPECT_NE(x, pending_layer_->expression); \ | 45 EXPECT_NE(x, pending_layer_->expression); \ |
46 EXPECT_NE(x, active_layer_->expression); \ | 46 EXPECT_NE(x, active_layer_->expression); \ |
47 } while (false) | 47 } while (false) |
48 | 48 |
49 class MockCanvas : public SkCanvas { | 49 class MockCanvas : public SkCanvas { |
50 public: | 50 public: |
51 explicit MockCanvas(int w, int h) : SkCanvas(w, h) {} | 51 explicit MockCanvas(int w, int h) : SkCanvas(w, h) {} |
52 | 52 |
53 void drawRect(const SkRect& rect, const SkPaint& paint) override { | 53 void onDrawRect(const SkRect& rect, const SkPaint& paint) override { |
54 // Capture calls before SkCanvas quickReject() kicks in. | 54 // Capture calls before SkCanvas quickReject() kicks in. |
55 rects_.push_back(rect); | 55 rects_.push_back(rect); |
56 } | 56 } |
57 | 57 |
58 std::vector<SkRect> rects_; | 58 std::vector<SkRect> rects_; |
59 }; | 59 }; |
60 | 60 |
61 class NoLowResTilingsSettings : public ImplSidePaintingSettings {}; | 61 class NoLowResTilingsSettings : public ImplSidePaintingSettings {}; |
62 | 62 |
63 class LowResTilingsSettings : public ImplSidePaintingSettings { | 63 class LowResTilingsSettings : public ImplSidePaintingSettings { |
(...skipping 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4732 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4732 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
4733 EXPECT_EQ(result.width(), 448); | 4733 EXPECT_EQ(result.width(), 448); |
4734 EXPECT_EQ(result.height(), 448); | 4734 EXPECT_EQ(result.height(), 448); |
4735 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4735 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
4736 EXPECT_EQ(result.width(), 512); | 4736 EXPECT_EQ(result.width(), 512); |
4737 EXPECT_EQ(result.height(), 500 + 2); | 4737 EXPECT_EQ(result.height(), 500 + 2); |
4738 } | 4738 } |
4739 | 4739 |
4740 } // namespace | 4740 } // namespace |
4741 } // namespace cc | 4741 } // namespace cc |
OLD | NEW |