Bug 78448 - [BlackBerry] Upstream accelerated compositing helper class
Summary: [BlackBerry] Upstream accelerated compositing helper class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Leo Yang
URL:
Keywords:
: 78606 (view as bug list)
Depends on:
Blocks: 73144
  Show dependency treegraph
 
Reported: 2012-02-12 18:18 PST by Leo Yang
Modified: 2012-02-27 00:28 PST (History)
7 users (show)

See Also:


Attachments
Patch (8.41 KB, patch)
2012-02-12 18:23 PST, Leo Yang
no flags Details | Formatted Diff | Diff
Patch (8.50 KB, patch)
2012-02-20 19:20 PST, Leo Yang
no flags Details | Formatted Diff | Diff
Patch v3 (8.48 KB, patch)
2012-02-20 20:58 PST, Leo Yang
no flags Details | Formatted Diff | Diff
Patch v4 (8.02 KB, patch)
2012-02-24 00:36 PST, Leo Yang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Yang 2012-02-12 18:18:13 PST
class FrameLayers in the BlackBerry webkit porting is designed to manage attachments of different frames.
Comment 1 Leo Yang 2012-02-12 18:23:45 PST
Created attachment 126700 [details]
Patch
Comment 2 Rob Buis 2012-02-12 19:07:42 PST
Comment on attachment 126700 [details]
Patch

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

Looks good.

> Source/WebKit/blackberry/WebKitSupport/FrameLayers.h:39
> +// FIXME: with the exception of the rootLayerWebKitThread() method

