mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 996929 - Make nsLayoutUtils::SurfaceFromElement optimize the returned surface upfront so that it doesn't have to be converted every time it's used. r=jwatt
This commit is contained in:
parent
b6241f2007
commit
d62f8237e0
@ -5404,6 +5404,17 @@ nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement,
|
||||
if (!result.mSourceSurface) {
|
||||
return result;
|
||||
}
|
||||
// The surface we return is likely to be cached. We don't want to have to
|
||||
// convert to a surface that's compatible with aTarget each time it's used
|
||||
// (that would result in terrible performance), so we convert once here
|
||||
// upfront if aTarget is specified.
|
||||
if (aTarget) {
|
||||
RefPtr<SourceSurface> optSurface =
|
||||
aTarget->OptimizeSourceSurface(result.mSourceSurface);
|
||||
if (optSurface) {
|
||||
result.mSourceSurface = optSurface;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.mDrawInfo.mImgContainer = imgContainer;
|
||||
result.mDrawInfo.mWhichFrame = whichFrame;
|
||||
|
Loading…
Reference in New Issue
Block a user