зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1829026 - Allow WebGLContext::PushRemoteTexture to specify an explicit pid. r=aosmond
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across the IPDL gap inside WebGLContext. This must be explicitly passed in. Differential Revision: https://phabricator.services.mozilla.com/D194348
This commit is contained in:
Родитель
2b9ebd56de
Коммит
cf3beedd47
|
@ -1062,7 +1062,8 @@ void WebGLContext::Present(WebGLFramebuffer* const xrFb,
|
||||||
|
|
||||||
void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
|
void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
|
||||||
const layers::TextureType consumerType,
|
const layers::TextureType consumerType,
|
||||||
const webgl::SwapChainOptions& options) {
|
const webgl::SwapChainOptions& options,
|
||||||
|
base::ProcessId pid) {
|
||||||
const FuncScope funcScope(*this, "<CopyToSwapChain>");
|
const FuncScope funcScope(*this, "<CopyToSwapChain>");
|
||||||
if (IsContextLost()) return;
|
if (IsContextLost()) return;
|
||||||
|
|
||||||
|
@ -1085,7 +1086,7 @@ void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
|
||||||
// read back the WebGL framebuffer into and push it as a remote texture.
|
// read back the WebGL framebuffer into and push it as a remote texture.
|
||||||
if (useAsync && srcFb->mSwapChain.mFactory->GetConsumerType() ==
|
if (useAsync && srcFb->mSwapChain.mFactory->GetConsumerType() ==
|
||||||
layers::TextureType::Unknown) {
|
layers::TextureType::Unknown) {
|
||||||
PushRemoteTexture(srcFb, srcFb->mSwapChain, nullptr, options);
|
PushRemoteTexture(srcFb, srcFb->mSwapChain, nullptr, options, pid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1109,14 +1110,15 @@ void WebGLContext::CopyToSwapChain(WebGLFramebuffer* const srcFb,
|
||||||
|
|
||||||
if (useAsync) {
|
if (useAsync) {
|
||||||
PushRemoteTexture(srcFb, srcFb->mSwapChain, srcFb->mSwapChain.FrontBuffer(),
|
PushRemoteTexture(srcFb, srcFb->mSwapChain, srcFb->mSwapChain.FrontBuffer(),
|
||||||
options);
|
options, pid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebGLContext::PushRemoteTexture(WebGLFramebuffer* fb,
|
bool WebGLContext::PushRemoteTexture(WebGLFramebuffer* fb,
|
||||||
gl::SwapChain& swapChain,
|
gl::SwapChain& swapChain,
|
||||||
std::shared_ptr<gl::SharedSurface> surf,
|
std::shared_ptr<gl::SharedSurface> surf,
|
||||||
const webgl::SwapChainOptions& options) {
|
const webgl::SwapChainOptions& options,
|
||||||
|
base::ProcessId pid) {
|
||||||
const auto onFailure = [&]() -> bool {
|
const auto onFailure = [&]() -> bool {
|
||||||
GenerateWarning("Remote texture creation failed.");
|
GenerateWarning("Remote texture creation failed.");
|
||||||
LoseContext();
|
LoseContext();
|
||||||
|
@ -1130,11 +1132,12 @@ bool WebGLContext::PushRemoteTexture(WebGLFramebuffer* fb,
|
||||||
if (!mRemoteTextureOwner) {
|
if (!mRemoteTextureOwner) {
|
||||||
// Ensure we have a remote texture owner client for WebGLParent.
|
// Ensure we have a remote texture owner client for WebGLParent.
|
||||||
const auto* outOfProcess = mHost ? mHost->mOwnerData.outOfProcess : nullptr;
|
const auto* outOfProcess = mHost ? mHost->mOwnerData.outOfProcess : nullptr;
|
||||||
if (!outOfProcess) {
|
if (outOfProcess) {
|
||||||
|
pid = outOfProcess->OtherPid();
|
||||||
|
} else if (pid == base::kInvalidProcessId) {
|
||||||
return onFailure();
|
return onFailure();
|
||||||
}
|
}
|
||||||
mRemoteTextureOwner =
|
mRemoteTextureOwner = MakeRefPtr<layers::RemoteTextureOwnerClient>(pid);
|
||||||
MakeRefPtr<layers::RemoteTextureOwnerClient>(outOfProcess->OtherPid());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
layers::RemoteTextureOwnerId ownerId = options.remoteTextureOwnerId;
|
layers::RemoteTextureOwnerId ownerId = options.remoteTextureOwnerId;
|
||||||
|
|
|
@ -500,7 +500,8 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
|
||||||
// without need to set the preserveDrawingBuffer option.
|
// without need to set the preserveDrawingBuffer option.
|
||||||
void CopyToSwapChain(
|
void CopyToSwapChain(
|
||||||
WebGLFramebuffer*, layers::TextureType,
|
WebGLFramebuffer*, layers::TextureType,
|
||||||
const webgl::SwapChainOptions& options = webgl::SwapChainOptions());
|
const webgl::SwapChainOptions& options = webgl::SwapChainOptions(),
|
||||||
|
base::ProcessId pid = base::kInvalidProcessId);
|
||||||
// In use cases where a framebuffer is used as an offscreen framebuffer and
|
// In use cases where a framebuffer is used as an offscreen framebuffer and
|
||||||
// does not need to be committed to the swap chain, it may still be useful
|
// does not need to be committed to the swap chain, it may still be useful
|
||||||
// for the implementation to delineate distinct frames, such as when sharing
|
// for the implementation to delineate distinct frames, such as when sharing
|
||||||
|
@ -1261,7 +1262,8 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
|
||||||
|
|
||||||
bool PushRemoteTexture(WebGLFramebuffer*, gl::SwapChain&,
|
bool PushRemoteTexture(WebGLFramebuffer*, gl::SwapChain&,
|
||||||
std::shared_ptr<gl::SharedSurface>,
|
std::shared_ptr<gl::SharedSurface>,
|
||||||
const webgl::SwapChainOptions& options);
|
const webgl::SwapChainOptions& options,
|
||||||
|
base::ProcessId pid = base::kInvalidProcessId);
|
||||||
|
|
||||||
// --
|
// --
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче