mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1232231 - BorrowDrawTarget can return nullptr - be ready for it. r=nical
This commit is contained in:
parent
1cb4a86fa6
commit
ae119212a2
@ -40,7 +40,12 @@ TextureWrapperImage::GetAsSourceSurface()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return mTextureClient->BorrowDrawTarget()->Snapshot();
|
||||
RefPtr<DrawTarget> dt = mTextureClient->BorrowDrawTarget();
|
||||
if (!dt) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return dt->Snapshot();
|
||||
}
|
||||
|
||||
TextureClient*
|
||||
|
@ -372,8 +372,14 @@ public:
|
||||
*/
|
||||
already_AddRefed<gfx::DataSourceSurface> GetAsSurface() {
|
||||
Lock(OpenMode::OPEN_READ);
|
||||
RefPtr<gfx::SourceSurface> surf = BorrowDrawTarget()->Snapshot();
|
||||
RefPtr<gfx::DataSourceSurface> data = surf->GetDataSurface();
|
||||
RefPtr<gfx::DataSourceSurface> data;
|
||||
RefPtr<gfx::DrawTarget> dt = BorrowDrawTarget();
|
||||
if (dt) {
|
||||
RefPtr<gfx::SourceSurface> surf = dt->Snapshot();
|
||||
if (surf) {
|
||||
data = surf->GetDataSurface();
|
||||
}
|
||||
}
|
||||
Unlock();
|
||||
return data.forget();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user