Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2011-02-23 Anders Carlsson <andersca@apple.com>
        Reviewed by Sam Weinig.

        Remove some of the old accelerated compositing code
        https://bugs.webkit.org/show_bug.cgi?id=55084

        * UIProcess/API/mac/PageClientImpl.h:
        * UIProcess/API/mac/PageClientImpl.mm:
        (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
        * UIProcess/API/mac/WKView.mm:
        * UIProcess/API/mac/WKViewInternal.h:
        * UIProcess/API/qt/qwkpage_p.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
        (WebKit::LayerBackedDrawingAreaProxy::attachCompositingContext):
        (WebKit::LayerBackedDrawingAreaProxy::detachCompositingContext):
        * UIProcess/win/WebView.cpp:
        * UIProcess/win/WebView.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::enterAcceleratedCompositingMode):
        (WebKit::WebPage::exitAcceleratedCompositingMode):
        * WebProcess/WebPage/WebPage.h:


Canonical link: https://commits.webkit.org/69429@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Feb 24, 2011
1 parent a8ace63 commit 0f47b64
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 274 deletions.
28 changes: 28 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,31 @@
2011-02-23 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.

Remove some of the old accelerated compositing code
https://bugs.webkit.org/show_bug.cgi?id=55084

* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::exitAcceleratedCompositingMode):
* UIProcess/API/mac/WKView.mm:
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/API/qt/qwkpage_p.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::exitAcceleratedCompositingMode):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
(WebKit::LayerBackedDrawingAreaProxy::attachCompositingContext):
(WebKit::LayerBackedDrawingAreaProxy::detachCompositingContext):
* UIProcess/win/WebView.cpp:
* UIProcess/win/WebView.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::enterAcceleratedCompositingMode):
(WebKit::WebPage::exitAcceleratedCompositingMode):
* WebProcess/WebPage/WebPage.h:

2011-02-23 Enrica Casucci <enrica@apple.com>

Reverting an unintentional change that was part of http://trac.webkit.org/changeset/79494.
Expand Down
5 changes: 0 additions & 5 deletions Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Expand Up @@ -86,11 +86,6 @@ class PageClientImpl : public PageClient {
virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
virtual void exitAcceleratedCompositingMode();

#if USE(ACCELERATED_COMPOSITING)
virtual void pageDidEnterAcceleratedCompositing();
virtual void pageDidLeaveAcceleratedCompositing();
#endif

virtual void accessibilityWebProcessTokenReceived(const CoreIPC::DataReference&);
virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
virtual void setAutodisplay(bool);
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Expand Up @@ -353,16 +353,6 @@ - (void)redoEditing:(id)sender
{
[m_wkView _exitAcceleratedCompositingMode];
}

void PageClientImpl::pageDidEnterAcceleratedCompositing()
{
[m_wkView _pageDidEnterAcceleratedCompositing];
}

void PageClientImpl::pageDidLeaveAcceleratedCompositing()
{
[m_wkView _pageDidLeaveAcceleratedCompositing];
}
#endif // USE(ACCELERATED_COMPOSITING)

void PageClientImpl::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
Expand Down
101 changes: 0 additions & 101 deletions Source/WebKit2/UIProcess/API/mac/WKView.mm
Expand Up @@ -1851,95 +1851,6 @@ - (void)_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL
_data->_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut);
}

#if USE(ACCELERATED_COMPOSITING)
- (void)_startAcceleratedCompositing:(CALayer *)rootLayer
{
if (!_data->_oldLayerHostingView) {
NSView *hostingView = [[NSView alloc] initWithFrame:[self bounds]];
#if !defined(BUILDING_ON_LEOPARD)
[hostingView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
#endif

[self addSubview:hostingView];
[hostingView release];
_data->_oldLayerHostingView = hostingView;
}

// Make a container layer, which will get sized/positioned by AppKit and CA.
CALayer *viewLayer = [CALayer layer];

#ifndef NDEBUG
[viewLayer setName:@"hosting layer"];
#endif

#if defined(BUILDING_ON_LEOPARD)
// Turn off default animations.
NSNull *nullValue = [NSNull null];
NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys:
nullValue, @"anchorPoint",
nullValue, @"bounds",
nullValue, @"contents",
nullValue, @"contentsRect",
nullValue, @"opacity",
nullValue, @"position",
nullValue, @"sublayerTransform",
nullValue, @"sublayers",
nullValue, @"transform",
nil];
[viewLayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]];
#endif

