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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 EXPECT_TRUE(pending_layer()->expression); \ | 64 EXPECT_TRUE(pending_layer()->expression); \ |
65 EXPECT_TRUE(active_layer()->expression); \ | 65 EXPECT_TRUE(active_layer()->expression); \ |
66 } while (false) | 66 } while (false) |
67 | 67 |
68 #define EXPECT_BOTH_FALSE(expression) \ | 68 #define EXPECT_BOTH_FALSE(expression) \ |
69 do { \ | 69 do { \ |
70 EXPECT_FALSE(pending_layer()->expression); \ | 70 EXPECT_FALSE(pending_layer()->expression); \ |
71 EXPECT_FALSE(active_layer()->expression); \ | 71 EXPECT_FALSE(active_layer()->expression); \ |
72 } while (false) | 72 } while (false) |
73 | 73 |
74 class MockCanvas : public SkCanvas { | |
75 public: | |
76 explicit MockCanvas(int w, int h) : SkCanvas(w, h) {} | |
77 | |
78 void onDrawRect(const SkRect& rect, const SkPaint& paint) override { | |
79 // Capture calls before SkCanvas quickReject() kicks in. | |
80 rects_.push_back(rect); | |
81 } | |
82 | |
83 std::vector<SkRect> rects_; | |
84 }; | |
85 | |
86 class PictureLayerImplTest : public TestLayerTreeHostBase { | 74 class PictureLayerImplTest : public TestLayerTreeHostBase { |
87 public: | 75 public: |
88 void SetUp() override { | 76 void SetUp() override { |
89 TestLayerTreeHostBase::SetUp(); | 77 TestLayerTreeHostBase::SetUp(); |
90 host_impl()->SetViewportSize(gfx::Size(10000, 10000)); | 78 host_impl()->SetViewportSize(gfx::Size(10000, 10000)); |
91 } | 79 } |
92 | 80 |
93 LayerTreeSettings CreateSettings() override { | 81 LayerTreeSettings CreateSettings() override { |
94 LayerTreeSettings settings; | 82 LayerTreeSettings settings; |
95 settings.gpu_rasterization_enabled = true; | 83 settings.gpu_rasterization_enabled = true; |
(...skipping 4857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4953 EXPECT_FLOAT_EQ(expected_contents_scale, | 4941 EXPECT_FLOAT_EQ(expected_contents_scale, |
4954 pending_layer_ptr->picture_layer_tiling_set() | 4942 pending_layer_ptr->picture_layer_tiling_set() |
4955 ->FindTilingWithResolution(HIGH_RESOLUTION) | 4943 ->FindTilingWithResolution(HIGH_RESOLUTION) |
4956 ->contents_scale()) | 4944 ->contents_scale()) |
4957 << "ideal_contents_scale: " << ideal_contents_scale; | 4945 << "ideal_contents_scale: " << ideal_contents_scale; |
4958 } | 4946 } |
4959 } | 4947 } |
4960 | 4948 |
4961 } // namespace | 4949 } // namespace |
4962 } // namespace cc | 4950 } // namespace cc |
OLD | NEW |