| 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 <map> | 5 #include <map> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "cc/resources/picture_pile.h" | 8 #include "cc/resources/picture_pile.h" |
| 9 #include "cc/test/fake_content_layer_client.h" | 9 #include "cc/test/fake_content_layer_client.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 gfx::Size tiling_size() const { return pile_.GetSize(); } | 63 gfx::Size tiling_size() const { return pile_.GetSize(); } |
| 64 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } | 64 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } |
| 65 | 65 |
| 66 bool UpdateAndExpandInvalidation(Region* invalidation, | 66 bool UpdateAndExpandInvalidation(Region* invalidation, |
| 67 const gfx::Size& layer_size, | 67 const gfx::Size& layer_size, |
| 68 const gfx::Rect& visible_layer_rect) { | 68 const gfx::Rect& visible_layer_rect) { |
| 69 frame_number_++; | 69 frame_number_++; |
| 70 return pile_.UpdateAndExpandInvalidation( | 70 return pile_.UpdateAndExpandInvalidation( |
| 71 &client_, invalidation, background_color_, contents_opaque_, false, | 71 &client_, invalidation, background_color_, contents_opaque_, false, |
| 72 layer_size, visible_layer_rect, frame_number_, | 72 false, layer_size, visible_layer_rect, frame_number_, |
| 73 Picture::RECORD_NORMALLY); | 73 Picture::RECORD_NORMALLY); |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool UpdateWholePile() { | 76 bool UpdateWholePile() { |
| 77 Region invalidation = tiling_rect(); | 77 Region invalidation = tiling_rect(); |
| 78 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), | 78 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), |
| 79 tiling_rect()); | 79 tiling_rect()); |
| 80 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); | 80 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); |
| 81 return result; | 81 return result; |
| 82 } | 82 } |
| (...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 EXPECT_TRUE(pile_.HasRecordings()); | 1566 EXPECT_TRUE(pile_.HasRecordings()); |
| 1567 pile_.SetEmptyBounds(); | 1567 pile_.SetEmptyBounds(); |
| 1568 EXPECT_FALSE(pile_.is_solid_color()); | 1568 EXPECT_FALSE(pile_.is_solid_color()); |
| 1569 EXPECT_TRUE(pile_.GetSize().IsEmpty()); | 1569 EXPECT_TRUE(pile_.GetSize().IsEmpty()); |
| 1570 EXPECT_TRUE(pile_.picture_map().empty()); | 1570 EXPECT_TRUE(pile_.picture_map().empty()); |
| 1571 EXPECT_FALSE(pile_.HasRecordings()); | 1571 EXPECT_FALSE(pile_.HasRecordings()); |
| 1572 } | 1572 } |
| 1573 | 1573 |
| 1574 } // namespace | 1574 } // namespace |
| 1575 } // namespace cc | 1575 } // namespace cc |
| OLD | NEW |