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 21 matching lines...) Expand all Loading... |
32 UpdateAndExpandInvalidation(&invalidation, tiling_size, viewport_rect); | 32 UpdateAndExpandInvalidation(&invalidation, tiling_size, viewport_rect); |
33 } | 33 } |
34 | 34 |
35 gfx::Size tiling_size() const { return pile_.GetSize(); } | 35 gfx::Size tiling_size() const { return pile_.GetSize(); } |
36 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } | 36 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } |
37 | 37 |
38 bool UpdateAndExpandInvalidation(Region* invalidation, | 38 bool UpdateAndExpandInvalidation(Region* invalidation, |
39 const gfx::Size& layer_size, | 39 const gfx::Size& layer_size, |
40 const gfx::Rect& visible_layer_rect) { | 40 const gfx::Rect& visible_layer_rect) { |
41 frame_number_++; | 41 frame_number_++; |
42 return pile_.UpdateAndExpandInvalidation(&client_, invalidation, layer_size, | 42 return pile_.UpdateAndExpandInvalidation( |
43 visible_layer_rect, frame_number_, | 43 &client_, invalidation, false, layer_size, visible_layer_rect, |
44 Picture::RECORD_NORMALLY); | 44 frame_number_, Picture::RECORD_NORMALLY); |
45 } | 45 } |
46 | 46 |
47 bool UpdateWholePile() { | 47 bool UpdateWholePile() { |
48 Region invalidation = tiling_rect(); | 48 Region invalidation = tiling_rect(); |
49 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), | 49 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), |
50 tiling_rect()); | 50 tiling_rect()); |
51 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); | 51 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); |
52 return result; | 52 return result; |
53 } | 53 } |
54 | 54 |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 EXPECT_TRUE(pile_.HasRecordings()); | 1535 EXPECT_TRUE(pile_.HasRecordings()); |
1536 pile_.SetEmptyBounds(); | 1536 pile_.SetEmptyBounds(); |
1537 EXPECT_FALSE(pile_.is_solid_color()); | 1537 EXPECT_FALSE(pile_.is_solid_color()); |
1538 EXPECT_TRUE(pile_.GetSize().IsEmpty()); | 1538 EXPECT_TRUE(pile_.GetSize().IsEmpty()); |
1539 EXPECT_TRUE(pile_.picture_map().empty()); | 1539 EXPECT_TRUE(pile_.picture_map().empty()); |
1540 EXPECT_FALSE(pile_.HasRecordings()); | 1540 EXPECT_FALSE(pile_.HasRecordings()); |
1541 } | 1541 } |
1542 | 1542 |
1543 } // namespace | 1543 } // namespace |
1544 } // namespace cc | 1544 } // namespace cc |
OLD | NEW |