| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 accumulateLayerRectList(compositor, graphicsLayer->children()[i], rects)
; | 1357 accumulateLayerRectList(compositor, graphicsLayer->children()[i], rects)
; |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 PassRefPtr<LayerRectList> Internals::touchEventTargetLayerRects(Document* docume
nt, ExceptionState& es) | 1360 PassRefPtr<LayerRectList> Internals::touchEventTargetLayerRects(Document* docume
nt, ExceptionState& es) |
| 1361 { | 1361 { |
| 1362 if (!document || !document->view() || !document->page() || document != conte
xtDocument()) { | 1362 if (!document || !document->view() || !document->page() || document != conte
xtDocument()) { |
| 1363 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | 1363 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 1364 return 0; | 1364 return 0; |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1367 // Do any pending layout and compositing update (which may call touchEventTa
rgetRectsChange) to ensure this | 1367 // Do any pending layouts (which may call touchEventTargetRectsChange) to en
sure this |
| 1368 // really takes any previous changes into account. | 1368 // really takes any previous changes into account. |
| 1369 forceCompositingUpdate(document, es); | 1369 document->updateLayout(); |
| 1370 if (es.hadException()) | |
| 1371 return 0; | |
| 1372 | 1370 |
| 1373 if (RenderView* view = document->renderView()) { | 1371 if (RenderView* view = document->renderView()) { |
| 1374 if (RenderLayerCompositor* compositor = view->compositor()) { | 1372 if (RenderLayerCompositor* compositor = view->compositor()) { |
| 1375 if (GraphicsLayer* rootLayer = compositor->rootGraphicsLayer()) { | 1373 if (GraphicsLayer* rootLayer = compositor->rootGraphicsLayer()) { |
| 1376 RefPtr<LayerRectList> rects = LayerRectList::create(); | 1374 RefPtr<LayerRectList> rects = LayerRectList::create(); |
| 1377 accumulateLayerRectList(compositor, rootLayer, rects.get()); | 1375 accumulateLayerRectList(compositor, rootLayer, rects.get()); |
| 1378 return rects; | 1376 return rects; |
| 1379 } | 1377 } |
| 1380 } | 1378 } |
| 1381 } | 1379 } |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 return String(); | 1820 return String(); |
| 1823 } | 1821 } |
| 1824 | 1822 |
| 1825 String Internals::mainThreadScrollingReasons(Document* document, ExceptionState&
es) const | 1823 String Internals::mainThreadScrollingReasons(Document* document, ExceptionState&
es) const |
| 1826 { | 1824 { |
| 1827 if (!document || !document->frame()) { | 1825 if (!document || !document->frame()) { |
| 1828 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | 1826 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 1829 return String(); | 1827 return String(); |
| 1830 } | 1828 } |
| 1831 | 1829 |
| 1832 // Force a re-layout and a compositing update. | |
| 1833 document->updateLayout(); | |
| 1834 RenderView* view = document->renderView(); | |
| 1835 if (view->compositor()) | |
| 1836 view->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDe
ferredWork); | |
| 1837 | |
| 1838 Page* page = document->page(); | 1830 Page* page = document->page(); |
| 1839 if (!page) | 1831 if (!page) |
| 1840 return String(); | 1832 return String(); |
| 1841 | 1833 |
| 1842 return page->mainThreadScrollingReasonsAsText(); | 1834 return page->mainThreadScrollingReasonsAsText(); |
| 1843 } | 1835 } |
| 1844 | 1836 |
| 1845 PassRefPtr<ClientRectList> Internals::nonFastScrollableRects(Document* document,
ExceptionState& es) const | 1837 PassRefPtr<ClientRectList> Internals::nonFastScrollableRects(Document* document,
ExceptionState& es) const |
| 1846 { | 1838 { |
| 1847 if (!document || !document->frame()) { | 1839 if (!document || !document->frame()) { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2255 if (!sharedContext) | 2247 if (!sharedContext) |
| 2256 return false; | 2248 return false; |
| 2257 sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEX
T_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); | 2249 sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEX
T_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); |
| 2258 // To prevent tests that call loseSharedGraphicsContext3D from being | 2250 // To prevent tests that call loseSharedGraphicsContext3D from being |
| 2259 // flaky, we call finish so that the context is guaranteed to be lost | 2251 // flaky, we call finish so that the context is guaranteed to be lost |
| 2260 // synchronously (i.e. before returning). | 2252 // synchronously (i.e. before returning). |
| 2261 sharedContext->finish(); | 2253 sharedContext->finish(); |
| 2262 return true; | 2254 return true; |
| 2263 } | 2255 } |
| 2264 | 2256 |
| 2265 void Internals::forceCompositingUpdate(Document* document, ExceptionState& es) | |
| 2266 { | |
| 2267 if (!document || !document->renderView()) { | |
| 2268 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | |
| 2269 return; | |
| 2270 } | |
| 2271 | |
| 2272 document->updateLayout(); | |
| 2273 | |
| 2274 RenderView* view = document->renderView(); | |
| 2275 if (view->compositor()) | |
| 2276 view->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDe
ferredWork); | |
| 2277 } | 2257 } |
| 2278 | |
| 2279 } | |
| OLD | NEW |