RESOLVED FIXED 41084
Get accelerated compositing working with webkit2
https://bugs.webkit.org/show_bug.cgi?id=41084
Summary Get accelerated compositing working with webkit2
Simon Fraser (smfr)
Reported Wednesday, June 23, 2010 7:07:38 PM UTC
Bug to get accelerated compositing working with webkit2.
Attachments
Patch (30.41 KB, patch)
2010-06-23 11:21 PDT, Simon Fraser (smfr)
no flags
Patch (4.86 KB, patch)
2010-06-30 17:22 PDT, Simon Fraser (smfr)
no flags
GraphicsLayer changes (3.92 KB, patch)
2010-07-01 12:05 PDT, Simon Fraser (smfr)
no flags
Add layer-backed drawing area (46.48 KB, patch)
2010-07-01 14:12 PDT, Simon Fraser (smfr)
no flags
Render server setup, and style fixes (16.51 KB, patch)
2010-07-01 15:36 PDT, Simon Fraser (smfr)
no flags
Patch (30.29 KB, patch)
2010-07-20 14:16 PDT, Simon Fraser (smfr)
andersca: review+
Simon Fraser (smfr)
Comment 1 Wednesday, June 23, 2010 7:08:25 PM UTC
Simon Fraser (smfr)
Comment 2 Wednesday, June 23, 2010 7:21:07 PM UTC
mitz
Comment 3 Wednesday, June 23, 2010 7:50:27 PM UTC
Comment on attachment 59538 [details] Patch Style review: > + Get accelerated compositing working with webkit2 Please include the Radar URL. s/webkit2/WebKit2/. > + First step: display the compositing layer tree from the webkit process s/webkit/web/ > + (WebKit::ChunkedUpdateDrawingArea::attachCompositingContext): Non-mac stub. Mac. > +#if PLATFORM(MAC) > + SetupAcceleratedCompositingPort > +#endif The verb is “set up” so the name should be “SetUpAcceleratedCompositingPort”. > +#if USE(ACCELERATED_COMPOSITING) > + NSView* _layerHostingView; > +#endif The star should go next to the name. > +#if USE(ACCELERATED_COMPOSITING) > +- (void)_startAcceleratedCompositing:(CALayer*)rootLayer There should be a space before the star. > + NSView* hostingView = [[NSView alloc] initWithFrame:[self bounds]]; Move the star over to the other side. > + [self addSubview:hostingView]; > + [hostingView release]; > + // hostingView is owned by being a subview of self I think the comment is redundant. Being a full sentence, it should be terminated by a period. Or you could just remove it. > + CALayer* viewLayer = [CALayer layer]; Star should be next to the name. > +- (void)_startAcceleratedCompositing:(CALayer*)rootLayer; Needs a space before the star. > +#if USE(ACCELERATED_COMPOSITING) > + void setupAcceleratedCompositing(); > +#endif s/setup/setUp/ > --- a/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm > +++ b/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm > @@ -25,11 +25,15 @@ > > #include "ChunkedUpdateDrawingAreaProxy.h" > > +#include <QuartzCore/QuartzCore.h> > + > #include "DrawingAreaMessageKinds.h" > #include "DrawingAreaProxyMessageKinds.h" > #include "UpdateChunk.h" > #include "WKAPICast.h" > #include "WKView.h" > +#include "WKViewInternal.h" > +#include "WebKitSystemInterface.h" > #include "WebPageProxy.h" <QuartzCore/QuartzCore.h> should not be in its own paragraph. It should be at the end of the main paragraph. You can change all of the #include directives to #import directives now that this is an Objective-C file. > + // Cleanup. This comment tells me absolutely nothing, but at least it’s period-terminated. > --- a/WebKit2/WebProcess/WebPage/mac/ChunkedUpdateDrawingAreaMac.cpp > +++ b/WebKit2/WebProcess/WebPage/mac/ChunkedUpdateDrawingAreaMac.mm > @@ -25,9 +25,15 @@ > > #include "ChunkedUpdateDrawingArea.h" > > +#include <QuartzCore/QuartzCore.h> > + Should not be in its own separate paragraph. > +#include "DrawingAreaProxyMessageKinds.h" > #include "UpdateChunk.h" > #include "WebPage.h" > +#include "WebProcess.h" > #include <WebCore/GraphicsContext.h> > +#include <WebCore/GraphicsLayer.h> > +#include "WebKitSystemInterface.h" > #include <wtf/RetainPtr.h> This should be sorted. > + CALayer* caLayer = layer->platformLayer(); Star is on the wrong side. > +#if PLATFORM(MAC) > + , m_compositingRenderServerPort(MACH_PORT_NULL) > +#endif Is this needed in non-accelerated-compositing builds? > +#if PLATFORM(MAC) > + mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; } > +#endif Ditto. > +#if PLATFORM(MAC) > + mach_port_t m_compositingRenderServerPort; > +#endif Ditto.
Simon Fraser (smfr)
Comment 4 Thursday, July 1, 2010 1:19:08 AM UTC
Comment on attachment 59538 [details] Patch Taking a different tack now.
Simon Fraser (smfr)
Comment 5 Thursday, July 1, 2010 1:22:55 AM UTC
Simon Fraser (smfr)
Comment 6 Thursday, July 1, 2010 8:05:13 PM UTC
Created attachment 60268 [details] GraphicsLayer changes
Darin Adler
Comment 7 Thursday, July 1, 2010 8:10:10 PM UTC
Comment on attachment 60268 [details] GraphicsLayer changes I’m not a huge fan of xxxRecursive as the name for the version that includes sublayers. The "recursive" suffix seems a little vague and I don’t like it in places we already have it. If the normal case would be to sync the sublayers, then I'd suggest calling the single-layer version syncCompositingStateForThisLayerOnly or something like that. Or you could call the new one syncCompositingStateIncludingSublayers.
Simon Fraser (smfr)
Comment 8 Thursday, July 1, 2010 8:30:35 PM UTC
Simon Fraser (smfr)
Comment 9 Thursday, July 1, 2010 8:39:12 PM UTC
Simon Fraser (smfr)
Comment 10 Thursday, July 1, 2010 10:12:50 PM UTC
Created attachment 60284 [details] Add layer-backed drawing area
WebKit Review Bot
Comment 11 Thursday, July 1, 2010 10:14:39 PM UTC
Attachment 60284 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp:28: Found header this file implements before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp:153: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.h:34: Alphabetical sorting problem. [build/include_order] [4] WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.h:47: Code inside a namespace should not be indented. [whitespace/indent] [4] WebKit2/UIProcess/LayerBackedDrawingAreaProxy.cpp:28: Found header this file implements before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] WebKit2/UIProcess/LayerBackedDrawingAreaProxy.cpp:121: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] Total errors found: 6 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 12 Thursday, July 1, 2010 11:24:41 PM UTC
Comment on attachment 60284 [details] Add layer-backed drawing area http://trac.webkit.org/changeset/62303
Simon Fraser (smfr)
Comment 13 Thursday, July 1, 2010 11:25:18 PM UTC
Comment on attachment 60173 [details] Patch Export some webcore symbols
Simon Fraser (smfr)
Comment 14 Thursday, July 1, 2010 11:36:46 PM UTC
Created attachment 60301 [details] Render server setup, and style fixes
Eric Seidel (no email)
Comment 15 Friday, July 2, 2010 11:17:07 AM UTC
Comment on attachment 60173 [details] Patch Cleared Sam Weinig's review+ from obsolete attachment 60173 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Eric Seidel (no email)
Comment 16 Friday, July 2, 2010 11:17:11 AM UTC
Comment on attachment 60268 [details] GraphicsLayer changes Cleared Darin Adler's review+ from obsolete attachment 60268 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Eric Seidel (no email)
Comment 17 Friday, July 2, 2010 11:17:15 AM UTC
Comment on attachment 60284 [details] Add layer-backed drawing area Cleared Anders Carlsson's review+ from obsolete attachment 60284 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Simon Fraser (smfr)
Comment 18 Tuesday, July 20, 2010 10:16:14 PM UTC
WebKit Review Bot
Comment 19 Tuesday, July 20, 2010 10:17:53 PM UTC
Attachment 62110 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit2/WebProcess/WebPage/DrawingArea.cpp:40: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] Total errors found: 1 in 24 files If any of these errors are false positives, please file a bug against check-webkit-style.
Anders Carlsson
Comment 20 Wednesday, July 21, 2010 5:25:07 PM UTC
Comment on attachment 62110 [details] Patch > } // namespace WebKit > diff --git a/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h b/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h > index 2644abb4907b608351abaa5ccbe5c74ffa323e6d..05323b42f9dec1c1141a17d53cbb6fc5ef804c79 100644 > --- a/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h > +++ b/WebKit2/UIProcess/ChunkedUpdateDrawingAreaProxy.h > @@ -71,6 +71,7 @@ private: > > // DrawingAreaProxy > virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder&); > + virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder&, CoreIPC::ArgumentEncoder&); > virtual void paint(const WebCore::IntRect&, PlatformDrawingContext); > virtual void setSize(const WebCore::IntSize&); > virtual void setPageIsVisible(bool isVisible); > diff --git a/WebKit2/UIProcess/DrawingAreaProxy.h b/WebKit2/UIProcess/DrawingAreaProxy.h > index 1bd7da3cf1692d013efc8d75ac0571e9ed65c3c6..3817eb1f55c70fadafbcb58045cb464edcc62d59 100644 > --- a/WebKit2/UIProcess/DrawingAreaProxy.h > +++ b/WebKit2/UIProcess/DrawingAreaProxy.h > @@ -55,7 +55,9 @@ typedef QPainter* PlatformDrawingContext; > > +void WebPageProxy::setDrawingArea(DrawingAreaProxy* drawingArea) Since m_drawingArea is an OwnPtr, this should take a PassOwnPtr. Also, the setDrawingArea call site should use OwnPtrs. > +#if USE(ACCELERATED_COMPOSITING) > + case WebPageProxyMessage::DidChangeAcceleratedCompositing: { > + bool compositing; > + if (!arguments.decode(CoreIPC::Out(compositing))) > + return; > + > + if (compositing) > + didEnterAcceleratedCompositing(); > + else > + didLeaveAcceleratedCompositing(); > + > + DrawingAreaProxy::Type drawingAreaType = drawingArea()->type(); > + reply.encode(CoreIPC::In(static_cast<uint32_t>(drawingAreaType))); > + break; We usually don't do any work other than decoding/encoding in the didReceiveMessage case handlers. This should just call a didChangeAcceleratedCompositing function.
Simon Fraser (smfr)
Comment 21 Wednesday, July 21, 2010 6:51:53 PM UTC
Note You need to log in before you can comment on or make changes to this bug.