Bug 166675 - Provide a setting for clients to always prefer low-power WebGL
Summary: Provide a setting for clients to always prefer low-power WebGL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-01-04 00:09 PST by Tim Horton
Modified: 2017-01-04 11:02 PST (History)
12 users (show)

See Also:


Attachments
Patch (8.92 KB, patch)
2017-01-04 00:10 PST, Tim Horton
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2017-01-04 00:09:57 PST
Provide a setting for clients to always prefer low-power WebGL
Comment 1 Tim Horton 2017-01-04 00:10:22 PST
Created attachment 297996 [details]
Patch
Comment 2 mitz 2017-01-04 00:39:56 PST
Comment on attachment 297996 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=297996&action=review

> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:403
> +    if (frame->settings().preferLowPowerWebGLRendering())
> +        attributes.preferLowPowerToHighPerformance = true;

Should this check the current value of preferLowPowerToHighPerformance before consulting Settings, like we do with the antialias attribute above?
Comment 3 Tim Horton 2017-01-04 00:43:46 PST
Comment on attachment 297996 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=297996&action=review

>> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:403
>> +        attributes.preferLowPowerToHighPerformance = true;
> 
> Should this check the current value of preferLowPowerToHighPerformance before consulting Settings, like we do with the antialias attribute above?

I guess it could? Just to save the cost of asking Settings?
Comment 4 Tim Horton 2017-01-04 00:56:46 PST
https://trac.webkit.org/changeset/210273
Comment 5 Tim Horton 2017-01-04 00:57:06 PST
<rdar://problem/29834093>
Comment 6 Myles C. Maxfield 2017-01-04 10:46:39 PST
Comment on attachment 297996 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=297996&action=review

>>> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:403
>>> +        attributes.preferLowPowerToHighPerformance = true;
>> 
>> Should this check the current value of preferLowPowerToHighPerformance before consulting Settings, like we do with the antialias attribute above?
> 
> I guess it could? Just to save the cost of asking Settings?

Why do you call the internal setting "prefer?" The implementation seems a lot like "force" or "supports" to me.
Comment 7 Tim Horton 2017-01-04 11:02:38 PST
(In reply to comment #6)
> Comment on attachment 297996 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=297996&action=review
> 
> >>> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:403
> >>> +        attributes.preferLowPowerToHighPerformance = true;
> >> 
> >> Should this check the current value of preferLowPowerToHighPerformance before consulting Settings, like we do with the antialias attribute above?
> > 
> > I guess it could? Just to save the cost of asking Settings?
> 
> Why do you call the internal setting "prefer?" The implementation seems a
> lot like "force" or "supports" to me.

Because the whole thing is a "prefer" (if the discrete card is up, we'll still use that). It might be "force prefer", but it's definitely not just "force-use low power".