Bug 40085 - Enable WebGL on more platforms even if accelerated compositing is disabled
Summary: Enable WebGL on more platforms even if accelerated compositing is disabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
Depends on: 39917
Blocks: 40091
  Show dependency treegraph
 
Reported: 2010-06-02 15:50 PDT by Kenneth Russell
Modified: 2010-06-02 17:16 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.80 KB, patch)
2010-06-02 16:04 PDT, Kenneth Russell
fishd: review+
kbr: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2010-06-02 15:50:52 PDT
Some ports of WebKit may want to enable WebGL even if accelerated compositing is not enabled. The code in HTMLCanvasElement which gates the creation of the WebGL context based on the enabling of accelerated compositing should be made conditional.

The recent change to support the accelerated compositing flag in Chromium broke that port. The safest change is to ignore the accelerated compositing flag only on Chromium; other ports may opt in to this logic if they choose.
Comment 1 Kenneth Russell 2010-06-02 16:04:46 PDT
Created attachment 57710 [details]
Patch

From the ChangeLog:

Conditionalize the code which prevents a WebGL rendering context from being created if accelerated compositing is disabled. Currently Chromium is the only port which will create a context if accelerated compositing is disabled; other ports may opt in to this code path if desired.
Comment 2 Darin Fisher (:fishd, Google) 2010-06-02 16:08:39 PDT
Comment on attachment 57710 [details]
Patch

WebCore/html/HTMLCanvasElement.cpp:160
 +  #if !PLATFORM(CHROMIUM)
perhaps a more specific ENABLE(3D_CANVAS_REQUIRES_ACCELERATED_COMPOSITING) ?
Comment 3 Kenneth Russell 2010-06-02 16:21:35 PDT
(In reply to comment #2)
> (From update of attachment 57710 [details])
> WebCore/html/HTMLCanvasElement.cpp:160
>  +  #if !PLATFORM(CHROMIUM)
> perhaps a more specific ENABLE(3D_CANVAS_REQUIRES_ACCELERATED_COMPOSITING) ?

I would rather fix this with a small change now than plumb a new enable flag through the build system. WebGL is currently broken in Chromium and I want to fix that ASAP.
Comment 4 Darin Fisher (:fishd, Google) 2010-06-02 16:38:50 PDT
Comment on attachment 57710 [details]
Patch

OK, r=me since this fixes the bots, but we should avoid littering cross
platform code with PLATFORM(CHROMIUM).  What is the plan for eliminating
this?
Comment 5 Kenneth Russell 2010-06-02 16:46:37 PDT
(In reply to comment #4)
> (From update of attachment 57710 [details])
> OK, r=me since this fixes the bots, but we should avoid littering cross
> platform code with PLATFORM(CHROMIUM).  What is the plan for eliminating
> this?

We can add a new enable flag. I know the test of the flag was originally added specifically for the Mac (Safari) port, but it seems that other ports like Qt are happy with the test of the accelerated compositing flag. When adding the new enable flag we'll need to be careful not to accidentally enable WebGL for ports which didn't expect it in certain situations.
Comment 6 Kenneth Russell 2010-06-02 16:57:28 PDT
Committed r60582: <http://trac.webkit.org/changeset/60582>