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