Commit 167f4cf2 authored by andersca@apple.com's avatar andersca@apple.com

Slow/beachballing when using the find bar on a page with plug-ins

https://bugs.webkit.org/show_bug.cgi?id=114990
<rdar://problem/12832313>

Reviewed by Tim Horton.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::notifyWidget):
Call shouldCreateTransientPaintingSnapshot().

(WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
Don't create a painting snapshot if we're asked to paint the find indicator.

* WebProcess/Plugins/PluginView.h:
Add new member function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent aaac0aed
2013-04-22 Anders Carlsson <andersca@apple.com>
Slow/beachballing when using the find bar on a page with plug-ins
https://bugs.webkit.org/show_bug.cgi?id=114990
<rdar://problem/12832313>
Reviewed by Tim Horton.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::notifyWidget):
Call shouldCreateTransientPaintingSnapshot().
(WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
Don't create a painting snapshot if we're asked to paint the find indicator.
* WebProcess/Plugins/PluginView.h:
Add new member function.
2013-04-22 Alexey Proskuryakov <ap@apple.com>
<rdar://problem/13334446> [Mac] Tweak sandbox profiles.
......@@ -929,7 +929,7 @@ void PluginView::notifyWidget(WidgetNotification notification)
{
switch (notification) {
case WillPaintFlattened:
if (m_plugin && m_isInitialized)
if (shouldCreateTransientPaintingSnapshot())
m_transientPaintingSnapshot = m_plugin->snapshot();
break;
case DidPaintFlattened:
......@@ -1672,4 +1672,23 @@ void PluginView::pluginDidReceiveUserInteraction()
m_didReceiveUserInteraction = true;
}
bool PluginView::shouldCreateTransientPaintingSnapshot() const
{
if (!m_plugin)
return false;
if (!m_isInitialized)
return false;
if (FrameView* frameView = frame()->view()) {
if (frameView->paintBehavior() & (PaintBehaviorSelectionOnly | PaintBehaviorForceBlackText)) {
// This paint behavior is used when drawing the find indicator and there's no need to
// snapshot plug-ins, because they can never be painted as part of the find indicator.
return false;
}
}
return true;
}
} // namespace WebKit
......@@ -135,6 +135,8 @@ private:
void pluginSnapshotTimerFired(WebCore::DeferrableOneShotTimer<PluginView>*);
void pluginDidReceiveUserInteraction();
bool shouldCreateTransientPaintingSnapshot() const;
// WebCore::PluginViewBase
#if PLATFORM(MAC)
virtual PlatformLayer* platformLayer() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment