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