Skip to content
Snippets Groups Projects
Commit 2557ef36 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1852420 - Ensure surface and crop rect used in ImageBitmap are valid....

Bug 1852420 - Ensure surface and crop rect used in ImageBitmap are valid. r=gfx-reviewers,lsalzman, a=dmeehan

When ImageBitmap::PrepareForDrawTarget is called, we must ensure
that the surface returned is acceptable to the given DrawTarget. If
it is not, then we need to recreate the surface from mData. We must
also ensure similar when we are creating a new ImageBitmap from
another ImageBitmap, as we don't know in what context it may be
used.

Similarly, we need to ensure we produce DataSourceSurface compatible
surfaces when we need to both crop and premultiply.

Additionally, we now no longer clear mPictureRect or mAlphaType
when we set mSurface with the cached, cropped data. Since we may
need to clear the cached surface, we need to know the original crop
rect and alpha.

Differential Revision: https://phabricator.services.mozilla.com/D188056
parent 1b386c49
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment