| 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 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 if (canvas) { | 1827 if (canvas) { |
| 1828 // Clip rect to the confines of the rootLayerTexture. | 1828 // Clip rect to the confines of the rootLayerTexture. |
| 1829 IntRect resizeRect(rect); | 1829 IntRect resizeRect(rect); |
| 1830 resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeView->device
ViewportSize())); | 1830 resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeView->device
ViewportSize())); |
| 1831 doPixelReadbackToCanvas(canvas, resizeRect); | 1831 doPixelReadbackToCanvas(canvas, resizeRect); |
| 1832 } | 1832 } |
| 1833 } else { | 1833 } else { |
| 1834 FrameView* view = page()->mainFrame()->view(); | 1834 FrameView* view = page()->mainFrame()->view(); |
| 1835 PaintBehavior oldPaintBehavior = view->paintBehavior(); | 1835 PaintBehavior oldPaintBehavior = view->paintBehavior(); |
| 1836 if (isAcceleratedCompositingActive()) { | 1836 if (isAcceleratedCompositingActive()) { |
| 1837 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent);
| 1837 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); |
| 1838 view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompos
itingLayers); | 1838 view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompos
itingLayers); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 double paintStart = currentTime(); | 1841 double paintStart = currentTime(); |
| 1842 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, is
Transparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); | 1842 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, is
Transparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); |
| 1843 double paintEnd = currentTime(); | 1843 double paintEnd = currentTime(); |
| 1844 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStar
t); | 1844 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStar
t); |
| 1845 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa
intDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); | 1845 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa
intDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); |
| 1846 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa
intMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); | 1846 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa
intMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); |
| 1847 | 1847 |
| 1848 if (isAcceleratedCompositingActive()) { | 1848 if (isAcceleratedCompositingActive()) { |
| 1849 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent);
| 1849 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); |
| 1850 view->setPaintBehavior(oldPaintBehavior); | 1850 view->setPaintBehavior(oldPaintBehavior); |
| 1851 } | 1851 } |
| 1852 } | 1852 } |
| 1853 } | 1853 } |
| 1854 | 1854 |
| 1855 bool WebViewImpl::isTrackingRepaints() const | 1855 bool WebViewImpl::isTrackingRepaints() const |
| 1856 { | 1856 { |
| 1857 if (!page()) | 1857 if (!page()) |
| 1858 return false; | 1858 return false; |
| 1859 FrameView* view = page()->mainFrame()->view(); | 1859 FrameView* view = page()->mainFrame()->view(); |
| (...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4150 } | 4150 } |
| 4151 | 4151 |
| 4152 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4152 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4153 { | 4153 { |
| 4154 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); | 4154 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); |
| 4155 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom | 4155 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom |
| 4156 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); | 4156 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); |
| 4157 } | 4157 } |
| 4158 | 4158 |
| 4159 } // namespace WebKit | 4159 } // namespace WebKit |
| OLD | NEW |