| 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 4827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4923 EXPECT_FLOAT_EQ(expected_contents_scale, | 4911 EXPECT_FLOAT_EQ(expected_contents_scale, |
| 4924 pending_layer_ptr->picture_layer_tiling_set() | 4912 pending_layer_ptr->picture_layer_tiling_set() |
| 4925 ->FindTilingWithResolution(HIGH_RESOLUTION) | 4913 ->FindTilingWithResolution(HIGH_RESOLUTION) |
| 4926 ->contents_scale()) | 4914 ->contents_scale()) |
| 4927 << "ideal_contents_scale: " << ideal_contents_scale; | 4915 << "ideal_contents_scale: " << ideal_contents_scale; |
| 4928 } | 4916 } |
| 4929 } | 4917 } |
| 4930 | 4918 |
| 4931 } // namespace | 4919 } // namespace |
| 4932 } // namespace cc | 4920 } // namespace cc |
| OLD | NEW |