Commit 230494b1 authored by andersca@apple.com's avatar andersca@apple.com
Browse files

2011-02-16 Anders Carlsson <andersca@apple.com>

        Reviewed by Adam Roben.

        Assertion failure in DrawingAreaImpl::display when calling WKPageForceRepaint on a page that uses accelerated compositing
        https://bugs.webkit.org/show_bug.cgi?id=54575
        <rdar://problem/8979594>

        Add test.
        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
        * TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp: Added.
        (TestWebKitAPI::didForceRepaint):
        (TestWebKitAPI::didFinishLoadForFrame):
        (TestWebKitAPI::TEST):
        * TestWebKitAPI/Tests/WebKit2/simple-accelerated-compositing.html: Added.
        * TestWebKitAPI/win/TestWebKitAPI.vcproj:
        * TestWebKitAPI/win/copy-resources.cmd:
2011-02-16  Anders Carlsson  <andersca@apple.com>

        Reviewed by Adam Roben.

        Assertion failure in DrawingAreaImpl::display when calling WKPageForceRepaint on a page that uses accelerated compositing
        https://bugs.webkit.org/show_bug.cgi?id=54575
        <rdar://problem/8979594>

        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        (WebKit::DrawingAreaImpl::forceRepaint):
        If there is a layer tree host, ask it to force a repaint instead.

        * WebProcess/WebPage/LayerTreeHost.h:
        * WebProcess/WebPage/mac/LayerTreeHostMac.h:
        * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
        (WebKit::LayerTreeHostMac::forceRepaint):
        Flush any layer changes, then flush and synchronize the current CA transaction.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dfd525c9
2011-02-16 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
Assertion failure in DrawingAreaImpl::display when calling WKPageForceRepaint on a page that uses accelerated compositing
https://bugs.webkit.org/show_bug.cgi?id=54575
<rdar://problem/8979594>
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::forceRepaint):
If there is a layer tree host, ask it to force a repaint instead.
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/mac/LayerTreeHostMac.h:
* WebProcess/WebPage/mac/LayerTreeHostMac.mm:
(WebKit::LayerTreeHostMac::forceRepaint):
Flush any layer changes, then flush and synchronize the current CA transaction.
2011-02-16 Alexey Proskuryakov <ap@apple.com>
 
