mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1366941 - Checking LayersIPCChannel type when using recycled textureClient; r=nical
MozReview-Commit-ID: AJUJIC2tkHC --HG-- extra : rebase_source : 259b8c9f63313dcb5c2291bacb4bcfdc04e757b1
This commit is contained in:
parent
dbea6f45b8
commit
e10b834325
@ -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*/);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user