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 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1813 IntSize(), 0, false, false, false, false, | 1813 IntSize(), 0, false, false, false, false, |
1814 0, 0, 0, 0); | 1814 0, 0, 0, 0); |
1815 | 1815 |
1816 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); | 1816 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); |
1817 } | 1817 } |
1818 } | 1818 } |
1819 | 1819 |
1820 if (!m_page) | 1820 if (!m_page) |
1821 return; | 1821 return; |
1822 | 1822 |
1823 PageWidgetDelegate::animate(m_page.get(), validFrameTime.lastFrameTimeMonoto
nic); | 1823 PageWidgetDelegate::animate(m_page.get(), validFrameTime.lastFrameTimeMonoto
nic, m_page->deprecatedLocalMainFrame()); |
1824 | 1824 |
1825 if (m_continuousPaintingEnabled) { | 1825 if (m_continuousPaintingEnabled) { |
1826 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageO
verlays.get()); | 1826 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageO
verlays.get()); |
1827 m_client->scheduleAnimation(); | 1827 m_client->scheduleAnimation(); |
1828 } | 1828 } |
1829 } | 1829 } |
1830 | 1830 |
1831 void WebViewImpl::didCommitFrameToCompositor() | 1831 void WebViewImpl::didCommitFrameToCompositor() |
1832 { | 1832 { |
1833 Scheduler::shared()->didCommitFrameToCompositor(); | 1833 Scheduler::shared()->didCommitFrameToCompositor(); |
(...skipping 15 matching lines...) Expand all Loading... |
1849 m_devToolsAgent->didLayout(); | 1849 m_devToolsAgent->didLayout(); |
1850 } | 1850 } |
1851 | 1851 |
1852 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) | 1852 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) |
1853 { | 1853 { |
1854 // This should only be used when compositing is not being used for this | 1854 // This should only be used when compositing is not being used for this |
1855 // WebView, and it is painting into the recording of its parent. | 1855 // WebView, and it is painting into the recording of its parent. |
1856 ASSERT(!isAcceleratedCompositingActive()); | 1856 ASSERT(!isAcceleratedCompositingActive()); |
1857 | 1857 |
1858 double paintStart = currentTime(); | 1858 double paintStart = currentTime(); |
1859 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTran
sparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); | 1859 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTran
sparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque, m_page
->deprecatedLocalMainFrame()); |
1860 double paintEnd = currentTime(); | 1860 double paintEnd = currentTime(); |
1861 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart); | 1861 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart); |
1862 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationM
S", (paintEnd - paintStart) * 1000, 0, 120, 30); | 1862 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationM
S", (paintEnd - paintStart) * 1000, 0, 120, 30); |
1863 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintMegapixPe
rSecond", pixelsPerSec / 1000000, 10, 210, 30); | 1863 Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintMegapixPe
rSecond", pixelsPerSec / 1000000, 10, 210, 30); |
1864 } | 1864 } |
1865 | 1865 |
1866 #if OS(ANDROID) | 1866 #if OS(ANDROID) |
1867 void WebViewImpl::paintCompositedDeprecated(WebCanvas* canvas, const WebRect& re
ct) | 1867 void WebViewImpl::paintCompositedDeprecated(WebCanvas* canvas, const WebRect& re
ct) |
1868 { | 1868 { |
1869 // Note: This method exists on OS(ANDROID) and will hopefully be | 1869 // Note: This method exists on OS(ANDROID) and will hopefully be |
1870 // removed once the link disambiguation feature renders using | 1870 // removed once the link disambiguation feature renders using |
1871 // the compositor. | 1871 // the compositor. |
1872 ASSERT(isAcceleratedCompositingActive()); | 1872 ASSERT(isAcceleratedCompositingActive()); |
1873 | 1873 |
1874 FrameView* view = page()->deprecatedLocalMainFrame()->view(); | 1874 FrameView* view = page()->deprecatedLocalMainFrame()->view(); |
1875 PaintBehavior oldPaintBehavior = view->paintBehavior(); | 1875 PaintBehavior oldPaintBehavior = view->paintBehavior(); |
1876 view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLay
ers); | 1876 view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLay
ers); |
1877 | 1877 |
1878 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTran
sparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); | 1878 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTran
sparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque, m_page
->deprecatedLocalMainFrame()); |
1879 | 1879 |
1880 view->setPaintBehavior(oldPaintBehavior); | 1880 view->setPaintBehavior(oldPaintBehavior); |
1881 } | 1881 } |
1882 #endif | 1882 #endif |
1883 | 1883 |
1884 void WebViewImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback
* callback) | 1884 void WebViewImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback
* callback) |
1885 { | 1885 { |
1886 ASSERT(isAcceleratedCompositingActive()); | 1886 ASSERT(isAcceleratedCompositingActive()); |
1887 m_layerTreeView->compositeAndReadbackAsync(callback); | 1887 m_layerTreeView->compositeAndReadbackAsync(callback); |
1888 } | 1888 } |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2059 default: | 2059 default: |
2060 ASSERT_NOT_REACHED(); | 2060 ASSERT_NOT_REACHED(); |
2061 } | 2061 } |
2062 | 2062 |
2063 node->dispatchMouseEvent( | 2063 node->dispatchMouseEvent( |
2064 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast<
const WebMouseEvent&>(inputEvent)), | 2064 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast<
const WebMouseEvent&>(inputEvent)), |
2065 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; | 2065 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; |
2066 return true; | 2066 return true; |
2067 } | 2067 } |
2068 | 2068 |
2069 return PageWidgetDelegate::handleInputEvent(m_page.get(), *this, inputEvent)
; | 2069 return PageWidgetDelegate::handleInputEvent(m_page.get(), *this, inputEvent,
m_page->deprecatedLocalMainFrame()); |
2070 } | 2070 } |
2071 | 2071 |
2072 void WebViewImpl::setCursorVisibilityState(bool isVisible) | 2072 void WebViewImpl::setCursorVisibilityState(bool isVisible) |
2073 { | 2073 { |
2074 if (m_page) | 2074 if (m_page) |
2075 m_page->setIsCursorVisible(isVisible); | 2075 m_page->setIsCursorVisible(isVisible); |
2076 } | 2076 } |
2077 | 2077 |
2078 void WebViewImpl::mouseCaptureLost() | 2078 void WebViewImpl::mouseCaptureLost() |
2079 { | 2079 { |
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4385 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4385 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4386 | 4386 |
4387 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4387 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4388 return false; | 4388 return false; |
4389 | 4389 |
4390 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4390 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4391 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4391 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4392 } | 4392 } |
4393 | 4393 |
4394 } // namespace blink | 4394 } // namespace blink |
OLD | NEW |