зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1366941 - Checking LayersIPCChannel type when using recycled textureClient; r=nical
MozReview-Commit-ID: 94PQA67fvoJ --HG-- extra : rebase_source : 58b07b7c5d1f7c5bac729d18842655b3c620eba4
This commit is contained in:
Родитель
1af1ee19d6
Коммит
5a72ace401
|
@ -2352,7 +2352,7 @@ WebGLContext::GetVRFrame()
|
|||
|
||||
if (sharedSurface && sharedSurface->GetAllocator() != vrmc) {
|
||||
RefPtr<SharedSurfaceTextureClient> dest =
|
||||
screen->Factory()->NewTexClient(sharedSurface->GetSize());
|
||||
screen->Factory()->NewTexClient(sharedSurface->GetSize(), vrmc);
|
||||
if (!dest) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "mozilla/layers/TextureClientSharedSurface.h"
|
||||
#include "mozilla/layers/TextureForwarder.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "VRManagerChild.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
@ -317,16 +318,23 @@ SurfaceFactory::~SurfaceFactory()
|
|||
}
|
||||
|
||||
already_AddRefed<layers::SharedSurfaceTextureClient>
|
||||
SurfaceFactory::NewTexClient(const gfx::IntSize& size)
|
||||
SurfaceFactory::NewTexClient(const gfx::IntSize& size, const layers::LayersIPCChannel* aLayersChannel)
|
||||
{
|
||||
while (!mRecycleFreePool.empty()) {
|
||||
RefPtr<layers::SharedSurfaceTextureClient> cur = mRecycleFreePool.front();
|
||||
mRecycleFreePool.pop();
|
||||
|
||||
if (cur->Surf()->mSize == size){
|
||||
// In the general case, textureClients transit textures through
|
||||
// CompositorForwarder. But, the textureClient created by VRManagerChild
|
||||
// has a different LayerIPCChannel, PVRManager. Therefore, textureClients
|
||||
// need to be separated into different cases.
|
||||
if ((aLayersChannel && aLayersChannel == cur->GetAllocator()) ||
|
||||
(cur->GetAllocator() != gfx::VRManagerChild::Get())) {
|
||||
cur->Surf()->WaitForBufferOwnership();
|
||||
return cur.forget();
|
||||
}
|
||||
}
|
||||
|
||||
StopRecycling(cur);
|
||||
}
|
||||
|
|
|
@ -306,7 +306,8 @@ protected:
|
|||
public:
|
||||
UniquePtr<SharedSurface> NewSharedSurface(const gfx::IntSize& size);
|
||||
//already_AddRefed<ShSurfHandle> NewShSurfHandle(const gfx::IntSize& size);
|
||||
already_AddRefed<layers::SharedSurfaceTextureClient> NewTexClient(const gfx::IntSize& size);
|
||||
already_AddRefed<layers::SharedSurfaceTextureClient> NewTexClient(const gfx::IntSize& size,
|
||||
const layers::LayersIPCChannel* aLayersChannel = nullptr);
|
||||
|
||||
static void RecycleCallback(layers::TextureClient* tc, void* /*closure*/);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче