Closed Bug 1612207 Opened 4 years ago Closed 4 years ago

SourceSurfaceCapture::IsValid does not validate its underlying surface

Categories

(Core :: Graphics, defect, P2)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox73 --- fixed
firefox74 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

Details

Attachments

(1 file)

SourceSurfaceCapture::IsValid does not call IsValid on mResolved/mSurfToOptimize to verify they are still valid. When you use D2D drawing with OMTP, this means that a device reset can invalidate mResolved/mSurfToOptimize, but the parent surface claims it is still valid. This causes us to fail silently inside DrawTargetD2D1::FillRect/etc and images (or any captured D2D surface really) will never paint until the cache is evicted.

SourceSurfaceCapture can contain an underlying surface instead of a set
of drawing commands. The surface has its own valid state, and must be
checked by the parent in SourceSurfaceCapture::IsValid. If we don't,
then we may end up failing silently while drawing, and images will go
missing. The underlying surface can be invalidated by a device reset if
it is a SourceSurfaceD2D1, as an example.

See Also: → 1609672
Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1343555236b2
SourceSurfaceCapture::IsValid should validate any underlying surfaces. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

Comment on attachment 9123559 [details]
Bug 1612207 - SourceSurfaceCapture::IsValid should validate any underlying surfaces.

Beta/Release Uplift Approval Request

  • User impact if declined: Images may go missing if the underlying surface becomes invalid (e.g. device reset on Windows).
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The change is very small. The logic flow change is a very well exercised / tested code path.
  • String changes made/needed:
Attachment #9123559 - Flags: approval-mozilla-beta?

Comment on attachment 9123559 [details]
Bug 1612207 - SourceSurfaceCapture::IsValid should validate any underlying surfaces.

Small fix which may help avoid images going missing in some cases. Approved for 73.0RC1.

Attachment #9123559 - Flags: approval-mozilla-beta? → approval-mozilla-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: