Bug 874721; Re-fix WebGL. r=mattwoodrow

This commit is contained in:
Nicholas Cameron 2013-08-01 16:53:04 +12:00
parent 1568126fd7
commit 3595dbcb83
2 changed files with 3 additions and 10 deletions

View File

@ -73,11 +73,9 @@ gfxCachedTempSurface::Get(gfxASurface::gfxContentType aContentType,
if (mSurface) {
/* Verify the current buffer is valid for this purpose */
if (mSize.width < aRect.width || mSize.height < aRect.height
|| mSurface->GetContentType() != aContentType) {
|| mSurface->GetContentType() != aContentType
|| mType != aSimilarTo->GetType()) {
mSurface = nullptr;
} else {
NS_ASSERTION(mType == aSimilarTo->GetType(),
"Unexpected surface type change");
}
}
@ -89,9 +87,7 @@ gfxCachedTempSurface::Get(gfxASurface::gfxContentType aContentType,
return nullptr;
cleared = true;
#ifdef DEBUG
mType = aSimilarTo->GetType();
#endif
}
mSurface->SetDeviceOffset(-aRect.TopLeft());

View File

@ -33,10 +33,9 @@ public:
* When |aContentType| differs in different invocations this is handled
* appropriately, creating a new surface if necessary.
*
* |aSimilarTo| should be of the same gfxSurfaceType in each invocation.
* Because the cached surface may have been created during a previous
* invocation, this will not be efficient if the new |aSimilarTo| has a
* different format.
* different format, size, or gfxSurfaceType.
*/
already_AddRefed<gfxContext> Get(gfxASurface::gfxContentType aContentType,
const gfxRect& aRect,
@ -52,9 +51,7 @@ private:
nsRefPtr<gfxASurface> mSurface;
gfxIntSize mSize;
nsExpirationState mExpirationState;
#ifdef DEBUG
gfxASurface::gfxSurfaceType mType;
#endif
};
#endif /* GFX_CACHED_TEMP_SURFACE_H */