Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 1774653002: Decouple scheduling animation of webview plugins from layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 namespace blink { 103 namespace blink {
104 104
105 // Public methods -------------------------------------------------------------- 105 // Public methods --------------------------------------------------------------
106 106
107 void WebPluginContainerImpl::setFrameRect(const IntRect& frameRect) 107 void WebPluginContainerImpl::setFrameRect(const IntRect& frameRect)
108 { 108 {
109 Widget::setFrameRect(frameRect); 109 Widget::setFrameRect(frameRect);
110 } 110 }
111 111
112 void WebPluginContainerImpl::layoutIfNeeded() 112 void WebPluginContainerImpl::updateAllLifecyclePhases()
113 { 113 {
114 if (!m_webPlugin) 114 if (!m_webPlugin)
115 return; 115 return;
116 116
117 m_webPlugin->layoutIfNeeded(); 117 m_webPlugin->updateAllLifecyclePhases();
118 } 118 }
119 119
120 void WebPluginContainerImpl::paint(GraphicsContext& context, const CullRect& cul lRect) const 120 void WebPluginContainerImpl::paint(GraphicsContext& context, const CullRect& cul lRect) const
121 { 121 {
122 if (!parent()) 122 if (!parent())
123 return; 123 return;
124 124
125 // Don't paint anything if the plugin doesn't intersect. 125 // Don't paint anything if the plugin doesn't intersect.
126 if (!cullRect.intersectsCullRect(frameRect())) 126 if (!cullRect.intersectsCullRect(frameRect()))
127 return; 127 return;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 void WebPluginContainerImpl::invalidateRect(const WebRect& rect) 419 void WebPluginContainerImpl::invalidateRect(const WebRect& rect)
420 { 420 {
421 invalidateRect(static_cast<IntRect>(rect)); 421 invalidateRect(static_cast<IntRect>(rect));
422 } 422 }
423 423
424 void WebPluginContainerImpl::scrollRect(const WebRect& rect) 424 void WebPluginContainerImpl::scrollRect(const WebRect& rect)
425 { 425 {
426 invalidateRect(rect); 426 invalidateRect(rect);
427 } 427 }
428 428
429 void WebPluginContainerImpl::setNeedsLayout() 429 void WebPluginContainerImpl::scheduleAnimation()
430 { 430 {
431 if (m_element->layoutObject()) 431 if (auto* frameView = m_element->document().view())
432 m_element->layoutObject()->setNeedsLayoutAndFullPaintInvalidation("Plugi n needs layout"); 432 frameView->scheduleAnimation();
433 } 433 }
434 434
435 void WebPluginContainerImpl::reportGeometry() 435 void WebPluginContainerImpl::reportGeometry()
436 { 436 {
437 // We cannot compute geometry without a parent or layoutObject. 437 // We cannot compute geometry without a parent or layoutObject.
438 if (!parent() || !m_element || !m_element->layoutObject()) 438 if (!parent() || !m_element || !m_element->layoutObject())
439 return; 439 return;
440 440
441 IntRect windowRect, clipRect, unobscuredRect; 441 IntRect windowRect, clipRect, unobscuredRect;
442 Vector<IntRect> cutOutRects; 442 Vector<IntRect> cutOutRects;
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 // frame view. 977 // frame view.
978 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 978 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
979 } 979 }
980 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 980 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
981 // Convert to the plugin position. 981 // Convert to the plugin position.
982 for (size_t i = 0; i < cutOutRects.size(); i++) 982 for (size_t i = 0; i < cutOutRects.size(); i++)
983 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 983 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
984 } 984 }
985 985
986 } // namespace blink 986 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698