Bug 173762 - [ThreadedCompositor] Update and retrieve scene attributes under a Lock
Summary: [ThreadedCompositor] Update and retrieve scene attributes under a Lock
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: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 03:14 PDT by Zan Dobersek
Modified: 2017-07-03 02:56 PDT (History)
2 users (show)

See Also:


Attachments
Patch (8.49 KB, patch)
2017-06-23 03:37 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2017-06-23 03:14:47 PDT
[ThreadedCompositor] Update and retrieve scene attributes under a Lock
Comment 1 Zan Dobersek 2017-06-23 03:37:01 PDT
Created attachment 313704 [details]
Patch
Comment 2 Carlos Garcia Campos 2017-06-23 05:06:45 PDT
Comment on attachment 313704 [details]
Patch

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

> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:208
> +    WebCore::IntSize viewportSize;
> +    WebCore::IntPoint scrollPosition;

We don't need the WebCore::

> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:221
> +    float scaleFactor;
> +    bool drawsBackground;
> +    bool needsResize;
> +    {
> +        LockHolder locker(m_attributes.lock);
> +        viewportSize = m_attributes.viewportSize;
> +        scrollPosition = m_attributes.scrollPosition;
> +        scaleFactor = m_attributes.scaleFactor;
> +        drawsBackground = m_attributes.drawsBackground;
> +        needsResize = m_attributes.needsResize;
> +
> +        // Reset the needsResize attribute to false.
> +        m_attributes.needsResize = false;

Could we simply all this using WTFMove()? Maybe leaving the lock out of the struct and overriding the move in the struct to ensure a reset state after the move.
Comment 3 Zan Dobersek 2017-06-26 02:32:16 PDT
Comment on attachment 313704 [details]
Patch

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

>> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:221
>> +        m_attributes.needsResize = false;
> 
> Could we simply all this using WTFMove()? Maybe leaving the lock out of the struct and overriding the move in the struct to ensure a reset state after the move.

The data has to be copied. But it could be simplified by gathering all the values in an additional struct. I'll do that in a separate patch.
Comment 4 Zan Dobersek 2017-07-03 02:56:47 PDT
Comment on attachment 313704 [details]
Patch

Clearing flags on attachment: 313704

Committed r219067: <http://trac.webkit.org/changeset/219067>
Comment 5 Zan Dobersek 2017-07-03 02:56:52 PDT
All reviewed patches have been landed.  Closing bug.