diff options
Diffstat (limited to 'chromium/pdf/paint_manager.cc')
-rw-r--r-- | chromium/pdf/paint_manager.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/chromium/pdf/paint_manager.cc b/chromium/pdf/paint_manager.cc index 226994c3b05..7811f07d5f6 100644 --- a/chromium/pdf/paint_manager.cc +++ b/chromium/pdf/paint_manager.cc @@ -14,13 +14,22 @@ #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" +PaintManager::ReadyRect::ReadyRect() = default; + +PaintManager::ReadyRect::ReadyRect(const pp::Rect& r, + const pp::ImageData& i, + bool f) + : rect(r), image_data(i), flush_now(f) {} + +PaintManager::ReadyRect::ReadyRect(const ReadyRect& that) = default; + PaintManager::PaintManager(pp::Instance* instance, Client* client, bool is_always_opaque) : instance_(instance), client_(client), is_always_opaque_(is_always_opaque), - callback_factory_(NULL), + callback_factory_(nullptr), manual_callback_pending_(false), flush_pending_(false), has_pending_resize_(false), @@ -164,8 +173,8 @@ void PaintManager::EnsureCallbackPending() { void PaintManager::DoPaint() { in_paint_ = true; - std::vector<ReadyRect> ready; - std::vector<pp::Rect> pending; + std::vector<ReadyRect> ready_rects; + std::vector<pp::Rect> pending_rects; DCHECK(aggregator_.HasPendingUpdate()); @@ -201,18 +210,18 @@ void PaintManager::DoPaint() { } PaintAggregator::PaintUpdate update = aggregator_.GetPendingUpdate(); - client_->OnPaint(update.paint_rects, &ready, &pending); + client_->OnPaint(update.paint_rects, &ready_rects, &pending_rects); - if (ready.empty() && pending.empty()) { + if (ready_rects.empty() && pending_rects.empty()) { in_paint_ = false; return; // Nothing was painted, don't schedule a flush. } std::vector<PaintAggregator::ReadyRect> ready_now; - if (pending.empty()) { + if (pending_rects.empty()) { std::vector<PaintAggregator::ReadyRect> temp_ready; - temp_ready.insert(temp_ready.end(), ready.begin(), ready.end()); - aggregator_.SetIntermediateResults(temp_ready, pending); + temp_ready.insert(temp_ready.end(), ready_rects.begin(), ready_rects.end()); + aggregator_.SetIntermediateResults(temp_ready, pending_rects); ready_now = aggregator_.GetReadyRects(); aggregator_.ClearPendingUpdate(); @@ -223,7 +232,7 @@ void PaintManager::DoPaint() { view_size_changed_waiting_for_paint_ = false; } else { std::vector<PaintAggregator::ReadyRect> ready_later; - for (const auto& ready_rect : ready) { + for (const auto& ready_rect : ready_rects) { // Don't flush any part (i.e. scrollbars) if we're resizing the browser, // as that'll lead to flashes. Until we flush, the browser will use the // previous image, but if we flush, it'll revert to using the blank image. @@ -238,7 +247,7 @@ void PaintManager::DoPaint() { } // Take the rectangles, except the ones that need to be flushed right away, // and save them so that everything is flushed at once. - aggregator_.SetIntermediateResults(ready_later, pending); + aggregator_.SetIntermediateResults(ready_later, pending_rects); if (ready_now.empty()) { in_paint_ = false; |