| Index: cc/resources/picture_pile.cc
|
| diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
|
| index 1b814477b427f3324d0f5b9048187d5c658e949a..64a51eb5dab109a89f01f176184edd826a44d212 100644
|
| --- a/cc/resources/picture_pile.cc
|
| +++ b/cc/resources/picture_pile.cc
|
| @@ -8,6 +8,7 @@
|
| #include <limits>
|
| #include <vector>
|
|
|
| +#include "base/numerics/safe_math.h"
|
| #include "cc/base/region.h"
|
| #include "cc/resources/picture_pile_impl.h"
|
| #include "skia/ext/analysis_canvas.h"
|
| @@ -180,7 +181,8 @@ bool PicturePile::UpdateAndExpandInvalidation(
|
| const gfx::Size& layer_size,
|
| const gfx::Rect& visible_layer_rect,
|
| int frame_number,
|
| - RecordingSource::RecordingMode recording_mode) {
|
| + RecordingSource::RecordingMode recording_mode,
|
| + int* recorded_area) {
|
| gfx::Rect interest_rect = visible_layer_rect;
|
| interest_rect.Inset(-pixel_record_distance_, -pixel_record_distance_);
|
| recorded_viewport_ = interest_rect;
|
| @@ -194,6 +196,13 @@ bool PicturePile::UpdateAndExpandInvalidation(
|
| std::vector<gfx::Rect> record_rects;
|
| ClusterTiles(invalid_tiles, &record_rects);
|
|
|
| + if (recorded_area) {
|
| + base::CheckedNumeric<int> area = 0;
|
| + for (const auto& record_rect : record_rects)
|
| + area += record_rect.size().GetArea();
|
| + *recorded_area = area.ValueOrDefault(std::numeric_limits<int>::max());
|
| + }
|
| +
|
| if (record_rects.empty())
|
| return updated;
|
|
|
|
|