Migrate pp::Rect to gfx::Rect in PDFiumRange
Update PDFiumRange to use gfx::Rect instead of pp::Rect. Update callers to expect gfx::Rect as return value instead of pp::Rect. Noteworthy point: PDFiumRange::GetScreenRects() returns a vector of rects. Instead of converting the returned vector of gfx::Rect to a vector of pp::Rect, the CL modifies recursively the usage of pp::Rect to gfx::Rect of the callers. The reason of updating the callers recursively is to prevent a copy of vector from one structure to another at caller site. Even temporarily, the additional copy of vectors is avoided in this way. Additional points: - In pp::Rect, Union() and Subtract() are utility methods which takes in two rects and returns a rect with the specified operation of input rects. Whereas in gfx::Rect, Union() and Subtract() are member methods which modify the rect in-place. All usage of Union() and Subtract() which are replaced in the CL modify the rect in-place. - In pp::Rect, Intersect() is a utility method which takes in two rects and returns the intersected rect. The counterpart in gfx::Rect is IntersectRects() and not Intersect(). Bug: 1101101 Change-Id: I90dce2c8b33fcced11c4e8a03e2cfb5ae1064abc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371142Reviewed-by:Lei Zhang <thestig@chromium.org> Reviewed-by:
K. Moon <kmoon@chromium.org> Commit-Queue: Ankit Kumar
🌪 ️ <ankk@microsoft.com> Cr-Commit-Position: refs/heads/master@{#802889}
Showing
This diff is collapsed.
Please register or sign in to comment