Commit a017b667 authored by vmiura's avatar vmiura Committed by Commit bot

Re-enable GPU Rasterization for content with any author defined viewport.

BUG=591179

Review-Url: https://codereview.chromium.org/2097413003
Cr-Commit-Position: refs/heads/master@{#402702}
parent a4b584f5
...@@ -257,9 +257,7 @@ void ViewportDescription::reportMobilePageStats(const LocalFrame* mainFrame) con ...@@ -257,9 +257,7 @@ void ViewportDescription::reportMobilePageStats(const LocalFrame* mainFrame) con
bool ViewportDescription::matchesHeuristicsForGpuRasterization() const bool ViewportDescription::matchesHeuristicsForGpuRasterization() const
{ {
return maxWidth == Length(DeviceWidth) return isSpecifiedByAuthor();
&& minZoom == 1.0
&& minZoomIsExplicit;
} }
} // namespace blink } // namespace blink
...@@ -2786,8 +2786,14 @@ TEST_F(ViewportTest, viewportLimitsAdjustedForNoUserScaleControl) ...@@ -2786,8 +2786,14 @@ TEST_F(ViewportTest, viewportLimitsAdjustedForNoUserScaleControl)
TEST_F(ViewportTest, viewportTriggersGpuRasterization) TEST_F(ViewportTest, viewportTriggersGpuRasterization)
{ {
registerMockedHttpURLLoad("viewport/viewport-gpu-rasterization.html");
FrameTestHelpers::WebViewHelper webViewHelper; FrameTestHelpers::WebViewHelper webViewHelper;
registerMockedHttpURLLoad("viewport/viewport-gpu-rasterization-disabled-without-viewport.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-gpu-rasterization-disabled-without-viewport.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_FALSE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-gpu-rasterization.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-gpu-rasterization.html", true, nullptr, nullptr, nullptr, setViewportSettings); webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-gpu-rasterization.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480)); webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting()); EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
...@@ -2797,25 +2803,30 @@ TEST_F(ViewportTest, viewportTriggersGpuRasterization) ...@@ -2797,25 +2803,30 @@ TEST_F(ViewportTest, viewportTriggersGpuRasterization)
webViewHelper.webView()->resize(WebSize(640, 480)); webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting()); EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-inferred-values-do-not-trigger-gpu-rasterization.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-inferred-values-do-not-trigger-gpu-rasterization.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_FALSE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-1.html"); registerMockedHttpURLLoad("viewport/viewport-1.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-1.html", true, nullptr, nullptr, nullptr, setViewportSettings); webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-1.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480)); webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_FALSE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting()); EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-15.html"); registerMockedHttpURLLoad("viewport/viewport-15.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-15.html", true, nullptr, nullptr, nullptr, setViewportSettings); webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-15.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480)); webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_FALSE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting()); EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-130.html"); registerMockedHttpURLLoad("viewport/viewport-130.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-130.html", true, nullptr, nullptr, nullptr, setViewportSettings); webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-130.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480)); webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_FALSE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting()); EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-legacy-handheldfriendly.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-handheldfriendly.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized.html");
webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-handheldfriendly.html", true, nullptr, nullptr, nullptr, setViewportSettings);
webViewHelper.webView()->resize(WebSize(640, 480));
EXPECT_TRUE(webViewHelper.webViewImpl()->matchesHeuristicsForGpuRasterizationForTesting());
} }
class ConsoleMessageWebFrameClient : public FrameTestHelpers::TestWebFrameClient { class ConsoleMessageWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
......
<head>
<title>No viewport tag, no GPU rasterization trigger</title>
</head>
<body></body>
<head>
<title>Viewport that triggers GPU rasterization</title>
<meta name="viewport" content="width=device-width, minimum-scale=yes, initial-scale=yes, user-scalable=yes">
</head>
<body></body>
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