[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 15:31:04 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 141f9521cc4407a86cd6ab94685ccf197face463
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 5 14:47:37 2010 +0000
Add a test that shows that windowed plugins are able to paint
Somehow we never had a test for this before.
Fixes <http://webkit.org/b/49029> Should add a test that shows
windowed plugins can paint
Reviewed by Jon Honeycutt.
WebKitTools:
* DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp: Added.
(DrawsGradient::DrawsGradient):
(DrawsGradient::wndProc): We handle the WM_PAINT and WM_PRINTCLIENT messages.
(DrawsGradient::onPaint):
(DrawsGradient::onPrintClient):
These both just call through to paint.
(DrawsGradient::paint): Fills our client area with some gradients.
* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Link
against Msimg32.lib for ::GradientFill and added DrawsGradient.
* DumpRenderTree/win/PixelDumpSupportWin.cpp:
(createBitmapContextFromWebView): Use WM_PRINT instead of
WM_PRINTCLIENT so that ::DefWindowProc will send
WM_PRINT/WM_PRINTCLIENT messages to the WebView's child windows.
Replaced kCGImageAlphaPremultipledFirst with kCGImageAlphaNoneSkipFirst
because GDI doesn't support alpha and kCGImageBitmapOrder32Little with
kCGImageBitmapOrder32Host because, who knows, maybe someday Windows
will run on a big-endian platform.
LayoutTests:
* platform/win/platform/win/plugins/draws-gradient-expected.checksum: Added.
* platform/win/platform/win/plugins/draws-gradient-expected.png: Added.
* platform/win/platform/win/plugins/draws-gradient-expected.txt: Added.
* platform/win/plugins/draws-gradient.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 45e3d13..d511a63 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,21 @@
2010-11-04 Adam Roben <aroben at apple.com>
+ Add a test that shows that windowed plugins are able to paint
+
+ Somehow we never had a test for this before.
+
+ Fixes <http://webkit.org/b/49029> Should add a test that shows
+ windowed plugins can paint
+
+ Reviewed by Jon Honeycutt.
+
+ * platform/win/platform/win/plugins/draws-gradient-expected.checksum: Added.
+ * platform/win/platform/win/plugins/draws-gradient-expected.png: Added.
+ * platform/win/platform/win/plugins/draws-gradient-expected.txt: Added.
+ * platform/win/plugins/draws-gradient.html: Added.
+
+2010-11-04 Adam Roben <aroben at apple.com>
+
Add a test to show that windowed plugins are clipped correctly
Fixes <http://webkit.org/b/49024> <rdar://problem/8487847> Windowed
diff --git a/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.checksum b/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.checksum
new file mode 100644
index 0000000..0f8330c
--- /dev/null
+++ b/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.checksum
@@ -0,0 +1 @@
+47fe6c1f35f985d2843421eaee4c0a51
\ No newline at end of file
diff --git a/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.png b/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.png
new file mode 100644
index 0000000..85a93aa
Binary files /dev/null and b/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.png differ
diff --git a/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.txt b/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.txt
new file mode 100644
index 0000000..a1fc4df
--- /dev/null
+++ b/LayoutTests/platform/win/platform/win/plugins/draws-gradient-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x212
+ RenderBlock {HTML} at (0,0) size 800x212
+ RenderBody {BODY} at (8,8) size 784x188
+ RenderBlock (anonymous) at (0,0) size 784x154
+ RenderEmbeddedObject {EMBED} at (0,0) size 300x150
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {P} at (0,170) size 784x18
+ RenderText {#text} at (0,0) size 514x18
+ text run at (0,0) width 514: "This tests that the DrawsGradient plugin test fills its window with some gradients."
diff --git a/LayoutTests/platform/win/plugins/draws-gradient.html b/LayoutTests/platform/win/plugins/draws-gradient.html
new file mode 100644
index 0000000..5a30b40
--- /dev/null
+++ b/LayoutTests/platform/win/plugins/draws-gradient.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+ <embed type="application/x-webkit-test-netscape" test="draws-gradient"></embed>
+ <p>This tests that the DrawsGradient plugin test fills its window with some gradients.</p>
+</body>
+</html>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 86538ec..276b6e7 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,38 @@
2010-11-04 Adam Roben <aroben at apple.com>
+ Add a test that shows that windowed plugins are able to paint
+
+ Somehow we never had a test for this before.
+
+ Fixes <http://webkit.org/b/49029> Should add a test that shows
+ windowed plugins can paint
+
+ Reviewed by Jon Honeycutt.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp: Added.
+ (DrawsGradient::DrawsGradient):
+ (DrawsGradient::wndProc): We handle the WM_PAINT and WM_PRINTCLIENT messages.
+
+ (DrawsGradient::onPaint):
+ (DrawsGradient::onPrintClient):
+ These both just call through to paint.
+
+ (DrawsGradient::paint): Fills our client area with some gradients.
+
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Link
+ against Msimg32.lib for ::GradientFill and added DrawsGradient.
+
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+ (createBitmapContextFromWebView): Use WM_PRINT instead of
+ WM_PRINTCLIENT so that ::DefWindowProc will send
+ WM_PRINT/WM_PRINTCLIENT messages to the WebView's child windows.
+ Replaced kCGImageAlphaPremultipledFirst with kCGImageAlphaNoneSkipFirst
+ because GDI doesn't support alpha and kCGImageBitmapOrder32Little with
+ kCGImageBitmapOrder32Host because, who knows, maybe someday Windows
+ will run on a big-endian platform.
+
+2010-11-04 Adam Roben <aroben at apple.com>
+
Extract much of NPNInvalidateRectInvalidatesWindow's code into a
WindowedPluginTest base class
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp
new file mode 100644
index 0000000..2b06198
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp
@@ -0,0 +1,118 @@
+/* Copyright (C) 2010 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 "WindowedPluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Just fills its window with some gradients
+
+class DrawsGradient : public WindowedPluginTest {
+public:
+ DrawsGradient(NPP, const string& identifier);
+
+private:
+ void paint(HDC) const;
+
+ LRESULT onPaint(WPARAM, LPARAM, bool& handled);
+ LRESULT onPrintClient(WPARAM, LPARAM, bool& handled);
+
+ virtual LRESULT wndProc(UINT message, WPARAM, LPARAM, bool& handled);
+};
+
+static PluginTest::Register<DrawsGradient> registrar("draws-gradient");
+
+DrawsGradient::DrawsGradient(NPP npp, const string& identifier)
+ : WindowedPluginTest(npp, identifier)
+{
+}
+
+LRESULT DrawsGradient::wndProc(UINT message, WPARAM wParam, LPARAM lParam, bool& handled)
+{
+ LRESULT result = 0;
+
+ switch (message) {
+ case WM_PAINT:
+ result = onPaint(wParam, lParam, handled);
+ break;
+ case WM_PRINTCLIENT:
+ result = onPrintClient(wParam, lParam, handled);
+ break;
+ default:
+ handled = false;
+ }
+
+ return result;
+}
+
+LRESULT DrawsGradient::onPaint(WPARAM, LPARAM, bool& handled)
+{
+ PAINTSTRUCT paintStruct;
+ HDC dc = ::BeginPaint(window(), &paintStruct);
+ if (!dc)
+ return 0;
+
+ paint(dc);
+ ::EndPaint(window(), &paintStruct);
+
+ handled = true;
+ return 0;
+}
+
+LRESULT DrawsGradient::onPrintClient(WPARAM wParam, LPARAM, bool& handled)
+{
+ paint(reinterpret_cast<HDC>(wParam));
+
+ handled = true;
+ return 0;
+}
+
+void DrawsGradient::paint(HDC dc) const
+{
+ RECT clientRect;
+ if (!::GetClientRect(window(), &clientRect))
+ return;
+
+ TRIVERTEX vertices[] = {
+ // Upper-left: green
+ { clientRect.left, clientRect.top, 0, 0xff00, 0, 0 },
+ // Upper-right: blue
+ { clientRect.right, clientRect.top, 0, 0, 0xff00, 0 },
+ // Lower-left: yellow
+ { clientRect.left, clientRect.bottom, 0xff00, 0xff00, 0, 0 },
+ // Lower-right: red
+ { clientRect.right, clientRect.bottom, 0xff00, 0, 0, 0 },
+ };
+
+ GRADIENT_TRIANGLE mesh[] = {
+ // Upper-left triangle
+ { 0, 1, 2 },
+ // Lower-right triangle
+ { 1, 2, 3 },
+ };
+
+ ::GradientFill(dc, vertices, _countof(vertices), mesh, _countof(mesh), GRADIENT_FILL_TRIANGLE);
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index 6d51817..a2e6809 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -55,6 +55,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
/>
@@ -125,6 +126,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
/>
@@ -195,6 +197,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
/>
@@ -264,6 +267,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
/>
@@ -334,6 +338,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
/>
@@ -402,6 +407,10 @@
Name="win"
>
<File
+ RelativePath="..\Tests\win\DrawsGradient.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\win\GetValueNetscapeWindow.cpp"
>
</File>
diff --git a/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp b/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp
index b0c76d6..6169f0f 100644
--- a/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp
@@ -63,7 +63,7 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
HDC memoryDC = CreateCompatibleDC(0);
SelectObject(memoryDC, bitmap);
- SendMessage(webViewWindow, WM_PRINTCLIENT, reinterpret_cast<WPARAM>(memoryDC), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
+ SendMessage(webViewWindow, WM_PRINT, reinterpret_cast<WPARAM>(memoryDC), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
DeleteDC(memoryDC);
BITMAP info = {0};
@@ -73,7 +73,7 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
#if PLATFORM(CG)
RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
CGContextRef context = CGBitmapContextCreate(info.bmBits, info.bmWidth, info.bmHeight, 8,
- info.bmWidthBytes, colorSpace.get(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
+ info.bmWidthBytes, colorSpace.get(), kCGBitmapByteOrder32Host | kCGImageAlphaNoneSkipFirst);
#elif PLATFORM(CAIRO)
cairo_surface_t* image = cairo_image_surface_create_for_data((unsigned char*)info.bmBits, CAIRO_FORMAT_ARGB32,
info.bmWidth, info.bmHeight, info.bmWidthBytes);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list