diff options
author | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 15:26:55 +0000 |
---|---|---|
committer | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 15:26:55 +0000 |
commit | 6cea7c48bac15dff8ea8d9b4862b75f5deb59109 (patch) | |
tree | 98ea1b71d6150ccad9ce8ee204985dfc34b24f58 /webkit/tools/test_shell/test_shell.cc | |
parent | 4fad45a6ce06e3c599280920780a496a69d82c3a (diff) | |
download | chromium_src-6cea7c48bac15dff8ea8d9b4862b75f5deb59109.zip chromium_src-6cea7c48bac15dff8ea8d9b4862b75f5deb59109.tar.gz chromium_src-6cea7c48bac15dff8ea8d9b4862b75f5deb59109.tar.bz2 |
Implement layoutTestController.display() method.
BUG=8630
TEST=LayoutTests/fast/repaint/layer-visibility.html should pass.
R=darin
Review URL: http://codereview.chromium.org/180033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 5563505..317a746 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -241,8 +241,11 @@ void TestShell::Dump(TestShell* shell) { // command line (for the dump pixels argument), and the MD5 sum to // stdout. dumped_anything = true; - std::string md5sum = DumpImage(shell->webView(), params->pixel_file_name, - params->pixel_hash); + WebViewHost* view_host = shell->webViewHost(); + view_host->webview()->layout(); + view_host->Paint(); + std::string md5sum = DumpImage(view_host->canvas(), + params->pixel_file_name, params->pixel_hash); printf("#MD5:%s\n", md5sum.c_str()); } if (dumped_anything) @@ -252,19 +255,10 @@ void TestShell::Dump(TestShell* shell) { } // static -std::string TestShell::DumpImage(WebView* view, +std::string TestShell::DumpImage(skia::PlatformCanvas* canvas, const std::wstring& file_name, const std::string& pixel_hash) { - view->layout(); - const WebSize& size = view->size(); - - skia::PlatformCanvas canvas; - if (!canvas.initialize(size.width, size.height, true)) - return std::string(); - view->paint(webkit_glue::ToWebCanvas(&canvas), - WebRect(0, 0, size.width, size.height)); - skia::BitmapPlatformDevice& device = - static_cast<skia::BitmapPlatformDevice&>(canvas.getTopPlatformDevice()); + static_cast<skia::BitmapPlatformDevice&>(canvas->getTopPlatformDevice()); const SkBitmap& src_bmp = device.accessBitmap(false); // Encode image. |