#if !defined(BUILDING_ON_LEOPARD)
// If we aren't in the window yet, we'll use the screen's scale factor now, and reset the scale
// via -viewDidMoveToWindow.
CGFloat scaleFactor = [self window] ? [[self window] userSpaceScaleFactor] : [[NSScreen mainScreen] userSpaceScaleFactor];
[viewLayer setTransform:CATransform3DMakeScale(scaleFactor, scaleFactor, 1)];
#endif

[_data->_oldLayerHostingView setLayer:viewLayer];
[_data->_oldLayerHostingView setWantsLayer:YES];

// Parent our root layer in the container layer
[viewLayer addSublayer:rootLayer];
}

- (void)_stopAcceleratedCompositing
{
if (_data->_oldLayerHostingView) {
[_data->_oldLayerHostingView setLayer:nil];
[_data->_oldLayerHostingView setWantsLayer:NO];
[_data->_oldLayerHostingView removeFromSuperview];
_data->_oldLayerHostingView = nil;
}
}

- (void)_switchToDrawingAreaTypeIfNecessary:(DrawingAreaInfo::Type)type
{
DrawingAreaInfo::Type existingDrawingAreaType = _data->_page->drawingArea() ? _data->_page->drawingArea()->info().type : DrawingAreaInfo::None;
if (existingDrawingAreaType == type)
return;

OwnPtr<DrawingAreaProxy> newDrawingArea;
switch (type) {
case DrawingAreaInfo::Impl:
case DrawingAreaInfo::None:
break;
case DrawingAreaInfo::ChunkedUpdate: {
newDrawingArea = ChunkedUpdateDrawingAreaProxy::create(self, _data->_page.get());
break;
}
case DrawingAreaInfo::LayerBacked: {
newDrawingArea = LayerBackedDrawingAreaProxy::create(self, _data->_page.get());
break;
}
}

newDrawingArea->setSize(IntSize([self frame].size), IntSize());

_data->_page->drawingArea()->detachCompositingContext();
_data->_page->setDrawingArea(newDrawingArea.release());
}

- (void)_enterAcceleratedCompositingMode:(const LayerTreeContext&)layerTreeContext
{
ASSERT(!_data->_layerHostingView);
Expand Down Expand Up @@ -1979,18 +1890,6 @@ - (void)_exitAcceleratedCompositingMode
_data->_layerHostingView = nullptr;
}

- (void)_pageDidEnterAcceleratedCompositing
{
[self _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::LayerBacked];
}

- (void)_pageDidLeaveAcceleratedCompositing
{
// FIXME: we may want to avoid flipping back to the non-layer-backed drawing area until the next page load, to avoid thrashing.
[self _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::ChunkedUpdate];
}
#endif // USE(ACCELERATED_COMPOSITING)

