RESOLVED FIXED Bug 78448
[BlackBerry] Upstream accelerated compositing helper class
https://bugs.webkit.org/show_bug.cgi?id=78448
Summary [BlackBerry] Upstream accelerated compositing helper class
Leo Yang
Reported 2012-02-12 18:18:13 PST
class FrameLayers in the BlackBerry webkit porting is designed to manage attachments of different frames.
Attachments
Patch (8.41 KB, patch)
2012-02-12 18:23 PST, Leo Yang
no flags
Patch (8.50 KB, patch)
2012-02-20 19:20 PST, Leo Yang
no flags
Patch v3 (8.48 KB, patch)
2012-02-20 20:58 PST, Leo Yang
no flags
Patch v4 (8.02 KB, patch)
2012-02-24 00:36 PST, Leo Yang
no flags
Leo Yang
Comment 1 2012-02-12 18:23:45 PST
Rob Buis
Comment 2 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.
Leo Yang
Comment 3 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.
Antonio Gomes
Comment 4 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...
Leo Yang
Comment 5 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)
Antonio Gomes
Comment 6 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.
Leo Yang
Comment 7 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.
Leo Yang
Comment 8 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.
Nima Ghanavatian
Comment 9 2012-02-14 08:25:26 PST
*** Bug 78606 has been marked as a duplicate of this bug. ***
Leo Yang
Comment 10 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.
Leo Yang
Comment 11 2012-02-20 19:20:45 PST
Antonio Gomes
Comment 12 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.
Leo Yang
Comment 13 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.
Leo Yang
Comment 14 2012-02-20 20:58:04 PST
Created attachment 127910 [details] Patch v3
Antonio Gomes
Comment 15 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?
Leo Yang
Comment 16 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?
Antonio Gomes
Comment 17 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 : )
Leo Yang
Comment 18 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.
Leo Yang
Comment 19 2012-02-24 00:36:40 PST
Created attachment 128676 [details] Patch v4
Antonio Gomes
Comment 20 2012-02-24 06:08:51 PST
Comment on attachment 128676 [details] Patch v4 r+. Please go ahead if frameLayerAbsoluteOffset is properly tested.
Leo Yang
Comment 21 2012-02-26 22:11:01 PST
Comment on attachment 128676 [details] Patch v4 Sending to the cq ...
WebKit Review Bot
Comment 22 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.
WebKit Review Bot
Comment 23 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>
WebKit Review Bot
Comment 24 2012-02-27 00:28:16 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.