Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 3952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3963 m_client->didDeactivateCompositor(); | 3963 m_client->didDeactivateCompositor(); |
| 3964 m_compositorCreationFailed = true; | 3964 m_compositorCreationFailed = true; |
| 3965 } | 3965 } |
| 3966 } | 3966 } |
| 3967 if (page()) | 3967 if (page()) |
| 3968 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin gActive); | 3968 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin gActive); |
| 3969 } | 3969 } |
| 3970 | 3970 |
| 3971 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll) | 3971 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll) |
| 3972 { | 3972 { |
| 3973 TRACE_EVENT1("impl-scroll", | |
|
enne (OOO)
2013/08/22 20:54:30
Should this go after the early outs?
| |
| 3974 "WebViewImpl::updateMainFrameScrollPosition", | |
| 3975 "programmatic", programmaticScroll); | |
| 3976 | |
| 3973 FrameView* frameView = page()->mainFrame()->view(); | 3977 FrameView* frameView = page()->mainFrame()->view(); |
| 3974 if (!frameView) | 3978 if (!frameView) |
| 3975 return; | 3979 return; |
| 3976 | 3980 |
| 3977 if (frameView->scrollPosition() == scrollPosition) | 3981 if (frameView->scrollPosition() == scrollPosition) |
| 3978 return; | 3982 return; |
| 3979 | 3983 |
| 3980 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); | 3984 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); |
| 3981 frameView->setInProgrammaticScroll(programmaticScroll); | 3985 frameView->setInProgrammaticScroll(programmaticScroll); |
| 3982 frameView->notifyScrollPositionChanged(scrollPosition); | 3986 frameView->notifyScrollPositionChanged(scrollPosition); |
| 3983 frameView->setInProgrammaticScroll(oldProgrammaticScroll); | 3987 frameView->setInProgrammaticScroll(oldProgrammaticScroll); |
| 3984 } | 3988 } |
| 3985 | 3989 |
| 3986 void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal eDelta) | 3990 void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal eDelta) |
| 3987 { | 3991 { |
| 3988 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3992 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 3989 return; | 3993 return; |
| 3990 | 3994 |
| 3991 if (pageScaleDelta == 1) { | 3995 if (pageScaleDelta == 1) { |
| 3992 TRACE_EVENT_INSTANT2("webkit", "WebViewImpl::applyScrollAndScale::scroll By", "x", scrollDelta.width, "y", scrollDelta.height); | 3996 TRACE_EVENT_INSTANT2("webkit,impl-scroll", "WebViewImpl::applyScrollAndS cale::scrollBy", "x", scrollDelta.width, "y", scrollDelta.height); |
|
enne (OOO)
2013/08/22 20:54:30
Aren't you tracing updateMainFrameScrollPosition t
| |
| 3993 WebSize webScrollOffset = mainFrame()->scrollOffset(); | 3997 WebSize webScrollOffset = mainFrame()->scrollOffset(); |
| 3994 IntPoint scrollOffset(webScrollOffset.width + scrollDelta.width, webScro llOffset.height + scrollDelta.height); | 3998 IntPoint scrollOffset(webScrollOffset.width + scrollDelta.width, webScro llOffset.height + scrollDelta.height); |
| 3995 updateMainFrameScrollPosition(scrollOffset, false); | 3999 updateMainFrameScrollPosition(scrollOffset, false); |
| 3996 } else { | 4000 } else { |
| 3997 // The page scale changed, so apply a scale and scroll in a single | 4001 // The page scale changed, so apply a scale and scroll in a single |
| 3998 // operation. | 4002 // operation. |
| 3999 WebSize scrollOffset = mainFrame()->scrollOffset(); | 4003 WebSize scrollOffset = mainFrame()->scrollOffset(); |
| 4000 scrollOffset.width += scrollDelta.width; | 4004 scrollOffset.width += scrollDelta.width; |
| 4001 scrollOffset.height += scrollDelta.height; | 4005 scrollOffset.height += scrollDelta.height; |
| 4002 | 4006 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4124 } | 4128 } |
| 4125 | 4129 |
| 4126 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4130 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4127 { | 4131 { |
| 4128 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); | 4132 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); |
| 4129 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom | 4133 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom |
| 4130 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); | 4134 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); |
| 4131 } | 4135 } |
| 4132 | 4136 |
| 4133 } // namespace WebKit | 4137 } // namespace WebKit |
| OLD | NEW |