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 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1826 if (canvas) { | 1826 if (canvas) { |
| 1827 // Clip rect to the confines of the rootLayerTexture. | 1827 // Clip rect to the confines of the rootLayerTexture. |
| 1828 IntRect resizeRect(rect); | 1828 IntRect resizeRect(rect); |
| 1829 resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeView->device ViewportSize())); | 1829 resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeView->device ViewportSize())); |
| 1830 doPixelReadbackToCanvas(canvas, resizeRect); | 1830 doPixelReadbackToCanvas(canvas, resizeRect); |
| 1831 } | 1831 } |
| 1832 } else { | 1832 } else { |
| 1833 FrameView* view = page()->mainFrame()->view(); | 1833 FrameView* view = page()->mainFrame()->view(); |
| 1834 PaintBehavior oldPaintBehavior = view->paintBehavior(); | 1834 PaintBehavior oldPaintBehavior = view->paintBehavior(); |
| 1835 if (isAcceleratedCompositingActive()) { | 1835 if (isAcceleratedCompositingActive()) { |
| 1836 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); | 1836 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); |
| 1837 view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompos itingLayers); | 1837 view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompos itingLayers); |
| 1838 } | 1838 } |
| 1839 | 1839 |
| 1840 double paintStart = currentTime(); | 1840 double paintStart = currentTime(); |
| 1841 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, is Transparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); | 1841 PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, is Transparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); |
| 1842 double paintEnd = currentTime(); | 1842 double paintEnd = currentTime(); |
| 1843 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStar t); | 1843 double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStar t); |
| 1844 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa intDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); | 1844 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa intDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); |
| 1845 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa intMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); | 1845 WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePa intMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); |
| 1846 | 1846 |
| 1847 if (isAcceleratedCompositingActive()) { | 1847 if (isAcceleratedCompositingActive()) { |
| 1848 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); | 1848 ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); |
| 1849 view->setPaintBehavior(oldPaintBehavior); | 1849 view->setPaintBehavior(oldPaintBehavior); |
| 1850 } | 1850 } |
| 1851 } | 1851 } |
| 1852 } | 1852 } |
| 1853 | 1853 |
| 1854 bool WebViewImpl::isTrackingRepaints() const | 1854 bool WebViewImpl::isTrackingRepaints() const |
| 1855 { | 1855 { |
| 1856 if (!page()) | 1856 if (!page()) |
| 1857 return false; | 1857 return false; |
| 1858 FrameView* view = page()->mainFrame()->view(); | 1858 FrameView* view = page()->mainFrame()->view(); |
| (...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3376 if (!(dropEffect & dragData.draggingSourceOperationMask())) | 3376 if (!(dropEffect & dragData.draggingSourceOperationMask())) |
| 3377 dropEffect = DragOperationNone; | 3377 dropEffect = DragOperationNone; |
| 3378 | 3378 |
| 3379 m_dragOperation = static_cast<WebDragOperation>(dropEffect); | 3379 m_dragOperation = static_cast<WebDragOperation>(dropEffect); |
| 3380 | 3380 |
| 3381 return m_dragOperation; | 3381 return m_dragOperation; |
| 3382 } | 3382 } |
| 3383 | 3383 |
| 3384 void WebViewImpl::sendResizeEventAndRepaint() | 3384 void WebViewImpl::sendResizeEventAndRepaint() |
| 3385 { | 3385 { |
| 3386 if (mainFrameImpl()->frameView()) { | 3386 // FIXME: This is wrong. The FrameView is responsible sending a resizeEvent |
| 3387 // Enqueues the resize event. | 3387 // as part of layout. Layout is also responsible for sending invalidations |
| 3388 mainFrameImpl()->frame()->eventHandler()->sendResizeEvent(); | 3388 // to the embedder. This method and all callers may be wrong. |
| 3389 } | 3389 // This method used to send a resizeEvent, presumably in compensation for |
| 3390 // layout() being supressed for the first 250ms and thus not always sending | |
| 3391 // repaintEvents for the initial layout. | |
| 3390 | 3392 |
| 3393 // This paint invalidation should not be necessary, but won't harm anything either. | |
|
esprehn
2013/07/25 01:15:34
FIXME
| |
| 3391 if (m_client) { | 3394 if (m_client) { |
| 3392 if (isAcceleratedCompositingActive()) { | 3395 if (isAcceleratedCompositingActive()) { |
| 3393 updateLayerTreeViewport(); | 3396 updateLayerTreeViewport(); |
| 3394 } else { | 3397 } else { |
| 3395 WebRect damagedRect(0, 0, m_size.width, m_size.height); | 3398 WebRect damagedRect(0, 0, m_size.width, m_size.height); |
| 3396 m_client->didInvalidateRect(damagedRect); | 3399 m_client->didInvalidateRect(damagedRect); |
| 3397 } | 3400 } |
| 3398 } | 3401 } |
| 3402 // Unclear what this is doing. Callers may actually need this code. | |
|
esprehn
2013/07/25 01:15:34
FIXME:
| |
| 3399 if (m_pageOverlays) | 3403 if (m_pageOverlays) |
| 3400 m_pageOverlays->update(); | 3404 m_pageOverlays->update(); |
| 3401 } | 3405 } |
| 3402 | 3406 |
| 3403 void WebViewImpl::configureAutoResizeMode() | 3407 void WebViewImpl::configureAutoResizeMode() |
| 3404 { | 3408 { |
| 3405 if (!mainFrameImpl() || !mainFrameImpl()->frame() || !mainFrameImpl()->frame ()->view()) | 3409 if (!mainFrameImpl() || !mainFrameImpl()->frame() || !mainFrameImpl()->frame ()->view()) |
| 3406 return; | 3410 return; |
| 3407 | 3411 |
| 3408 mainFrameImpl()->frame()->view()->enableAutoSizeMode(m_shouldAutoResize, m_m inAutoSize, m_maxAutoSize); | 3412 mainFrameImpl()->frame()->view()->enableAutoSizeMode(m_shouldAutoResize, m_m inAutoSize, m_maxAutoSize); |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4144 } | 4148 } |
| 4145 | 4149 |
| 4146 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4150 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4147 { | 4151 { |
| 4148 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); | 4152 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); |
| 4149 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom | 4153 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom |
| 4150 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); | 4154 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); |
| 4151 } | 4155 } |
| 4152 | 4156 |
| 4153 } // namespace WebKit | 4157 } // namespace WebKit |
| OLD | NEW |