OLD | NEW |
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/location.h" | 10 #include "base/location.h" |
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 class TestOpacityChangeLayerDelegate : public ContentLayerClient { | 1564 class TestOpacityChangeLayerDelegate : public ContentLayerClient { |
1565 public: | 1565 public: |
1566 TestOpacityChangeLayerDelegate() : test_layer_(0) {} | 1566 TestOpacityChangeLayerDelegate() : test_layer_(0) {} |
1567 | 1567 |
1568 void SetTestLayer(Layer* test_layer) { test_layer_ = test_layer; } | 1568 void SetTestLayer(Layer* test_layer) { test_layer_ = test_layer; } |
1569 | 1569 |
1570 gfx::Rect PaintableRegion() override { | 1570 gfx::Rect PaintableRegion() override { |
1571 return gfx::Rect(test_layer_->bounds()); | 1571 return gfx::Rect(test_layer_->bounds()); |
1572 } | 1572 } |
1573 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( | 1573 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( |
1574 const gfx::Rect& clip, | |
1575 PaintingControlSetting picture_control) override { | 1574 PaintingControlSetting picture_control) override { |
1576 // Set layer opacity to 0. | 1575 // Set layer opacity to 0. |
1577 if (test_layer_) | 1576 if (test_layer_) |
1578 test_layer_->SetOpacity(0.f); | 1577 test_layer_->SetOpacity(0.f); |
1579 | 1578 |
1580 // Return a dummy display list. | 1579 // Return a dummy display list. |
1581 scoped_refptr<DisplayItemList> display_list = | 1580 scoped_refptr<DisplayItemList> display_list = |
1582 DisplayItemList::Create(clip, DisplayItemListSettings()); | 1581 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); |
1583 return display_list; | 1582 return display_list; |
1584 } | 1583 } |
1585 bool FillsBoundsCompletely() const override { return false; } | 1584 bool FillsBoundsCompletely() const override { return false; } |
1586 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } | 1585 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } |
1587 | 1586 |
1588 private: | 1587 private: |
1589 Layer* test_layer_; | 1588 Layer* test_layer_; |
1590 }; | 1589 }; |
1591 | 1590 |
1592 // Layer opacity change during paint should not prevent compositor resources | 1591 // Layer opacity change during paint should not prevent compositor resources |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 public: | 2171 public: |
2173 class SetBoundsClient : public ContentLayerClient { | 2172 class SetBoundsClient : public ContentLayerClient { |
2174 public: | 2173 public: |
2175 SetBoundsClient() : layer_(0) {} | 2174 SetBoundsClient() : layer_(0) {} |
2176 | 2175 |
2177 void set_layer(Layer* layer) { layer_ = layer; } | 2176 void set_layer(Layer* layer) { layer_ = layer; } |
2178 | 2177 |
2179 gfx::Rect PaintableRegion() override { return gfx::Rect(layer_->bounds()); } | 2178 gfx::Rect PaintableRegion() override { return gfx::Rect(layer_->bounds()); } |
2180 | 2179 |
2181 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( | 2180 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( |
2182 const gfx::Rect& clip, | |
2183 PaintingControlSetting picture_control) override { | 2181 PaintingControlSetting picture_control) override { |
2184 layer_->SetBounds(gfx::Size(2, 2)); | 2182 layer_->SetBounds(gfx::Size(2, 2)); |
2185 | 2183 |
2186 // Return a dummy display list. | 2184 // Return a dummy display list. |
2187 scoped_refptr<DisplayItemList> display_list = | 2185 scoped_refptr<DisplayItemList> display_list = |
2188 DisplayItemList::Create(clip, DisplayItemListSettings()); | 2186 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); |
2189 return display_list; | 2187 return display_list; |
2190 } | 2188 } |
2191 | 2189 |
2192 bool FillsBoundsCompletely() const override { return false; } | 2190 bool FillsBoundsCompletely() const override { return false; } |
2193 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } | 2191 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } |
2194 | 2192 |
2195 private: | 2193 private: |
2196 Layer* layer_; | 2194 Layer* layer_; |
2197 }; | 2195 }; |
2198 | 2196 |
(...skipping 4249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6448 EndTest(); | 6446 EndTest(); |
6449 } | 6447 } |
6450 | 6448 |
6451 void AfterTest() override {} | 6449 void AfterTest() override {} |
6452 }; | 6450 }; |
6453 | 6451 |
6454 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6452 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
6455 | 6453 |
6456 } // namespace | 6454 } // namespace |
6457 } // namespace cc | 6455 } // namespace cc |
OLD | NEW |