Closed Bug 1762523 Opened 2 years ago Closed 2 years ago

Add performance profiling to DrawTargetWebgl

Categories

(Core :: Graphics: Canvas2D, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

Details

Attachments

(1 file)

The goal for DrawTargetWebgl is to not unreasonably slow down Canvas2D use-cases compared against an unaccelerated software backend. We need some form of performance profiling within DrawTargetWebgl to determine when we're possibly running slow, and then to just shut it off if so.

This adds OnEvent hooks to DrawTargetWebgl for various events so that
profile counters may be maintained each frame. These profile counters
try to determine if a software fallback happened or an uncacheable event
occurs that requires either uploading data to the GPU or reading back
from the GPU, events which can cause substantial slowdown if they happen
repeatedly even without an explicit fallback to software rasterization.

When it is determined a threshold has been reached (as controlled by
some prefs), RequiresRefresh() in PersistentBufferProvider is used to
signal that we should recreate the PersistentBufferProvider of a different
type and thus disable acceleration.

Depends on D142026

Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0d3fc29ef996
Add performance profiling to DrawTargetWebgl. r=aosmond,gfx-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: