Provide a setting for clients to always prefer low-power WebGL
Created attachment 297996 [details] Patch
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 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?
https://trac.webkit.org/changeset/210273
<rdar://problem/29834093>
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.
(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".