Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: content/shell/renderer/test_runner/WebTestProxy.cpp

Issue 128443002: Flood-fill the canvas used for layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/test_runner/WebTestProxy.h" 5 #include "content/shell/renderer/test_runner/WebTestProxy.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 8
9 #include "content/shell/renderer/test_runner/AccessibilityController.h" 9 #include "content/shell/renderer/test_runner/AccessibilityController.h"
10 #include "content/shell/renderer/test_runner/EventSender.h" 10 #include "content/shell/renderer/test_runner/EventSender.h"
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 625 }
626 626
627 SkCanvas* WebTestProxyBase::canvas() 627 SkCanvas* WebTestProxyBase::canvas()
628 { 628 {
629 if (m_canvas.get()) 629 if (m_canvas.get())
630 return m_canvas.get(); 630 return m_canvas.get();
631 WebSize widgetSize = webWidget()->size(); 631 WebSize widgetSize = webWidget()->size();
632 float deviceScaleFactor = webView()->deviceScaleFactor(); 632 float deviceScaleFactor = webView()->deviceScaleFactor();
633 int scaledWidth = static_cast<int>(ceil(static_cast<float>(widgetSize.width) * deviceScaleFactor)); 633 int scaledWidth = static_cast<int>(ceil(static_cast<float>(widgetSize.width) * deviceScaleFactor));
634 int scaledHeight = static_cast<int>(ceil(static_cast<float>(widgetSize.heigh t) * deviceScaleFactor)); 634 int scaledHeight = static_cast<int>(ceil(static_cast<float>(widgetSize.heigh t) * deviceScaleFactor));
635 m_canvas.reset(skia::CreateBitmapCanvas(scaledWidth, scaledHeight, true)); 635 m_canvas.reset(skia::CreateBitmapCanvas(scaledWidth, scaledHeight, true));
reed1 2014/01/08 15:49:17 I think you want to just pass 'false' to CreateBit
jochen (gone - plz use gerrit) 2014/01/08 18:03:52 Done.
636 m_canvas->drawARGB(0, 0, 0, 0);
636 return m_canvas.get(); 637 return m_canvas.get();
637 } 638 }
638 639
639 // Paints the entire canvas a semi-transparent black (grayish). This is used 640 // Paints the entire canvas a semi-transparent black (grayish). This is used
640 // by the layout tests in fast/repaint. The alpha value matches upstream. 641 // by the layout tests in fast/repaint. The alpha value matches upstream.
641 void WebTestProxyBase::displayRepaintMask() 642 void WebTestProxyBase::displayRepaintMask()
642 { 643 {
643 canvas()->drawARGB(167, 0, 0, 0); 644 canvas()->drawARGB(167, 0, 0, 0);
644 } 645 }
645 646
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 1359
1359 void WebTestProxyBase::resetInputMethod() 1360 void WebTestProxyBase::resetInputMethod()
1360 { 1361 {
1361 // If a composition text exists, then we need to let the browser process 1362 // If a composition text exists, then we need to let the browser process
1362 // to cancel the input method's ongoing composition session. 1363 // to cancel the input method's ongoing composition session.
1363 if (m_webWidget) 1364 if (m_webWidget)
1364 m_webWidget->confirmComposition(); 1365 m_webWidget->confirmComposition();
1365 } 1366 }
1366 1367
1367 } 1368 }
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698