| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/resources/picture_pile.h" | 5 #include "cc/resources/picture_pile.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
| 11 #include "cc/resources/picture_pile_impl.h" | 11 #include "cc/resources/picture_pile_impl.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 // Maximum number of pictures that can overlap before we collapse them into | 14 // Maximum number of pictures that can overlap before we collapse them into |
| 15 // a larger one. | 15 // a larger one. |
| 16 const int kMaxOverlapping = 2; | 16 const size_t kMaxOverlapping = 2; |
| 17 // Maximum percentage area of the base picture another picture in the picture | 17 // Maximum percentage area of the base picture another picture in the picture |
| 18 // list can be. If higher, we destroy the list and recreate from scratch. | 18 // list can be. If higher, we destroy the list and recreate from scratch. |
| 19 const float kResetThreshold = 0.7f; | 19 const float kResetThreshold = 0.7f; |
| 20 // Layout pixel buffer around the visible layer rect to record. Any base | 20 // Layout pixel buffer around the visible layer rect to record. Any base |
| 21 // picture that intersects the visible layer rect expanded by this distance | 21 // picture that intersects the visible layer rect expanded by this distance |
| 22 // will be recorded. | 22 // will be recorded. |
| 23 const int kPixelDistanceToRecord = 8000; | 23 const int kPixelDistanceToRecord = 8000; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace cc { | 26 namespace cc { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 FullyContainedPredicate pred(picture_rect); | 152 FullyContainedPredicate pred(picture_rect); |
| 153 picture_list.erase(std::remove_if(picture_list.begin(), | 153 picture_list.erase(std::remove_if(picture_list.begin(), |
| 154 picture_list.end(), | 154 picture_list.end(), |
| 155 pred), | 155 pred), |
| 156 picture_list.end()); | 156 picture_list.end()); |
| 157 picture_list.push_back(Picture::Create(picture_rect)); | 157 picture_list.push_back(Picture::Create(picture_rect)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace cc | 160 } // namespace cc |
| OLD | NEW |