Reviewed by Anders Carlsson.
......@@ -142,6 +142,11 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOff
void DrawingAreaImpl::forceRepaint()
{
if (m_layerTreeHost) {
m_layerTreeHost->forceRepaint();
return;
}
m_isWaitingForDidUpdate = false;
display();
}
......
......@@ -52,6 +52,7 @@ public:
virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&) = 0;
virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) = 0;
virtual void forceRepaint() = 0;
virtual void sizeDidChange(const WebCore::IntSize& newSize) = 0;
virtual void didInstallPageOverlay() = 0;
......
......@@ -53,6 +53,7 @@ private:
virtual void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
virtual void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
virtual void sizeDidChange(const WebCore::IntSize& newSize);
virtual void forceRepaint();
virtual void didInstallPageOverlay();
virtual void didUninstallPageOverlay();
......
......@@ -169,6 +169,15 @@ void LayerTreeHostMac::sizeDidChange(const IntSize& newSize)
[CATransaction synchronize];
}
void LayerTreeHostMac::forceRepaint()
{
scheduleLayerFlush();
flushPendingLayerChanges();
[CATransaction flush];
[CATransaction synchronize];
}
void LayerTreeHostMac::didInstallPageOverlay()
{
createPageOverlayLayer();
......
2011-02-16 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
Assertion failure in DrawingAreaImpl::display when calling WKPageForceRepaint on a page that uses accelerated compositing
https://bugs.webkit.org/show_bug.cgi?id=54575
<rdar://problem/8979594>
Add test.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp: Added.
(TestWebKitAPI::didForceRepaint):
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/simple-accelerated-compositing.html: Added.
* TestWebKitAPI/win/TestWebKitAPI.vcproj:
* TestWebKitAPI/win/copy-resources.cmd:
2011-02-16 Sergio Villar Senin <svillar@igalia.com>
 
Reviewed by Martin Robinson.
......@@ -10,6 +10,8 @@
1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02C84E125D4A8400E3F4BD /* Find.cpp */; };
1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; };
1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */; };
1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */; };
1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */; };
333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
BC131A9B1171316900B69727 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131A9A1171316900B69727 /* main.mm */; };
......@@ -82,6 +84,7 @@
C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */,
C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */,
BC2D006412AA04CE00E732A3 /* file-with-anchor.html in Copy Resources */,
1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */,
);
name = "Copy Resources";
runOnlyForDeploymentPostprocessing = 0;
......@@ -92,6 +95,8 @@
1A02C84B125D4A5E00E3F4BD /* find.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = find.html; sourceTree = "<group>"; };
1A02C84E125D4A8400E3F4BD /* Find.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Find.cpp; sourceTree = "<group>"; };
1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EvaluateJavaScript.cpp; sourceTree = "<group>"; };
1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ForceRepaint.cpp; sourceTree = "<group>"; };
1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-accelerated-compositing.html"; sourceTree = "<group>"; };
333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
BC131883117114A800B69727 /* PlatformUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUtilities.h; sourceTree = "<group>"; };
......@@ -249,6 +254,7 @@
1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */,
BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
1A02C84E125D4A8400E3F4BD /* Find.cpp */,
1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */,
BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */,
BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */,
BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */,
......@@ -279,8 +285,9 @@
BC2D004A12A9FEB300E732A3 /* file-with-anchor.html */,
1A02C84B125D4A5E00E3F4BD /* find.html */,
BCBD372E125ABBE600D2C29F /* icon.png */,
BC909778125571AB00083756 /* simple.html */,
1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */,
C0ADBE8412FCA6B600D2C129 /* simple-form.html */,
BC909778125571AB00083756 /* simple.html */,
C02B7882126615410026BF0F /* spacebar-scrolling.html */,
);
name = Resources;
......@@ -407,6 +414,7 @@
BC2D004912A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp in Sources */,
C0ADBE7C12FCA4D000D2C129 /* JavaScriptTest.cpp in Sources */,
C0ADBE8312FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp in Sources */,
1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "Test.h"
#include "PlatformUtilities.h"
#include "PlatformWebView.h"
#include <WebKit2/WebKit2.h>
#include <WebKit2/WKRetainPtr.h>
namespace TestWebKitAPI {
static bool test1Done;
static bool test2Done;
void didForceRepaint(WKErrorRef error, void*)
{
TEST_ASSERT(!error);
test2Done = true;
}
static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
{
test1Done = true;
WKPageForceRepaint(page, 0, didForceRepaint);
}
TEST(WebKit2, ForceRepaint)
{
WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
PlatformWebView webView(context.get());
WKPageLoaderClient loaderClient;
memset(&loaderClient, 0, sizeof(loaderClient));
loaderClient.version = 0;
loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
WKPageSetPageLoaderClient(webView.page(), &loaderClient);
WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-accelerated-compositing", "html"));
WKPageLoadURL(webView.page(), url.get());
Util::run(&test1Done);
Util::run(&test2Done);
}
} // namespace TestWebKitAPI
<html>
<body>
<div style="-webkit-transform: translateZ(0);">Simple HTML file with accelerated compositing</div>
</body>
</html>
......@@ -427,6 +427,10 @@
RelativePath="..\Tests\WebKit2\Find.cpp"
>
</File>
<File
RelativePath="..\Tests\WebKit2\ForceRepaint.cpp"
>
</File>
<File
RelativePath="..\Tests\WebKit2\find.html"
>
......@@ -463,6 +467,10 @@
RelativePath="..\Tests\WebKit2\simple-form.html"
>
</File>
<File
RelativePath="..\Tests\WebKit2\simple-accelerated-compositing.html"
>
</File>
<File
RelativePath="..\Tests\WebKit2\simple.html"
>
......
......@@ -12,6 +12,7 @@ for %%f in (
..\Tests\WebKit2\find.html
..\Tests\WebKit2\icon.png
..\Tests\WebKit2\simple.html
..\Tests\WebKit2\simple-accelerated-compositing.html
..\Tests\WebKit2\simple-form.html
..\Tests\WebKit2\spacebar-scrolling.html
) do (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment