Bug 1370412 - Part 8a. Add "substitutable" flag to ISurfaceProvider state to indicate when the caller won't accept substitutes. r=tnikkel
When SurfaceCache::Lookup is called to access surface data, it indicates that the caller will not accept substitutes as in the case of SurfaceCache::LookupBestMatch. As such, we need to be careful not to remove those surfaces from our cache when pruning (in part 8b). This is the marker used to track that, at some point, there was a caller which got this surface that would accept no other (e.g. factor of 2 mode must make an accept for this particular surface).
This commit is contained in:
@@ -145,6 +145,9 @@ DecoderFactory::CreateDecoder(DecoderType aType,
|
||||
WrapNotNull(new DecodedSurfaceProvider(aImage,
|
||||
surfaceKey,
|
||||
WrapNotNull(decoder)));
|
||||
if (aDecoderFlags & DecoderFlags::CANNOT_SUBSTITUTE) {
|
||||
provider->Availability().SetCannotSubstitute();
|
||||
}
|
||||
|
||||
// Attempt to insert the surface provider into the surface cache right away so
|
||||
// we won't trigger any more decoders with the same parameters.
|
||||
|
||||
Reference in New Issue
Block a user