mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 868946 - Make GrallocTextureHostOGL not crash when it doesn't have a GL context. r=bjacob
This commit is contained in:
parent
99dceb7e72
commit
f52aecfad5
@ -200,13 +200,14 @@ public:
|
||||
const gfx::IntSize& aSize) {}
|
||||
|
||||
/**
|
||||
* Lock the texture host for compositing, returns an effect that should
|
||||
* be used to composite this texture.
|
||||
* Lock the texture host for compositing, returns true if the TextureHost is
|
||||
* valid for composition.
|
||||
*/
|
||||
virtual bool Lock() { return true; }
|
||||
virtual bool Lock() { return IsValid(); }
|
||||
|
||||
/**
|
||||
* Unlock the texture host after compositing
|
||||
* Unlock the texture host after compositing.
|
||||
* Should handle the case where Lock failed without crashing.
|
||||
*/
|
||||
virtual void Unlock() {}
|
||||
|
||||
|
@ -780,7 +780,7 @@ void GrallocTextureHostOGL::BindTexture(GLenum aTextureUnit)
|
||||
bool
|
||||
GrallocTextureHostOGL::IsValid() const
|
||||
{
|
||||
return !!mGraphicBuffer.get();
|
||||
return !!mGL && !!mGraphicBuffer.get();
|
||||
}
|
||||
|
||||
GrallocTextureHostOGL::~GrallocTextureHostOGL()
|
||||
@ -798,6 +798,9 @@ GrallocTextureHostOGL::~GrallocTextureHostOGL()
|
||||
bool
|
||||
GrallocTextureHostOGL::Lock()
|
||||
{
|
||||
if (!IsValid()) {
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* The job of this function is to ensure that the texture is tied to the
|
||||
* android::GraphicBuffer, so that texturing will source the GraphicBuffer.
|
||||
|
Loading…
Reference in New Issue
Block a user