0

Revert "Check result of Sk[I]Rect::intersect"

This reverts commit 3927c5eff6.

Reason for revert: possibly causing b/361364822

Original change's description:
> Check result of Sk[I]Rect::intersect
>
> https://skia-review.googlesource.com/c/skia/+/589412 will be adding
> [[nodiscard]] to these functions.
>
> Bug: skia:11782
> Change-Id: I450154cc651e0f0375b5e690e4d815a97960e911
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5798849
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>
> Cr-Commit-Position: refs/heads/main@{#1344282}

Bug: skia:11782
Change-Id: Ia2489477c745cdcb861f44d8ea68b3a683315cac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5803542
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1345665}
This commit is contained in:
Michael Ludwig
2024-08-22 21:34:01 +00:00
committed by Chromium LUCI CQ
parent d109626885
commit 00b0b0d866
3 changed files with 10 additions and 8 deletions
skia/ext
third_party/blink/renderer/modules/canvas/canvas2d

@ -83,8 +83,13 @@ void DrawGainmapImageRect(SkCanvas* canvas,
// Compute `dest_rect_clipped` to be intersected with the pre-image of the
// clip rect of `canvas`.
SkRect dest_rect_clipped = dest_rect;
if (!dest_rect_clipped.intersect(canvas->getLocalClipBounds())) {
return;
const SkMatrix& dest_to_device = canvas->getTotalMatrix();
SkMatrix device_to_dest;
if (dest_to_device.invert(&device_to_dest)) {
SkRect dest_clip_rect;
device_to_dest.mapRect(&dest_clip_rect,
SkRect::Make(canvas->getDeviceClipBounds()));
dest_rect_clipped.intersect(dest_clip_rect);
}
// Compute the input rect for the base and gainmap images.

@ -91,10 +91,7 @@ void Tiling::GetTileRect(
dest_rect_.y() + y * tile_size_.height(),
dest_rect_.x() + (x + 1) * tile_size_.width(),
dest_rect_.y() + (y + 1) * tile_size_.height());
if (!tile_dest_rect.intersect(dest_rect_)) {
tile_dest_rect = SkRect::MakeEmpty();
return;
}
tile_dest_rect.intersect(dest_rect_);
tile_source_rects.resize(source_count_);
tile_source_subset_rects.resize(source_count_);

@ -936,8 +936,8 @@ ALWAYS_INLINE void BaseRenderingContext2D::ResetAlphaIfNeeded(
if (!c->getLocalClipBounds(&alpha_bounds)) {
return;
}
if (bounds && !alpha_bounds.intersect(gfx::RectFToSkRect(*bounds))) {
return;
if (bounds) {
alpha_bounds.intersect(gfx::RectFToSkRect(*bounds));
}
c->drawRect(alpha_bounds, flags);
}