Skip to content

Commit

Permalink
Dictation glow can be rendered exceeding graphics context bounds
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258960
<radar://111867549>

Reviewed by Kimmo Kinnunen.

We should never set the clip rectangle to something larger than the
initial graphics context bounds, since we won't render to an area
larger than that and the contents will be left stale.

Correct this by clipping to the initial clip rectangle whenever the clip
rectangle is reset.

* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::resetClip):
We were already setting the clip bounds to this value a few lines above.

* Tools/TestWebKitAPI/Tests/WebCore/DisplayListRecorderTests.cpp:
Update test expectation.

Canonical link: https://commits.webkit.org/265851@main
  • Loading branch information
mwyrzykowski committed Jul 7, 2023
1 parent 4ad2a4a commit c9f844d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ void Recorder::resetClip()
currentState().clipBounds = m_initialClip;

recordResetClip();
clip(m_initialClip);
}

void Recorder::clip(const FloatRect& rect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ struct ResetClipRect {
static String description()
{
return R"DL(
(reset-clip))DL"_s;
(reset-clip)
(clip
(rect at (0,0) size 77x88)))DL"_s;
}
};

Expand Down

0 comments on commit c9f844d

Please sign in to comment.