Commit 6cbdc4ff authored by Hui Yingst's avatar Hui Yingst Committed by Chromium LUCI CQ

Change BackgroundPart::location from pp::Rect to gfx::Rect

This CL changes BackgroundPart::location from pp::Rect to gfx::Rect so
that `background_parts_` can be migrated to PdfViewPluginBase later.

Bug: 1101101
Change-Id: Ib2ab5ab6cfb4c58bde3a2a4e71fd2886231a8a4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625088
Commit-Queue: Hui Yingst <nigi@chromium.org>
Reviewed-by: default avatarK. Moon <kmoon@chromium.org>
Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843242}
parent 95549c2d
...@@ -1218,7 +1218,7 @@ void OutOfProcessInstance::DoPaint(const std::vector<gfx::Rect>& paint_rects, ...@@ -1218,7 +1218,7 @@ void OutOfProcessInstance::DoPaint(const std::vector<gfx::Rect>& paint_rects,
for (const auto& background_part : background_parts_) { for (const auto& background_part : background_parts_) {
gfx::Rect intersection = gfx::Rect intersection =
gfx::IntersectRects(RectFromPPRect(background_part.location), rect); gfx::IntersectRects(background_part.location, rect);
if (!intersection.IsEmpty()) { if (!intersection.IsEmpty()) {
FillRect(intersection, background_part.color); FillRect(intersection, background_part.color);
ready->push_back(PaintReadyRect(intersection, image_data_)); ready->push_back(PaintReadyRect(intersection, image_data_));
...@@ -1246,15 +1246,14 @@ void OutOfProcessInstance::CalculateBackgroundParts() { ...@@ -1246,15 +1246,14 @@ void OutOfProcessInstance::CalculateBackgroundParts() {
// Add the left, right, and bottom rectangles. Note: we assume only // Add the left, right, and bottom rectangles. Note: we assume only
// horizontal centering. // horizontal centering.
BackgroundPart part = {pp::Rect(0, 0, left_width, bottom), BackgroundPart part = {gfx::Rect(left_width, bottom), GetBackgroundColor()};
GetBackgroundColor()};
if (!part.location.IsEmpty()) if (!part.location.IsEmpty())
background_parts_.push_back(part); background_parts_.push_back(part);
part.location = pp::Rect(right_start, 0, right_width, bottom); part.location = gfx::Rect(right_start, 0, right_width, bottom);
if (!part.location.IsEmpty()) if (!part.location.IsEmpty())
background_parts_.push_back(part); background_parts_.push_back(part);
part.location = pp::Rect(0, bottom, plugin_size().width(), part.location = gfx::Rect(0, bottom, plugin_size().width(),
plugin_size().height() - bottom); plugin_size().height() - bottom);
if (!part.location.IsEmpty()) if (!part.location.IsEmpty())
background_parts_.push_back(part); background_parts_.push_back(part);
} }
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#include "ppapi/cpp/instance.h" #include "ppapi/cpp/instance.h"
#include "ppapi/cpp/private/find_private.h" #include "ppapi/cpp/private/find_private.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/rect.h"
namespace gfx { namespace gfx {
class Rect;
class Size; class Size;
class Vector2d; class Vector2d;
} // namespace gfx } // namespace gfx
...@@ -378,7 +378,7 @@ class OutOfProcessInstance : public PdfViewPluginBase, ...@@ -378,7 +378,7 @@ class OutOfProcessInstance : public PdfViewPluginBase,
std::vector<gfx::Rect> deferred_invalidates_; std::vector<gfx::Rect> deferred_invalidates_;
struct BackgroundPart { struct BackgroundPart {
pp::Rect location; gfx::Rect location;
uint32_t color; uint32_t color;
}; };
std::vector<BackgroundPart> background_parts_; std::vector<BackgroundPart> background_parts_;
......
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