OpenGL Image Layers need thread safety

RESOLVED FIXED

Status

()

Core
Graphics
RESOLVED FIXED
8 years ago
6 years ago

People

(Reporter: bas, Assigned: bas)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

8 years ago
Created attachment 437443 [details] [diff] [review]
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. 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.
(Assignee)

Comment 3

8 years ago
Created attachment 437456 [details] [diff] [review]
Add locks to OGL image layers v2

Processed roc's comments.
Attachment #437443 - Attachment is obsolete: true
Attachment #437456 - Flags: review?(roc)
Attachment #437443 - Flags: review?(roc)
(Assignee)

Comment 4

8 years ago
Created attachment 437457 [details] [diff] [review]
Add locks to OGL image layers v3

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
Attachment #437457 - Flags: review?(roc) → review+
(Assignee)

Comment 5

6 years ago
http://hg.mozilla.org/mozilla-central/rev/afca4a8ad127
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.