Commit f5b80347 authored by Steve Fink's avatar Steve Fink
Browse files

Bug 1684122 - Demarcate region where GC would break stuff. r=jgilbert, a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D100427
parent 29a1c2e7
...@@ -3934,6 +3934,10 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget, ...@@ -3934,6 +3934,10 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
// - // -
// Demarcate the region within which GC is disallowed. Typed arrays can move
// their data during a GC, so this will allow the rooting hazard analysis to
// report if a GC is possible while any data pointers extracted from the
// typed array are still live.
dom::Uint8ClampedArray scopedArr; dom::Uint8ClampedArray scopedArr;
// - // -
...@@ -4007,7 +4011,10 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget, ...@@ -4007,7 +4011,10 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
return Some(webgl::TexUnpackBlobDesc{ return Some(webgl::TexUnpackBlobDesc{
imageTarget, explicitSize, gfxAlphaType::NonPremult, {}, {}}); imageTarget, explicitSize, gfxAlphaType::NonPremult, {}, {}});
}(); }();
if (!desc) return; if (!desc) {
scopedArr.Reset();
return;
}
// - // -
// Further, for uploads from TexImageSource, implied UNPACK_ROW_LENGTH and // Further, for uploads from TexImageSource, implied UNPACK_ROW_LENGTH and
...@@ -4041,6 +4048,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget, ...@@ -4041,6 +4048,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
EnqueueError(LOCAL_GL_INVALID_OPERATION, EnqueueError(LOCAL_GL_INVALID_OPERATION,
"Non-DOM-Element uploads with alpha-premult" "Non-DOM-Element uploads with alpha-premult"
" or y-flip do not support subrect selection."); " or y-flip do not support subrect selection.");
scopedArr.Reset(); // (For the hazard analysis) Done with the data.
return; return;
} }
} }
...@@ -4052,6 +4060,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget, ...@@ -4052,6 +4060,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
desc->Shrink(pi); desc->Shrink(pi);
Run<RPROC(TexImage)>(static_cast<uint32_t>(level), respecFormat, Run<RPROC(TexImage)>(static_cast<uint32_t>(level), respecFormat,
CastUvec3(offset), pi, std::move(*desc)); CastUvec3(offset), pi, std::move(*desc));
scopedArr.Reset(); // (For the hazard analysis) Done with the data.
} }
void ClientWebGLContext::CompressedTexImage(bool sub, uint8_t funcDims, void ClientWebGLContext::CompressedTexImage(bool sub, uint8_t funcDims,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment