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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2127023002: Toggle GPU raster heuristics based on viewportEnabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3410 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 // Changes to page-scale during layout may require an additional frame. 3421 // Changes to page-scale during layout may require an additional frame.
3422 // We can't update the lifecycle here because we may be in the middle of lay out in the 3422 // We can't update the lifecycle here because we may be in the middle of lay out in the
3423 // caller of this method. 3423 // caller of this method.
3424 // TODO(chrishtr): clean all this up. All layout should happen in one lifecy cle run (crbug.com/578239). 3424 // TODO(chrishtr): clean all this up. All layout should happen in one lifecy cle run (crbug.com/578239).
3425 if (mainFrameImpl()->frameView()->needsLayout()) 3425 if (mainFrameImpl()->frameView()->needsLayout())
3426 mainFrameImpl()->frameWidget()->scheduleAnimation(); 3426 mainFrameImpl()->frameWidget()->scheduleAnimation();
3427 } 3427 }
3428 3428
3429 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription & description) 3429 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription & description)
3430 { 3430 {
3431 // If we're not reading the viewport meta tag, allow GPU rasterization.
3432 if (!settingsImpl()->viewportMetaEnabled()) {
3433 m_matchesHeuristicsForGpuRasterization = true;
3434 if (m_layerTreeView)
3435 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuri sticsForGpuRasterization);
3436 }
3437
3438 if (!page() || (!m_size.width && !m_size.height) || !page()->mainFrame()->is LocalFrame()) 3431 if (!page() || (!m_size.width && !m_size.height) || !page()->mainFrame()->is LocalFrame())
3439 return; 3432 return;
3440 3433
3441 if (!settings()->viewportEnabled()) { 3434 if (!settings()->viewportEnabled()) {
3442 pageScaleConstraintsSet().clearPageDefinedConstraints(); 3435 pageScaleConstraintsSet().clearPageDefinedConstraints();
3443 updateMainFrameLayoutSize(); 3436 updateMainFrameLayoutSize();
3437
3438 // If we don't support mobile viewports, allow GPU rasterization.
3439 m_matchesHeuristicsForGpuRasterization = true;
3440 if (m_layerTreeView)
3441 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuri sticsForGpuRasterization);
3444 return; 3442 return;
3445 } 3443 }
3446 3444
3447 Document* document = page()->deprecatedLocalMainFrame()->document(); 3445 Document* document = page()->deprecatedLocalMainFrame()->document();
3448 3446
3449 m_matchesHeuristicsForGpuRasterization = description.matchesHeuristicsForGpu Rasterization(); 3447 m_matchesHeuristicsForGpuRasterization = description.matchesHeuristicsForGpu Rasterization();
3450 if (m_layerTreeView) 3448 if (m_layerTreeView)
3451 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic sForGpuRasterization); 3449 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic sForGpuRasterization);
3452 3450
3453 Length defaultMinWidth = document->viewportDefaultMinWidth(); 3451 Length defaultMinWidth = document->viewportDefaultMinWidth();
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
4616 return nullptr; 4614 return nullptr;
4617 return focusedFrame; 4615 return focusedFrame;
4618 } 4616 }
4619 4617
4620 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4618 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4621 { 4619 {
4622 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4620 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4623 } 4621 }
4624 4622
4625 } // namespace blink 4623 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/ViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698