Closed Bug 1218881 Opened 9 years ago Closed 8 years ago

Enforce queries' new availability semantics

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file, 1 obsolete file)

Queries are not supposed become available until the browser has spun the event loop. Chrome implemented this here:
https://codereview.chromium.org/1408803003
Whiteboard: [gfx-noted]
Blocks: 1218938
Jeff, do you have any implementation suggestions for this?
Flags: needinfo?(jgilbert)
(In reply to Jeff Muizelaar [:jrmuizel] from comment #1)
> Jeff, do you have any implementation suggestions for this?

We should be very wary about this. I suspect we may see porting issues with this restriction. It should be given a pref to bypass it, and we should be ready to remove it.

Implementation of this is very low priority.
Flags: needinfo?(jgilbert)
This makes WebGLQuery into an nsIRunnable. We dispatch it to the event loop so
that we can make sure queries don't become available before they are supposed to. It also adds a pref to control this behavior.
Assignee: nobody → jmuizelaar
Attachment #8699516 - Flags: review?(jgilbert)
Attachment #8699516 - Attachment is obsolete: true
Attachment #8699516 - Flags: review?(jgilbert)
Attachment #8699688 - Flags: review?(jgilbert)
Comment on attachment 8699688 [details] [diff] [review]
Enforce queries' new availability semantics v2

Review of attachment 8699688 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/canvas/WebGLQuery.h
@@ +24,5 @@
>      explicit WebGLQuery(WebGLContext* webgl);
>  
> +    class AvailableRunnable final : public nsRunnable
> +    {
> +        public:

public: (and private:) should be on the same indent as {

@@ +26,5 @@
> +    class AvailableRunnable final : public nsRunnable
> +    {
> +        public:
> +        AvailableRunnable(WebGLQuery* query) : mQuery(query) { }
> +        NS_IMETHOD Run() override {

Please leave a newline between one-line function defs and multi-line definitions.

@@ +31,5 @@
> +            mQuery->mCanBeAvailable = true;
> +            return NS_OK;
> +        }
> +        private:
> +        RefPtr<WebGLQuery> mQuery;

const RefPtr, and can be public. (doesn't matter though)
Attachment #8699688 - Flags: review?(jgilbert) → review+
https://hg.mozilla.org/mozilla-central/rev/9c29c0efe691
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Flags: needinfo?(jmuizelaar)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: