Commit 9740f4ef authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Rename some pp::Rect variables in PDFiumEngine::FillPageSides().

As is, a few variables are sometimes in one coordinate space and
sometimes in another. Tweak the code so these variables always hold
values in screen coordinates, and add "_in_screen" to their names.

Change-Id: Idf84a449be85ef26de6b960b1e3796b99946f0b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1725260Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683280}
parent df154e3e
...@@ -2811,23 +2811,25 @@ void PDFiumEngine::FillPageSides(int progressive_index) { ...@@ -2811,23 +2811,25 @@ void PDFiumEngine::FillPageSides(int progressive_index) {
// If in two-up view, only need to draw the left empty space for left pages // If in two-up view, only need to draw the left empty space for left pages
// since the gap between the left and right page will be drawn by the left // since the gap between the left and right page will be drawn by the left
// page. // page.
pp::Rect left = pp::Rect left_in_screen = GetScreenRect(
draw_utils::GetLeftFillRect(page_rect, inset_sizes, kBottomSeparator); draw_utils::GetLeftFillRect(page_rect, inset_sizes, kBottomSeparator));
left = GetScreenRect(left).Intersect(dirty_in_screen); left_in_screen = left_in_screen.Intersect(dirty_in_screen);
FPDFBitmap_FillRect(bitmap, left.x() - dirty_in_screen.x(), FPDFBitmap_FillRect(bitmap, left_in_screen.x() - dirty_in_screen.x(),
left.y() - dirty_in_screen.y(), left.width(), left_in_screen.y() - dirty_in_screen.y(),
left.height(), client_->GetBackgroundColor()); left_in_screen.width(), left_in_screen.height(),
client_->GetBackgroundColor());
} }
if (page_rect.right() < layout_.size().width()) { if (page_rect.right() < layout_.size().width()) {
pp::Rect right = draw_utils::GetRightFillRect( pp::Rect right_in_screen = GetScreenRect(draw_utils::GetRightFillRect(
page_rect, inset_sizes, layout_.size().width(), kBottomSeparator); page_rect, inset_sizes, layout_.size().width(), kBottomSeparator));
right = GetScreenRect(right).Intersect(dirty_in_screen); right_in_screen = right_in_screen.Intersect(dirty_in_screen);
FPDFBitmap_FillRect(bitmap, right.x() - dirty_in_screen.x(), FPDFBitmap_FillRect(bitmap, right_in_screen.x() - dirty_in_screen.x(),
right.y() - dirty_in_screen.y(), right.width(), right_in_screen.y() - dirty_in_screen.y(),
right.height(), client_->GetBackgroundColor()); right_in_screen.width(), right_in_screen.height(),
client_->GetBackgroundColor());
} }
pp::Rect bottom_in_screen; pp::Rect bottom_in_screen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment