| 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 22 matching lines...) Expand all Loading... |
| 33 Region invalidation; | 33 Region invalidation; |
| 34 gfx::Rect viewport_rect(tiling_size); | 34 gfx::Rect viewport_rect(tiling_size); |
| 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, |
| 44 int* recorded_area) { |
| 45 frame_number_++; |
| 46 return pile_.UpdateAndExpandInvalidation( |
| 47 &client_, invalidation, layer_size, visible_layer_rect, frame_number_, |
| 48 RecordingSource::RECORD_NORMALLY, recorded_area); |
| 49 } |
| 50 |
| 51 bool UpdateAndExpandInvalidation(Region* invalidation, |
| 52 const gfx::Size& layer_size, |
| 43 const gfx::Rect& visible_layer_rect) { | 53 const gfx::Rect& visible_layer_rect) { |
| 44 frame_number_++; | 54 return UpdateAndExpandInvalidation(invalidation, layer_size, |
| 45 return pile_.UpdateAndExpandInvalidation(&client_, invalidation, layer_size, | 55 visible_layer_rect, nullptr); |
| 46 visible_layer_rect, frame_number_, | |
| 47 RecordingSource::RECORD_NORMALLY); | |
| 48 } | 56 } |
| 49 | 57 |
| 50 bool UpdateWholePile() { | 58 bool UpdateWholePile() { |
| 51 Region invalidation = tiling_rect(); | 59 Region invalidation = tiling_rect(); |
| 52 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), | 60 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), |
| 53 tiling_rect()); | 61 tiling_rect()); |
| 54 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); | 62 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); |
| 55 return result; | 63 return result; |
| 56 } | 64 } |
| 57 | 65 |
| (...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 EXPECT_TRUE(pile_.HasRecordings()); | 1344 EXPECT_TRUE(pile_.HasRecordings()); |
| 1337 pile_.SetEmptyBounds(); | 1345 pile_.SetEmptyBounds(); |
| 1338 EXPECT_FALSE(pile_.is_solid_color()); | 1346 EXPECT_FALSE(pile_.is_solid_color()); |
| 1339 EXPECT_TRUE(pile_.GetSize().IsEmpty()); | 1347 EXPECT_TRUE(pile_.GetSize().IsEmpty()); |
| 1340 EXPECT_TRUE(pile_.picture_map().empty()); | 1348 EXPECT_TRUE(pile_.picture_map().empty()); |
| 1341 EXPECT_FALSE(pile_.HasRecordings()); | 1349 EXPECT_FALSE(pile_.HasRecordings()); |
| 1342 } | 1350 } |
| 1343 | 1351 |
| 1344 } // namespace | 1352 } // namespace |
| 1345 } // namespace cc | 1353 } // namespace cc |
| OLD | NEW |