- (void)_setAccessibilityWebProcessToken:(NSData *)data
{
#if !defined(BUILDING_ON_SNOW_LEOPARD)
Expand Down
7 changes: 0 additions & 7 deletions Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Expand Up @@ -52,13 +52,6 @@ namespace WebKit {
- (void)_enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext;
- (void)_exitAcceleratedCompositingMode;

#if USE(ACCELERATED_COMPOSITING)
- (void)_startAcceleratedCompositing:(CALayer *)rootLayer;
- (void)_stopAcceleratedCompositing;
- (void)_pageDidEnterAcceleratedCompositing;
- (void)_pageDidLeaveAcceleratedCompositing;
#endif

- (void)_setAccessibilityWebProcessToken:(NSData *)data;
- (void)_setComplexTextInputEnabled:(BOOL)complexTextInputEnabled pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;

Expand Down
2 changes: 0 additions & 2 deletions Source/WebKit2/UIProcess/API/qt/qwkpage_p.h
Expand Up @@ -62,8 +62,6 @@ class QWKPagePrivate : WebKit::PageClient {
#if USE(ACCELERATED_COMPOSITING)
virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
virtual void exitAcceleratedCompositingMode();
void pageDidEnterAcceleratedCompositing() { }
void pageDidLeaveAcceleratedCompositing() { }
#endif // USE(ACCELERATED_COMPOSITING)
virtual void pageDidRequestScroll(const WebCore::IntSize&);
virtual void processDidCrash();
Expand Down
3 changes: 0 additions & 3 deletions Source/WebKit2/UIProcess/PageClient.h
Expand Up @@ -119,9 +119,6 @@ class PageClient {
#if USE(ACCELERATED_COMPOSITING)
virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0;
virtual void exitAcceleratedCompositingMode() = 0;

virtual void pageDidEnterAcceleratedCompositing() = 0;
virtual void pageDidLeaveAcceleratedCompositing() = 0;
#endif

#if PLATFORM(WIN)
Expand Down
23 changes: 0 additions & 23 deletions Source/WebKit2/UIProcess/WebPageProxy.cpp
Expand Up @@ -2497,18 +2497,6 @@ void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
m_frameSetLargestFrame = frame;
}

#if USE(ACCELERATED_COMPOSITING)
void WebPageProxy::didChangeAcceleratedCompositing(bool compositing, DrawingAreaInfo& drawingAreaInfo)
{
if (compositing)
didEnterAcceleratedCompositing();
else
didLeaveAcceleratedCompositing();

drawingAreaInfo = drawingArea()->info();
}
#endif

void WebPageProxy::processDidBecomeUnresponsive()
{
m_loaderClient.processDidBecomeUnresponsive(this);
Expand Down Expand Up @@ -2618,17 +2606,6 @@ void WebPageProxy::exitAcceleratedCompositingMode()
{
m_pageClient->exitAcceleratedCompositingMode();
}

void WebPageProxy::didEnterAcceleratedCompositing()
{
m_pageClient->pageDidEnterAcceleratedCompositing();
}

void WebPageProxy::didLeaveAcceleratedCompositing()
{
m_pageClient->pageDidLeaveAcceleratedCompositing();
}

#endif // USE(ACCELERATED_COMPOSITING)

void WebPageProxy::backForwardClear()
Expand Down
9 changes: 0 additions & 9 deletions Source/WebKit2/UIProcess/WebPageProxy.h
Expand Up @@ -341,11 +341,6 @@ class WebPageProxy : public APIObject, public WebPopupMenuProxy::Client {
virtual void exitAcceleratedCompositingMode();
#endif

#if USE(ACCELERATED_COMPOSITING)
void didEnterAcceleratedCompositing();
void didLeaveAcceleratedCompositing();
#endif

void didDraw();

enum UndoOrRedo { Undo, Redo };
Expand Down Expand Up @@ -581,10 +576,6 @@ class WebPageProxy : public APIObject, public WebPopupMenuProxy::Client {
void focusedFrameChanged(uint64_t frameID);
void frameSetLargestFrameChanged(uint64_t frameID);

#if USE(ACCELERATED_COMPOSITING)
void didChangeAcceleratedCompositing(bool compositing, DrawingAreaInfo&);
#endif

void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);

Expand Down
5 changes: 0 additions & 5 deletions Source/WebKit2/UIProcess/WebPageProxy.messages.in
Expand Up @@ -167,11 +167,6 @@ messages -> WebPageProxy {
# ContextMenu messages
ShowContextMenu(WebCore::IntPoint menuLocation, WebKit::ContextMenuState state, Vector<WebKit::WebContextMenuItemData> items, WebKit::InjectedBundleUserMessageEncoder userData)

#if USE(ACCELERATED_COMPOSITING)
# Accelerated compositing messages
DidChangeAcceleratedCompositing(bool compositing) -> (WebKit::DrawingAreaInfo newDrawingArea)
#endif

# Authentication messages
CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)
DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
Expand Down
32 changes: 0 additions & 32 deletions Source/WebKit2/UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm
Expand Up @@ -51,42 +51,10 @@

void LayerBackedDrawingAreaProxy::attachCompositingContext(uint32_t contextID)
{
#if HAVE(HOSTED_CORE_ANIMATION)
m_compositingRootLayer = WKMakeRenderLayer(contextID);

// Turn off default animations.
NSNull *nullValue = [NSNull null];
NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys:
nullValue, @"anchorPoint",
nullValue, @"bounds",
nullValue, @"contents",
nullValue, @"contentsRect",
nullValue, @"opacity",
nullValue, @"position",
nullValue, @"sublayerTransform",
nullValue, @"sublayers",
nullValue, @"transform",
nil];
[m_compositingRootLayer.get() setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]];

[m_compositingRootLayer.get() setAnchorPoint:CGPointZero];
[m_compositingRootLayer.get() setBounds:CGRectMake(0, 0, size().width(), size().height())];

// FIXME: this fixes the layer jiggle when resizing the window, but breaks layer flipping because
// CA doesn't propagate the kCALayerFlagFlippedAbove through the remote layer.
// [m_compositingRootLayer.get() setGeometryFlipped:YES];

#ifndef NDEBUG
[m_compositingRootLayer.get() setName:@"Compositing root layer"];
#endif

[m_webView _startAcceleratedCompositing:m_compositingRootLayer.get()];
#endif
}

void LayerBackedDrawingAreaProxy::detachCompositingContext()
{
[m_webView _stopAcceleratedCompositing];
m_compositingRootLayer = 0;
}

Expand Down
40 changes: 0 additions & 40 deletions Source/WebKit2/UIProcess/win/WebView.cpp
Expand Up @@ -1183,46 +1183,6 @@ void WebView::exitAcceleratedCompositingMode()
ASSERT_NOT_REACHED();
}

void WebView::pageDidEnterAcceleratedCompositing()
{
ASSERT(!useNewDrawingArea());
switchToDrawingAreaTypeIfNecessary(DrawingAreaInfo::LayerBacked);
}

void WebView::pageDidLeaveAcceleratedCompositing()
{
ASSERT(!useNewDrawingArea());
switchToDrawingAreaTypeIfNecessary(DrawingAreaInfo::ChunkedUpdate);
}

void WebView::switchToDrawingAreaTypeIfNecessary(DrawingAreaInfo::Type type)
{
ASSERT(!useNewDrawingArea());

DrawingAreaInfo::Type existingDrawingAreaType = m_page->drawingArea() ? m_page->drawingArea()->info().type : DrawingAreaInfo::None;
if (existingDrawingAreaType == type)
return;

OwnPtr<DrawingAreaProxy> newDrawingArea;
switch (type) {
case DrawingAreaInfo::Impl:
case DrawingAreaInfo::None:
break;
case DrawingAreaInfo::ChunkedUpdate:
newDrawingArea = ChunkedUpdateDrawingAreaProxy::create(this, m_page.get());
break;
case DrawingAreaInfo::LayerBacked:
newDrawingArea = LayerBackedDrawingAreaProxy::create(this, m_page.get());
break;
}

if (m_page->drawingArea())
newDrawingArea->setSize(m_page->drawingArea()->size(), IntSize());

m_page->drawingArea()->detachCompositingContext();
m_page->setDrawingArea(newDrawingArea.release());
}

#endif // USE(ACCELERATED_COMPOSITING)

HWND WebView::nativeWindow()
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit2/UIProcess/win/WebView.h
Expand Up @@ -161,10 +161,6 @@ class WebView : public APIObject, public PageClient, WebCore::WindowMessageListe
#if USE(ACCELERATED_COMPOSITING)
virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
virtual void exitAcceleratedCompositingMode();

virtual void pageDidEnterAcceleratedCompositing();
virtual void pageDidLeaveAcceleratedCompositing();
void switchToDrawingAreaTypeIfNecessary(DrawingAreaInfo::Type);
#endif

void didCommitLoadForMainFrame(bool useCustomRepresentation);
Expand Down

0 comments on commit 0f47b64

Please sign in to comment.