Bug 93252 - Make GraphicsSurface double buffered by default.
Summary: Make GraphicsSurface double buffered by default.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zeno Albisser
URL:
Keywords:
Depends on:
Blocks: 79169
  Show dependency treegraph
 
Reported: 2012-08-06 03:54 PDT by Zeno Albisser
Modified: 2012-08-16 06:24 PDT (History)
12 users (show)

See Also:


Attachments
patch for feedback. (47.49 KB, patch)
2012-08-06 05:52 PDT, Zeno Albisser
noam: review-
Details | Formatted Diff | Diff
patch for review. (46.61 KB, patch)
2012-08-08 04:14 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
patch for review. (46.71 KB, patch)
2012-08-08 05:15 PDT, Zeno Albisser
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
patch for review. (46.66 KB, patch)
2012-08-08 07:23 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zeno Albisser 2012-08-06 03:54:23 PDT
The current GraphicsSurface implementation is mainly used for WebGL.
To achieve a reasonable performance, WebGL requires at least two buffers. Therefore we currently create two GraphicsSurfaces on mac so we can switch between them.
On Linux nevertheless we only create a single GraphicsSurface, because the GraphicsSurfaceGLX is backed by an XWindow which already has a front and a back buffer.

We should unify this behaviour and only create a single GraphicsSurface which always provides two buffers on the writing side.
For mac this would mean that a GraphicsSurface will be backed by two IOSurfaces that will be used alternated.
Comment 1 Zeno Albisser 2012-08-06 05:52:54 PDT
Created attachment 156673 [details]
patch for feedback.
Comment 2 Noam Rosenthal 2012-08-06 06:30:35 PDT
Comment on attachment 156673 [details]
patch for feedback.

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

Make sure this doesn't break WebGL on WebKit1.

> Source/WebCore/ChangeLog:9
> +        two provide a front and a back buffer.

two -> to

> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:267
> -    const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
> -    QSurface* currentSurface = 0;
> -    if (currentContext != m_platformContext) {
> -        currentSurface = currentContext->surface();
> +    if (QOpenGLContext::currentContext() != m_platformContext)
>          m_platformContext->makeCurrent(m_surface);
> -    }
> +
>      blitMultisampleFramebuffer();
> -    if (currentSurface)
> -        const_cast<QOpenGLContext*>(currentContext)->makeCurrent(currentSurface);
> +    m_platformContext->makeCurrent(m_surface);

This will break WebGL on WebKit1.
Comment 3 Zeno Albisser 2012-08-06 07:34:23 PDT
Comment on attachment 156673 [details]
patch for feedback.

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

>> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:267
>> +    m_platformContext->makeCurrent(m_surface);
> 
> This will break WebGL on WebKit1.

Good point! I'll look at this again.

Do you agree with the general direction of the patch?
Comment 4 Noam Rosenthal 2012-08-06 07:36:00 PDT
(In reply to comment #3)
> (From update of attachment 156673 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=156673&action=review
> 
> >> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:267
> >> +    m_platformContext->makeCurrent(m_surface);
> > 
> > This will break WebGL on WebKit1.
> 
> Good point! I'll look at this again.
> 
> Do you agree with the general direction of the patch?

Definitely! Good work.
Comment 5 Zeno Albisser 2012-08-08 04:14:15 PDT
Comment on attachment 156673 [details]
patch for feedback.

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

>>>> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:267
>>>> +    m_platformContext->makeCurrent(m_surface);
>>> 
>>> This will break WebGL on WebKit1.
>> 
>> Good point! I'll look at this again.
>> 
>> Do you agree with the general direction of the patch?
> 
> Definitely! Good work.

I was wrong about this hunk. It is actually wrong and also unnecessary. - I will remove it.
Comment 6 Zeno Albisser 2012-08-08 04:14:57 PDT
Created attachment 157177 [details]
patch for review.
Comment 7 Zeno Albisser 2012-08-08 04:43:23 PDT
Comment on attachment 157177 [details]
patch for review.

Patch needs to be rebased first.
Comment 8 Zeno Albisser 2012-08-08 05:15:30 PDT
Created attachment 157189 [details]
patch for review.
Comment 9 Early Warning System Bot 2012-08-08 06:03:49 PDT
Comment on attachment 157189 [details]
patch for review.

Attachment 157189 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/13454490
Comment 10 Early Warning System Bot 2012-08-08 06:17:02 PDT
Comment on attachment 157189 [details]
patch for review.

Attachment 157189 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/13456479
Comment 11 Zeno Albisser 2012-08-08 07:23:04 PDT
Created attachment 157213 [details]
patch for review.
Comment 12 Kenneth Russell 2012-08-13 11:26:33 PDT
Comment on attachment 157213 [details]
patch for review.

Interesting. This looks good to me for what it's worth, but Noam should review it.
Comment 13 Zeno Albisser 2012-08-16 06:24:44 PDT
Comment on attachment 157213 [details]
patch for review.

Clearing flags on attachment: 157213

Committed r125773: <http://trac.webkit.org/changeset/125773>
Comment 14 Zeno Albisser 2012-08-16 06:24:53 PDT
All reviewed patches have been landed.  Closing bug.