mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
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:
parent
5a983817b7
commit
79587135ae
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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': {
|
||||
|
Loading…
Reference in New Issue
Block a user