Bug 1774780 - Avoid pushing group for DrawTargetWebgl::ClearRect. r=gfx-reviewers,jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D149690
This commit is contained in:
Lee Salzman 2022-06-19 14:21:28 +00:00
Родитель b39b1b78df
Коммит 8b7dde87a2
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -969,9 +969,13 @@ bool DrawTargetWebgl::SharedContext::CreateShaders() {
}
void DrawTargetWebgl::ClearRect(const Rect& aRect) {
// OP_SOURCE may not be bounded by a mask, so we ensure that a clip is pushed
// here to avoid a group being pushed for it.
PushClipRect(aRect);
ColorPattern pattern(
DeviceColor(0.0f, 0.0f, 0.0f, IsOpaque(mFormat) ? 1.0f : 0.0f));
DrawRect(aRect, pattern, DrawOptions(1.0f, CompositionOp::OP_SOURCE));
PopClip();
}
// Attempts to create the framebuffer used for drawing and also any relevant