Bug 1478754 - WebGL crash when webgl.enable-surface-texture is enabled on Android; r=jgilbert,rbarker
MozReview-Commit-ID: GBTvZiLspvP
This commit is contained in:
@@ -132,6 +132,10 @@ public:
|
||||
// even when its buffer is still being used.
|
||||
virtual void WaitForBufferOwnership() {}
|
||||
|
||||
// Returns true if the buffer is available.
|
||||
// You can call WaitForBufferOwnership to wait for availability.
|
||||
virtual bool IsBufferAvailable() const { return true; }
|
||||
|
||||
// For use when AttachType is correct.
|
||||
virtual GLenum ProdTextureTarget() const {
|
||||
MOZ_ASSERT(mAttachType == AttachmentType::GLTexture);
|
||||
|
||||
@@ -272,6 +272,11 @@ SharedSurface_SurfaceTexture::WaitForBufferOwnership()
|
||||
mSurface->SetAvailable(true);
|
||||
}
|
||||
|
||||
bool
|
||||
SharedSurface_SurfaceTexture::IsBufferAvailable() const {
|
||||
return mSurface->GetAvailable();
|
||||
}
|
||||
|
||||
bool
|
||||
SharedSurface_SurfaceTexture::ToSurfaceDescriptor(layers::SurfaceDescriptor* const out_descriptor)
|
||||
{
|
||||
|
||||
@@ -174,6 +174,8 @@ public:
|
||||
virtual void Commit() override;
|
||||
|
||||
virtual void WaitForBufferOwnership() override;
|
||||
|
||||
virtual bool IsBufferAvailable() const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -429,6 +429,11 @@ CanvasClientSharedSurface::UpdateRenderer(gfx::IntSize aSize, Renderer& aRendere
|
||||
|
||||
SharedSurface* surf = mShSurfClient->Surf();
|
||||
|
||||
if (!surf->IsBufferAvailable()) {
|
||||
NS_WARNING("SharedSurface buffer not available, skip update");
|
||||
return;
|
||||
}
|
||||
|
||||
// Readback if needed.
|
||||
mReadbackClient = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user