зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1850727 - Ignore the clip mask when drawing a stroke mask. r=aosmond
The clip mask state was leaking into the drawing of the stroke mask texture. This caused the stroke mask to be erroneously clipped out. Differential Revision: https://phabricator.services.mozilla.com/D187254
This commit is contained in:
Родитель
1b73f006e1
Коммит
0a0c10bccc
|
@ -3118,6 +3118,10 @@ already_AddRefed<TextureHandle> DrawTargetWebgl::SharedContext::DrawStrokeMask(
|
|||
mWebgl->UniformData(LOCAL_GL_FLOAT_VEC2, mSolidProgramTransform, false,
|
||||
{(const uint8_t*)xformData, sizeof(xformData)});
|
||||
|
||||
// Ensure the current clip mask is ignored.
|
||||
RefPtr<WebGLTextureJS> prevClipMask = mLastClipMask;
|
||||
SetNoClipMask();
|
||||
|
||||
// Draw the mask using the supplied path vertex range.
|
||||
mWebgl->DrawArrays(LOCAL_GL_TRIANGLES, GLint(aVertexRange.mOffset),
|
||||
GLsizei(aVertexRange.mLength));
|
||||
|
@ -3128,6 +3132,7 @@ already_AddRefed<TextureHandle> DrawTargetWebgl::SharedContext::DrawStrokeMask(
|
|||
mDirtyViewport = true;
|
||||
mDirtyAA = true;
|
||||
mDirtyClip = true;
|
||||
SetClipMask(prevClipMask);
|
||||
|
||||
return handle.forget();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<canvas id="c" width="200" height="200"></canvas>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<canvas id="c" width="200" height="200"></canvas>
|
||||
|
||||
<script>
|
||||
const c = document.getElementById("c");
|
||||
const ctx = c.getContext("2d");
|
||||
|
||||
ctx.translate(20, 20);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 15, 0, 2 * Math.PI);
|
||||
ctx.clip();
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 10, 0, 2 * Math.PI);
|
||||
ctx.lineWidth = 2;
|
||||
ctx.globalAlpha = 0.5;
|
||||
ctx.strokeStyle = '#00ff00';
|
||||
ctx.stroke();
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -123,3 +123,5 @@ fuzzy-if(winWidget,0-94,0-1575) fuzzy-if(cocoaWidget,0-1,0-34) == 1304353-text-g
|
|||
!= 1846079-1.html 1846079-1-ref.html
|
||||
|
||||
== 1850284-1.html 1850284-1-ref.html
|
||||
|
||||
!= 1850727-1.html 1850727-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче