Bug 1661328 - Enable Mac webgl-ipc tests on Central. r=jmaher,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D89038
This commit is contained in:
Jeff Gilbert 2020-09-01 23:29:01 +00:00
parent 5a983817b7
commit 79587135ae
6 changed files with 24 additions and 10 deletions

View File

@ -6226,8 +6226,9 @@ void ImplCycleCollectionTraverse(
void ImplCycleCollectionUnlink(std::shared_ptr<webgl::NotLostData>& field) {
if (!field) return;
field->extensions = {};
field->state = {};
const auto keepAlive = field;
keepAlive->extensions = {};
keepAlive->state = {};
field = nullptr;
}

View File

@ -69,6 +69,7 @@ struct LockedOutstandingContexts final {
class HostWebGLContext final : public SupportsWeakPtr {
friend class WebGLContext;
friend class WebGLMemoryTracker;
friend class dom::WebGLParent;
using ObjectId = webgl::ObjectId;

View File

@ -33,8 +33,10 @@ Maybe<Range<uint8_t>> WebGLChild::AllocPendingCmdBytes(const size_t size) {
auto shmem = webgl::RaiiShmem::Alloc(
this, capacity,
mozilla::ipc::SharedMemory::SharedMemoryType::TYPE_BASIC);
MOZ_ASSERT(shmem);
if (!shmem) return {};
if (!shmem) {
NS_WARNING("Failed to alloc shmem for AllocPendingCmdBytes.");
return {};
}
mPendingCmdsShmem = std::move(shmem);
mPendingCmdsPos = 0;
}

View File

@ -50,6 +50,9 @@ IPCResult WebGLParent::RecvDispatchCommands(Shmem&& rawShmem,
const uint64_t cmdsByteSize) {
auto shmem = webgl::RaiiShmem(this, std::move(rawShmem));
const auto& gl = mHost->mContext->GL();
const gl::GLContext::TlsScope tlsIsCurrent(gl);
MOZ_ASSERT(cmdsByteSize);
const auto shmemBytes = shmem.ByteRange();
const auto byteSize = std::min<uint64_t>(shmemBytes.length(), cmdsByteSize);
@ -88,8 +91,8 @@ IPCResult WebGLParent::RecvGetFrontBufferSnapshot(
auto shmem = webgl::RaiiShmem::Alloc(
this, byteSize, mozilla::ipc::SharedMemory::SharedMemoryType::TYPE_BASIC);
MOZ_ASSERT(shmem);
if (!shmem) {
NS_WARNING("Failed to alloc shmem for RecvGetFrontBufferSnapshot.");
return IPC_FAIL(this, "Failed to allocate shmem for result");
}
@ -110,8 +113,8 @@ IPCResult WebGLParent::RecvGetBufferSubData(const GLenum target,
auto shmem = webgl::RaiiShmem::Alloc(
this, allocSize,
mozilla::ipc::SharedMemory::SharedMemoryType::TYPE_BASIC);
MOZ_ASSERT(shmem);
if (!shmem) {
NS_WARNING("Failed to alloc shmem for RecvGetBufferSubData.");
return IPC_FAIL(this, "Failed to allocate shmem for result");
}
@ -136,8 +139,8 @@ IPCResult WebGLParent::RecvReadPixels(const webgl::ReadPixelsDesc& desc,
auto shmem = webgl::RaiiShmem::Alloc(
this, allocSize,
mozilla::ipc::SharedMemory::SharedMemoryType::TYPE_BASIC);
MOZ_ASSERT(shmem);
if (!shmem) {
NS_WARNING("Failed to alloc shmem for RecvReadPixels.");
return IPC_FAIL(this, "Failed to allocate shmem for result");
}

View File

@ -205,8 +205,10 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
public:
explicit TlsScope(GLContext* const gl)
: mGL(gl), mWasTlsOk(gl->mUseTLSIsCurrent) {
mGL->mUseTLSIsCurrent = true;
: mGL(gl), mWasTlsOk(gl && gl->mUseTLSIsCurrent) {
if (mGL) {
mGL->mUseTLSIsCurrent = true;
}
}
~TlsScope() {

View File

@ -261,7 +261,12 @@ TEST_VARIANTS = {
'description': "{description} with WebGL IPC process enabled",
'suffix': 'gli',
'replace': {
'run-on-projects': [],
'run-on-projects': {
'by-test-platform': {
'mac.*': ['trunk'],
'default': [],
}
}
},
'merge': {
'mozharness': {