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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 #include "core/html/HTMLTextAreaElement.h" | 69 #include "core/html/HTMLTextAreaElement.h" |
70 #include "core/input/EventHandler.h" | 70 #include "core/input/EventHandler.h" |
71 #include "core/input/TouchActionUtil.h" | 71 #include "core/input/TouchActionUtil.h" |
72 #include "core/layout/LayoutPart.h" | 72 #include "core/layout/LayoutPart.h" |
73 #include "core/layout/LayoutView.h" | 73 #include "core/layout/LayoutView.h" |
74 #include "core/layout/TextAutosizer.h" | 74 #include "core/layout/TextAutosizer.h" |
75 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 75 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
76 #include "core/loader/DocumentLoader.h" | 76 #include "core/loader/DocumentLoader.h" |
77 #include "core/loader/FrameLoadRequest.h" | 77 #include "core/loader/FrameLoadRequest.h" |
78 #include "core/loader/FrameLoader.h" | 78 #include "core/loader/FrameLoader.h" |
79 #include "core/loader/FrameLoaderClient.h" | |
80 #include "core/page/ContextMenuController.h" | 79 #include "core/page/ContextMenuController.h" |
81 #include "core/page/ContextMenuProvider.h" | 80 #include "core/page/ContextMenuProvider.h" |
82 #include "core/page/DragController.h" | 81 #include "core/page/DragController.h" |
83 #include "core/page/DragData.h" | 82 #include "core/page/DragData.h" |
84 #include "core/page/DragSession.h" | 83 #include "core/page/DragSession.h" |
85 #include "core/page/FocusController.h" | 84 #include "core/page/FocusController.h" |
86 #include "core/page/FrameTree.h" | 85 #include "core/page/FrameTree.h" |
87 #include "core/page/Page.h" | 86 #include "core/page/Page.h" |
88 #include "core/page/PagePopupClient.h" | 87 #include "core/page/PagePopupClient.h" |
89 #include "core/page/PointerLockController.h" | 88 #include "core/page/PointerLockController.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 , m_recreatingGraphicsContext(false) | 449 , m_recreatingGraphicsContext(false) |
451 , m_flingModifier(0) | 450 , m_flingModifier(0) |
452 , m_flingSourceDevice(false) | 451 , m_flingSourceDevice(false) |
453 , m_fullscreenController(FullscreenController::create(this)) | 452 , m_fullscreenController(FullscreenController::create(this)) |
454 , m_showFPSCounter(false) | 453 , m_showFPSCounter(false) |
455 , m_continuousPaintingEnabled(false) | 454 , m_continuousPaintingEnabled(false) |
456 , m_baseBackgroundColor(Color::white) | 455 , m_baseBackgroundColor(Color::white) |
457 , m_backgroundColorOverride(Color::transparent) | 456 , m_backgroundColorOverride(Color::transparent) |
458 , m_zoomFactorOverride(0) | 457 , m_zoomFactorOverride(0) |
459 , m_userGestureObserved(false) | 458 , m_userGestureObserved(false) |
460 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) | |
461 , m_displayMode(WebDisplayModeBrowser) | 459 , m_displayMode(WebDisplayModeBrowser) |
462 , m_elasticOverscroll(FloatSize()) | 460 , m_elasticOverscroll(FloatSize()) |
463 { | 461 { |
464 Page::PageClients pageClients; | 462 Page::PageClients pageClients; |
465 pageClients.chromeClient = &m_chromeClientImpl; | 463 pageClients.chromeClient = &m_chromeClientImpl; |
466 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 464 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
467 pageClients.editorClient = &m_editorClientImpl; | 465 pageClients.editorClient = &m_editorClientImpl; |
468 pageClients.dragClient = &m_dragClientImpl; | 466 pageClients.dragClient = &m_dragClientImpl; |
469 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 467 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
470 | 468 |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 TRACE_EVENT0("blink", "WebViewImpl::layout"); | 1923 TRACE_EVENT0("blink", "WebViewImpl::layout"); |
1926 if (!mainFrameImpl()) | 1924 if (!mainFrameImpl()) |
1927 return; | 1925 return; |
1928 | 1926 |
1929 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); | 1927 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); |
1930 updateLayerTreeBackgroundColor(); | 1928 updateLayerTreeBackgroundColor(); |
1931 if (m_inspectorOverlay) | 1929 if (m_inspectorOverlay) |
1932 m_inspectorOverlay->layout(); | 1930 m_inspectorOverlay->layout(); |
1933 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 1931 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
1934 m_linkHighlights[i]->updateGeometry(); | 1932 m_linkHighlights[i]->updateGeometry(); |
1935 | |
1936 if (FrameView* view = mainFrameImpl()->frameView()) { | |
1937 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm
pty()) { | |
1938 m_shouldDispatchFirstVisuallyNonEmptyLayout = false; | |
1939 // TODO(esprehn): Move users of this callback to something | |
1940 // better, the heuristic for "visually non-empty" is bad. | |
1941 mainFrameImpl()->frame()->loader().client()->dispatchDidFirstVisuall
yNonEmptyLayout(); | |
1942 } | |
1943 } | |
1944 } | 1933 } |
1945 | 1934 |
1946 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) | 1935 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) |
1947 { | 1936 { |
1948 // This should only be used when compositing is not being used for this | 1937 // This should only be used when compositing is not being used for this |
1949 // WebView, and it is painting into the recording of its parent. | 1938 // WebView, and it is painting into the recording of its parent. |
1950 ASSERT(!isAcceleratedCompositingActive()); | 1939 ASSERT(!isAcceleratedCompositingActive()); |
1951 | 1940 |
1952 double paintStart = currentTime(); | 1941 double paintStart = currentTime(); |
1953 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai
nFrame()); | 1942 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai
nFrame()); |
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4197 m_layerTreeView->setVisible(visible); | 4186 m_layerTreeView->setVisible(visible); |
4198 } else { | 4187 } else { |
4199 m_rootGraphicsLayer = nullptr; | 4188 m_rootGraphicsLayer = nullptr; |
4200 m_rootLayer = nullptr; | 4189 m_rootLayer = nullptr; |
4201 m_rootTransformLayer = nullptr; | 4190 m_rootTransformLayer = nullptr; |
4202 // This means that we're transitioning to a new page. Suppress | 4191 // This means that we're transitioning to a new page. Suppress |
4203 // commits until Blink generates invalidations so we don't | 4192 // commits until Blink generates invalidations so we don't |
4204 // attempt to paint too early in the next page load. | 4193 // attempt to paint too early in the next page load. |
4205 m_layerTreeView->setDeferCommits(true); | 4194 m_layerTreeView->setDeferCommits(true); |
4206 m_layerTreeView->clearRootLayer(); | 4195 m_layerTreeView->clearRootLayer(); |
4207 m_shouldDispatchFirstVisuallyNonEmptyLayout = true; | |
4208 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV
iew); | 4196 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV
iew); |
4209 } | 4197 } |
4210 | 4198 |
4211 suppressInvalidations(false); | 4199 suppressInvalidations(false); |
4212 } | 4200 } |
4213 | 4201 |
4214 void WebViewImpl::invalidateRect(const IntRect& rect) | 4202 void WebViewImpl::invalidateRect(const IntRect& rect) |
4215 { | 4203 { |
4216 if (m_layerTreeView) | 4204 if (m_layerTreeView) |
4217 updateLayerTreeViewport(); | 4205 updateLayerTreeViewport(); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4512 if (m_pageColorOverlay) | 4500 if (m_pageColorOverlay) |
4513 m_pageColorOverlay->update(); | 4501 m_pageColorOverlay->update(); |
4514 if (m_inspectorOverlay) { | 4502 if (m_inspectorOverlay) { |
4515 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4503 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4516 if (inspectorPageOverlay) | 4504 if (inspectorPageOverlay) |
4517 inspectorPageOverlay->update(); | 4505 inspectorPageOverlay->update(); |
4518 } | 4506 } |
4519 } | 4507 } |
4520 | 4508 |
4521 } // namespace blink | 4509 } // namespace blink |
OLD | NEW |