Closed Bug 557671 Opened 11 years ago Closed 10 years ago

OpenGL Image Layers need thread safety

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bas.schouten, Assigned: bas.schouten)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch Add locks to OGL image layers (obsolete) — Splinter Review
YCbCr images should be threadsafe, SetData may be called on one thread while they are being drawn on another thread. Additionally SetCurrentImage and GetCurrentImage should lock while adding/releasing their references.

We upload cairo surface image bits from setdata which should always be called on the main thread, so we don't need locking in there for now.
Attachment #437443 - Flags: review?(roc)
(In reply to comment #0)
> Created an attachment (id=437443) [details]
> Add locks to OGL image layers
> 
> YCbCr images should be threadsafe, SetData may be called on one thread while
> they are being drawn on another thread.

This is actually not allowed. SetData must complete before you can call SetCurrentImage with that image.
So, remove the locking on the YCbCr images.

Also, use mozilla::Monitor instead of PR_ stuff.
Attached patch Add locks to OGL image layers v2 (obsolete) — Splinter Review
Processed roc's comments.
Attachment #437443 - Attachment is obsolete: true
Attachment #437456 - Flags: review?(roc)
Attachment #437443 - Flags: review?(roc)
Remove two useless includes.
Attachment #437456 - Attachment is obsolete: true
Attachment #437457 - Flags: review?(roc)
Attachment #437456 - Flags: review?(roc)
Attachment #437457 - Attachment is patch: true
Attachment #437457 - Attachment mime type: application/octet-stream → text/plain
http://hg.mozilla.org/mozilla-central/rev/afca4a8ad127
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.