Can you improve above, so we have proper sentences with periods at end? I guess you need two separate sentences here.
Comment 3 Leo Yang 2012-02-12 19:09:05 PST
(In reply to comment #2)
> (From update of attachment 126700 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126700&action=review
> 
> Looks good.
> 
> > Source/WebKit/blackberry/WebKitSupport/FrameLayers.h:39
> > +// FIXME: with the exception of the rootLayerWebKitThread() method
> 
> Can you improve above, so we have proper sentences with periods at end? I guess you need two separate sentences here.

Thank you. I'll fix it before landing.
Comment 4 Antonio Gomes 2012-02-12 19:24:34 PST
Comment on attachment 126700 [details]
Patch

could you check this class is really needed, still?

I changed it so that both iframe and frame take the webcore code path. Could you please confirm before landing this. It should not be needed anymore...
Comment 5 Leo Yang 2012-02-12 19:26:53 PST
(In reply to comment #4)
> (From update of attachment 126700 [details])
> could you check this class is really needed, still?
> 
> I changed it so that both iframe and frame take the webcore code path. Could you please confirm before landing this. It should not be needed anymore...

It's still being used in void WebPagePrivate::setRootLayerWebKitThread(Frame* frame, LayerWebKitThread* layer)
Comment 6 Antonio Gomes 2012-02-12 19:27:35 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 126700 [details] [details])
> > could you check this class is really needed, still?
> > 
> > I changed it so that both iframe and frame take the webcore code path. Could you please confirm before landing this. It should not be needed anymore...
> 
> It's still being used in void WebPagePrivate::setRootLayerWebKitThread(Frame* frame, LayerWebKitThread* layer)

this is ever being called? it should not since both frames and iframe take another codepath.
Comment 7 Leo Yang 2012-02-12 19:30:37 PST
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > (From update of attachment 126700 [details] [details] [details])
> > > could you check this class is really needed, still?
> > > 
> > > I changed it so that both iframe and frame take the webcore code path. Could you please confirm before landing this. It should not be needed anymore...
> > 
> > It's still being used in void WebPagePrivate::setRootLayerWebKitThread(Frame* frame, LayerWebKitThread* layer)
> 
> this is ever being called? it should not since both frames and iframe take another codepath.

OK, I'm holding it and will check if it's ever be called.
Comment 8 Leo Yang 2012-02-12 21:45:28 PST
Comment on attachment 126700 [details]
Patch

Obsolete the patch. FrameLayers does be used, but it only contain root layer even if there are AC subframes. This is because upstream take care of the layers for subframes. I'll refactor internally to evaluate if FrameLayers is needed.
Comment 9 Nima Ghanavatian 2012-02-14 08:25:26 PST
*** Bug 78606 has been marked as a duplicate of this bug. ***
Comment 10 Leo Yang 2012-02-20 18:51:33 PST
Antonio, after revisit the code. I found that the FrameLayers should still be there. Look at RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame(), it's possible that this function returns false for top-level frame. Per my understanding, top-level frame isn't always main frame because it may be a top-level frame for a sub tree. Windonws and Chromium porting also maintain something like a tree structure for layers attached via ChromeClient.
Comment 11 Leo Yang 2012-02-20 19:20:45 PST
Created attachment 127895 [details]
Patch
Comment 12 Antonio Gomes 2012-02-20 19:59:14 PST
Comment on attachment 127895 [details]
Patch

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

> Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp:57
> +static FloatSize frameLayerAbsoluteOffset(Frame* frame)
> +{
> +    FloatSize result;
> +    ASSERT(frame);
> +    const ScrollView* scrollView = frame->view();
> +    if (!scrollView)
> +        return result;
> +
> +    while (const ScrollView* parentScrollView = scrollView->parent()) {
> +        if (scrollView->isFrameView()) {
> +            RenderPart* renderer = static_cast<const FrameView*>(scrollView)->frame()->ownerRenderer();
> +            if (!renderer)
> +                return result;
> +            FloatPoint point = FloatPoint(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
> +            point = renderer->localToAbsolute(point);
> +            result += FloatSize(point.x(), point.y());
> +        } else
> +            result += FloatSize(scrollView->x(), scrollView->y());
> +        scrollView = parentScrollView;
> +    }
> +    return result;
> +}

how is this different than ScrollView::windowToContents and contentsToWindow methods?

> Source/WebKit/blackberry/WebKitSupport/FrameLayers.h:57
> +    bool isRootLayerMainFrameLayer() const
> +    {
> +        return m_rootLayer && !m_rootGraphicsLayer;
> +    }

we should be consistent if we want the

xxx { return abc; } in one line

or

xxx
{
    return abc();
}

> Source/WebKit/blackberry/WebKitSupport/FrameLayers.h:64
> +    typedef HashMap<WebCore::Frame*, WebCore::LayerWebKitThread*> FrameLayerMap;

lets move this typedef declaration a few lines down to be closer to where it is used.
Comment 13 Leo Yang 2012-02-20 20:56:45 PST
(In reply to comment #12)
> (From update of attachment 127895 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=127895&action=review
> 
> > Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp:57
> > +static FloatSize frameLayerAbsoluteOffset(Frame* frame)
> > +{
> > +    FloatSize result;
> > +    ASSERT(frame);
> > +    const ScrollView* scrollView = frame->view();
> > +    if (!scrollView)
> > +        return result;
> > +
> > +    while (const ScrollView* parentScrollView = scrollView->parent()) {
> > +        if (scrollView->isFrameView()) {
> > +            RenderPart* renderer = static_cast<const FrameView*>(scrollView)->frame()->ownerRenderer();
> > +            if (!renderer)
> > +                return result;
> > +            FloatPoint point = FloatPoint(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
> > +            point = renderer->localToAbsolute(point);
> > +            result += FloatSize(point.x(), point.y());
> > +        } else
> > +            result += FloatSize(scrollView->x(), scrollView->y());
> > +        scrollView = parentScrollView;
> > +    }
> > +    return result;
> > +}
> 
> how is this different than ScrollView::windowToContents and contentsToWindow methods?
This is to convert a position of a frame which is in its parent's content coordination to the top frame's content coordination. It will not take scroll position into account.

> 
> > Source/WebKit/blackberry/WebKitSupport/FrameLayers.h:57
> > +    bool isRootLayerMainFrameLayer() const
> > +    {
> > +        return m_rootLayer && !m_rootGraphicsLayer;
> > +    }
> 
> we should be consistent if we want the
> 
> xxx { return abc; } in one line
> 
> or
> 
> xxx
> {
>     return abc();
> }
> 
OK.

> > Source/WebKit/blackberry/WebKitSupport/FrameLayers.h:64
> > +    typedef HashMap<WebCore::Frame*, WebCore::LayerWebKitThread*> FrameLayerMap;
> 
> lets move this typedef declaration a few lines down to be closer to where it is used.
Sure.
Comment 14 Leo Yang 2012-02-20 20:58:04 PST
Created attachment 127910 [details]
Patch v3
Comment 15 Antonio Gomes 2012-02-20 21:06:58 PST
Comment on attachment 127910 [details]
Patch v3

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

> Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp:56
> +    while (const ScrollView* parentScrollView = scrollView->parent()) {
> +        if (scrollView->isFrameView()) {
> +            RenderPart* renderer = static_cast<const FrameView*>(scrollView)->frame()->ownerRenderer();
> +            if (!renderer)
> +                return result;
> +            FloatPoint point = FloatPoint(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
> +            point = renderer->localToAbsolute(point);
> +            result += FloatSize(point.x(), point.y());
> +        } else
> +            result += FloatSize(scrollView->x(), scrollView->y());
> +        scrollView = parentScrollView;
> +    }
> +    return result;

m_webPage->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(IntPoint::zero()));

something like this?
Comment 16 Leo Yang 2012-02-20 21:18:48 PST
(In reply to comment #15)
> (From update of attachment 127910 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=127910&action=review
> 
> > Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp:56
> > +    while (const ScrollView* parentScrollView = scrollView->parent()) {
> > +        if (scrollView->isFrameView()) {
> > +            RenderPart* renderer = static_cast<const FrameView*>(scrollView)->frame()->ownerRenderer();
> > +            if (!renderer)
> > +                return result;
> > +            FloatPoint point = FloatPoint(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
> > +            point = renderer->localToAbsolute(point);
> > +            result += FloatSize(point.x(), point.y());
> > +        } else
> > +            result += FloatSize(scrollView->x(), scrollView->y());
> > +        scrollView = parentScrollView;
> > +    }
> > +    return result;
> 
> m_webPage->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(IntPoint::zero()));
> 
> something like this?
If the frame is not in the tree of the main frame, will the result be different?
Comment 17 Antonio Gomes 2012-02-22 19:53:24 PST
(In reply to comment #16)
> (In reply to comment #15)
> > (From update of attachment 127910 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=127910&action=review
> > 
> > > Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp:56
> > > +    while (const ScrollView* parentScrollView = scrollView->parent()) {
> > > +        if (scrollView->isFrameView()) {
> > > +            RenderPart* renderer = static_cast<const FrameView*>(scrollView)->frame()->ownerRenderer();
> > > +            if (!renderer)
> > > +                return result;
> > > +            FloatPoint point = FloatPoint(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
> > > +            point = renderer->localToAbsolute(point);
> > > +            result += FloatSize(point.x(), point.y());
> > > +        } else
> > > +            result += FloatSize(scrollView->x(), scrollView->y());
> > > +        scrollView = parentScrollView;
> > > +    }
> > > +    return result;
> > 
> > m_webPage->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(IntPoint::zero()));
> > 
> > something like this?
> If the frame is not in the tree of the main frame, will the result be different?

Not sure if I understood your question. Anyways, you tell me : )
Comment 18 Leo Yang 2012-02-22 20:06:33 PST
(In reply to comment #17)
> (In reply to comment #16)
> > (In reply to comment #15)
> > > (From update of attachment 127910 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=127910&action=review
> > > 
> > > > Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp:56
> > > > +    while (const ScrollView* parentScrollView = scrollView->parent()) {
> > > > +        if (scrollView->isFrameView()) {
> > > > +            RenderPart* renderer = static_cast<const FrameView*>(scrollView)->frame()->ownerRenderer();
> > > > +            if (!renderer)
> > > > +                return result;
> > > > +            FloatPoint point = FloatPoint(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
> > > > +            point = renderer->localToAbsolute(point);
> > > > +            result += FloatSize(point.x(), point.y());
> > > > +        } else
> > > > +            result += FloatSize(scrollView->x(), scrollView->y());
> > > > +        scrollView = parentScrollView;
> > > > +    }
> > > > +    return result;
> > > 
> > > m_webPage->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(IntPoint::zero()));
> > > 
> > > something like this?
> > If the frame is not in the tree of the main frame, will the result be different?
> 
> Not sure if I understood your question. Anyways, you tell me : )

If the frame is not in the subtree of main frame, frameLayerAbsoluteOffset() will return the offset in the top-level frame (not main frame) coordination. But I don't know if m_webPage->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(IntPoint::zero())) behaves in the same way.
Comment 19 Leo Yang 2012-02-24 00:36:40 PST
Created attachment 128676 [details]
Patch v4
Comment 20 Antonio Gomes 2012-02-24 06:08:51 PST
Comment on attachment 128676 [details]
Patch v4

r+. Please go ahead if frameLayerAbsoluteOffset is properly tested.
Comment 21 Leo Yang 2012-02-26 22:11:01 PST
Comment on attachment 128676 [details]
Patch v4

Sending to the cq ...
Comment 22 WebKit Review Bot 2012-02-27 00:26:09 PST
The commit-queue encountered the following flaky tests while processing attachment 128676 [details]:

css3/filters/effect-invert-hw.html bug 79639 (author: cmarrin@apple.com)
inspector/protocol/console-agent.html bug 79563 (authors: caseq@chromium.org, loislo@chromium.org, and pfeldman@chromium.org)
The commit-queue is continuing to process your patch.
Comment 23 WebKit Review Bot 2012-02-27 00:28:10 PST
Comment on attachment 128676 [details]
Patch v4

Clearing flags on attachment: 128676

Committed r108963: <http://trac.webkit.org/changeset/108963>
Comment 24 WebKit Review Bot 2012-02-27 00:28:16 PST
All reviewed patches have been landed.  Closing bug.