Bug 75910

Summary: [Qt][Texmap] LayoutTests/compositing/masks/masked-ancestor does not render correctly.
Product: WebKit Reporter: Noam Rosenthal <noam>
Component: Layout and RenderingAssignee: Noam Rosenthal <noam>
Status: RESOLVED FIXED    
Severity: Normal CC: hausmann, kenneth, mrobinson, webkit.review.bot
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 75918    
Attachments:
Description Flags
Patch
hausmann: review+, hausmann: commit-queue-
Patch none

Description Noam Rosenthal 2012-01-09 16:39:48 PST
Masks do not render correctly with intermediate surfaces.
Comment 1 Noam Rosenthal 2012-01-09 16:42:04 PST
Created attachment 121759 [details]
Patch
Comment 2 Simon Hausmann 2012-01-11 06:25:28 PST
Comment on attachment 121759 [details]
Patch

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

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:278
> +    int tiles = 0;
> +
> +#if USE(TILED_BACKING_STORE)
> +    if (m_state.tileOwnership == ExternallyManagedTiles) {
> +        HashMap<int, ExternallyManagedTile>::const_iterator end = m_externallyManagedTiles.end();
> +        for (HashMap<int, ExternallyManagedTile>::const_iterator it = m_externallyManagedTiles.begin(); it != end; ++it) {
> +            if (it->second.frontBuffer.texture) {
> +                if (++tiles > 1)
> +                    return true;
> +            }
> +        }
> +
> +        return false;
> +    }
> +#endif
> +
> +    for (size_t i = 0; i < m_ownedTiles.size(); ++i) {
> +        if (m_ownedTiles[i].texture) {
> +            if (++tiles > 1)
> +                return true;
> +        }
> +    }
> +
> +    return false;
> +}

Do you really need the tiles variable? :)

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:574
> +        TextureMapperPaintOptions optionsForMask(options);
> +        optionsForMask.isSurface = true;
> +        m_state.maskLayer->paintSelf(options);

Shouldn't the call to paintSelf pass optionsForMask instead of options?
Comment 3 Noam Rosenthal 2012-01-11 06:29:43 PST
> Do you really need the tiles variable? :)
Guess it could be a boolean, but I don't see what that would buy. We need to see if there is more than one tile with contents, so we have to maintain at one variable after we find the first tile with content.

> 
> > Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:574
> > +        TextureMapperPaintOptions optionsForMask(options);
> > +        optionsForMask.isSurface = true;
> > +        m_state.maskLayer->paintSelf(options);
> 
> Shouldn't the call to paintSelf pass optionsForMask instead of options?
Right, my oversight.
Comment 4 Simon Hausmann 2012-01-11 06:38:19 PST
(In reply to comment #3)
> > Do you really need the tiles variable? :)
> Guess it could be a boolean, but I don't see what that would buy. We need to see if there is more than one tile with contents, so we have to maintain at one variable after we find the first tile with content.

Ah right, I misread > 1 as >= 1.
Comment 5 Simon Hausmann 2012-01-11 06:38:58 PST
Comment on attachment 121759 [details]
Patch

r=me with the options parameter fix.
Comment 6 Noam Rosenthal 2012-01-11 10:30:08 PST
Created attachment 122048 [details]
Patch
Comment 7 WebKit Review Bot 2012-01-11 11:49:57 PST
Comment on attachment 122048 [details]
Patch

Clearing flags on attachment: 122048

Committed r104728: <http://trac.webkit.org/changeset/104728>
Comment 8 WebKit Review Bot 2012-01-11 11:50:01 PST
All reviewed patches have been landed.  Closing bug.