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 "cc/test/fake_picture_pile.h" | 10 #include "cc/test/fake_picture_pile.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 gfx::Size tiling_size() const { return pile_.GetSize(); } | 39 gfx::Size tiling_size() const { return pile_.GetSize(); } |
40 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } | 40 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } |
41 | 41 |
42 bool UpdateAndExpandInvalidation(Region* invalidation, | 42 bool UpdateAndExpandInvalidation(Region* invalidation, |
43 const gfx::Size& layer_size, | 43 const gfx::Size& layer_size, |
44 const gfx::Rect& visible_layer_rect) { | 44 const gfx::Rect& visible_layer_rect) { |
45 frame_number_++; | 45 frame_number_++; |
46 return pile_.UpdateAndExpandInvalidation( | 46 return pile_.UpdateAndExpandInvalidation( |
47 &client_, invalidation, background_color_, contents_opaque_, false, | 47 &client_, invalidation, background_color_, contents_opaque_, false, |
48 layer_size, visible_layer_rect, frame_number_, | 48 false, layer_size, visible_layer_rect, frame_number_, |
49 Picture::RECORD_NORMALLY); | 49 Picture::RECORD_NORMALLY); |
50 } | 50 } |
51 | 51 |
52 bool UpdateWholePile() { | 52 bool UpdateWholePile() { |
53 Region invalidation = tiling_rect(); | 53 Region invalidation = tiling_rect(); |
54 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), | 54 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), |
55 tiling_rect()); | 55 tiling_rect()); |
56 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); | 56 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); |
57 return result; | 57 return result; |
58 } | 58 } |
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 EXPECT_TRUE(pile_.HasRecordings()); | 1542 EXPECT_TRUE(pile_.HasRecordings()); |
1543 pile_.SetEmptyBounds(); | 1543 pile_.SetEmptyBounds(); |
1544 EXPECT_FALSE(pile_.is_solid_color()); | 1544 EXPECT_FALSE(pile_.is_solid_color()); |
1545 EXPECT_TRUE(pile_.GetSize().IsEmpty()); | 1545 EXPECT_TRUE(pile_.GetSize().IsEmpty()); |
1546 EXPECT_TRUE(pile_.picture_map().empty()); | 1546 EXPECT_TRUE(pile_.picture_map().empty()); |
1547 EXPECT_FALSE(pile_.HasRecordings()); | 1547 EXPECT_FALSE(pile_.HasRecordings()); |
1548 } | 1548 } |
1549 | 1549 |
1550 } // namespace | 1550 } // namespace |
1551 } // namespace cc | 1551 } // namespace cc |
OLD | NEW |