зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1743972 - Reduce Runnable usage in RenderThread::AddRenderTextureOp() r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D132666
This commit is contained in:
Родитель
e589a4b731
Коммит
a1fc801ef7
|
@ -737,8 +737,17 @@ void RenderThread::AddRenderTextureOp(
|
|||
|
||||
RefPtr<RenderTextureHost> texture = it->second;
|
||||
mRenderTextureOps.emplace_back(aOp, std::move(texture));
|
||||
PostRunnable(NewRunnableMethod("RenderThread::HandleRenderTextureOps", this,
|
||||
&RenderThread::HandleRenderTextureOps));
|
||||
|
||||
if (mRenderTextureOpsRunnable) {
|
||||
// Runnable was already triggered
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<nsIRunnable> runnable =
|
||||
NewRunnableMethod("RenderThread::HandleRenderTextureOps", this,
|
||||
&RenderThread::HandleRenderTextureOps);
|
||||
mRenderTextureOpsRunnable = runnable;
|
||||
PostRunnable(runnable.forget());
|
||||
}
|
||||
|
||||
void RenderThread::HandleRenderTextureOps() {
|
||||
|
@ -749,6 +758,7 @@ void RenderThread::HandleRenderTextureOps() {
|
|||
{
|
||||
MutexAutoLock lock(mRenderTextureMapLock);
|
||||
mRenderTextureOps.swap(renderTextureOps);
|
||||
mRenderTextureOpsRunnable = nullptr;
|
||||
}
|
||||
|
||||
for (auto& it : renderTextureOps) {
|
||||
|
|
|
@ -375,6 +375,9 @@ class RenderThread final {
|
|||
// callback. On device reset we have to remove all GL related resources right
|
||||
// away.
|
||||
std::list<RefPtr<RenderTextureHost>> mRenderTexturesDeferred;
|
||||
|
||||
RefPtr<nsIRunnable> mRenderTextureOpsRunnable;
|
||||
|
||||
bool mHasShutdown;
|
||||
|
||||
bool mHandlingDeviceReset;
|
||||
|
|
Загрузка…
Ссылка в новой задаче