OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "pdf/paint_aggregator.h" | 5 #include "pdf/paint_aggregator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 16 matching lines...) Expand all Loading... |
27 // rect, then we just treat the scroll rect as an invalidation rect. | 27 // rect, then we just treat the scroll rect as an invalidation rect. |
28 // | 28 // |
29 // For invalidations performed prior to scrolling and contained within the | 29 // For invalidations performed prior to scrolling and contained within the |
30 // scroll rect, we offset the invalidation rects to account for the fact that | 30 // scroll rect, we offset the invalidation rects to account for the fact that |
31 // the consumer will perform scrolling before painting. | 31 // the consumer will perform scrolling before painting. |
32 // | 32 // |
33 // We only support scrolling along one axis at a time. A diagonal scroll will | 33 // We only support scrolling along one axis at a time. A diagonal scroll will |
34 // therefore be treated as an invalidation. | 34 // therefore be treated as an invalidation. |
35 // ---------------------------------------------------------------------------- | 35 // ---------------------------------------------------------------------------- |
36 | 36 |
37 PaintAggregator::PaintUpdate::PaintUpdate() { | 37 PaintAggregator::PaintUpdate::PaintUpdate() = default; |
38 } | |
39 | 38 |
40 PaintAggregator::PaintUpdate::~PaintUpdate() { | 39 PaintAggregator::PaintUpdate::PaintUpdate(const PaintUpdate& that) = default; |
41 } | 40 |
| 41 PaintAggregator::PaintUpdate::~PaintUpdate() = default; |
42 | 42 |
43 PaintAggregator::InternalPaintUpdate::InternalPaintUpdate() : | 43 PaintAggregator::InternalPaintUpdate::InternalPaintUpdate() : |
44 synthesized_scroll_damage_rect_(false) { | 44 synthesized_scroll_damage_rect_(false) { |
45 } | 45 } |
46 | 46 |
47 PaintAggregator::InternalPaintUpdate::~InternalPaintUpdate() { | 47 PaintAggregator::InternalPaintUpdate::~InternalPaintUpdate() { |
48 } | 48 } |
49 | 49 |
50 pp::Rect PaintAggregator::InternalPaintUpdate::GetScrollDamage() const { | 50 pp::Rect PaintAggregator::InternalPaintUpdate::GetScrollDamage() const { |
51 // Should only be scrolling in one direction at a time. | 51 // Should only be scrolling in one direction at a time. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 | 283 |
284 // If the new paint overlaps with a scroll, then also invalidate the rect in | 284 // If the new paint overlaps with a scroll, then also invalidate the rect in |
285 // its new position. | 285 // its new position. |
286 if (check_scroll && | 286 if (check_scroll && |
287 !update_.scroll_rect.IsEmpty() && | 287 !update_.scroll_rect.IsEmpty() && |
288 update_.scroll_rect.Intersects(rect)) { | 288 update_.scroll_rect.Intersects(rect)) { |
289 InvalidateRectInternal(ScrollPaintRect(rect, update_.scroll_delta), false); | 289 InvalidateRectInternal(ScrollPaintRect(rect, update_.scroll_delta), false); |
290 } | 290 } |
291 } | 291 } |
OLD | NEW |