Bug 777700 - Part 2: Verify if a cached SourceSurface is still valid. r=jrmuizel

This commit is contained in:
Bas Schouten 2012-07-28 02:33:08 +02:00
parent 69cb6d9312
commit 58584f2ceb

View File

@ -503,7 +503,13 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
void *userData = aSurface->GetData(&kSourceSurface);
if (userData) {
return static_cast<SourceSurface*>(userData);
SourceSurface *surf = static_cast<SourceSurface*>(userData);
if (surf->IsValid()) {
return surf;
}
// We can just continue here as when setting new user data the destroy
// function will be called for the old user data.
}
SurfaceFormat format;