Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: pdf/paint_aggregator.cc

Issue 1555153003: Another round of PDF plugin cleanups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/out_of_process_instance.cc ('k') | pdf/paint_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/paint_aggregator.cc
diff --git a/pdf/paint_aggregator.cc b/pdf/paint_aggregator.cc
index c14dded822f51402d84f4eb469bbe6be94bb0ce7..50d77fe47d3569f71762cb2597c685d630ff9bcc 100644
--- a/pdf/paint_aggregator.cc
+++ b/pdf/paint_aggregator.cc
@@ -105,15 +105,15 @@ PaintAggregator::PaintUpdate PaintAggregator::GetPendingUpdate() {
// Include the scroll damage (if any) in the paint rects.
// Code invalidates damaged rect here, it pick it up from the list of paint
// rects in the next block.
- if (ret.has_scroll && !update_.synthesized_scroll_damage_rect_) {
+ if (ret.has_scroll && !update_.synthesized_scroll_damage_rect_) {
update_.synthesized_scroll_damage_rect_ = true;
pp::Rect scroll_damage = update_.GetScrollDamage();
InvalidateRectInternal(scroll_damage, false);
}
ret.paint_rects.reserve(update_.paint_rects.size() + 1);
- for (size_t i = 0; i < update_.paint_rects.size(); i++)
- ret.paint_rects.push_back(update_.paint_rects[i]);
+ ret.paint_rects.insert(ret.paint_rects.end(), update_.paint_rects.begin(),
+ update_.paint_rects.end());
return ret;
}
@@ -217,14 +217,12 @@ void PaintAggregator::ScrollRect(const pp::Rect& clip_rect,
}
}
- for (size_t i = 0; i < leftover_rects.size(); ++i)
- InvalidateRectInternal(leftover_rects[i], false);
+ for (const auto& leftover_rect : leftover_rects)
+ InvalidateRectInternal(leftover_rect, false);
- for (size_t i = 0; i < update_.ready_rects.size(); ++i) {
- if (update_.scroll_rect.Contains(update_.ready_rects[i].rect)) {
- update_.ready_rects[i].rect =
- ScrollPaintRect(update_.ready_rects[i].rect, amount);
- }
+ for (auto& update_rect : update_.ready_rects) {
+ if (update_.scroll_rect.Contains(update_rect.rect))
+ update_rect.rect = ScrollPaintRect(update_rect.rect, amount);
}
if (update_.synthesized_scroll_damage_rect_) {
« no previous file with comments | « pdf/out_of_process_instance.cc ('k') | pdf/paint_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698