Changeset 70098 in webkit
- Timestamp:
- Oct 19, 2010 3:48:18 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r70097 r70098 1 2010-10-19 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Coalesce plug-in drawing 6 https://bugs.webkit.org/show_bug.cgi?id=47939 7 8 Coalesce plug-in drawing in the same manner as we do it in the chunked update drawing area. 9 10 * PluginProcess/PluginControllerProxy.cpp: 11 (WebKit::PluginControllerProxy::PluginControllerProxy): 12 Initialize m_waitingForDidUpdate to false. 13 14 (WebKit::PluginControllerProxy::startPaintTimer): 15 Move code from invalidate out to here. Don't start the paint timer if m_waitingForDidUpdate is true. 16 17 (WebKit::PluginControllerProxy::invalidate): 18 Call startPaintTimer. 19 20 (WebKit::PluginControllerProxy::didUpdate): 21 Set m_waitingForDidUpdate to false and start the paint timer. 22 23 * PluginProcess/PluginControllerProxy.messages.in: 24 Add DidUpdate message. 25 26 * WebProcess/Plugins/PluginProxy.cpp: 27 (WebKit::PluginProxy::PluginProxy): 28 Initialize m_waitingForPaintInResponseToUpdate to false. 29 30 (WebKit::PluginProxy::paint): 31 If m_waitingForPaintInResponseToUpdate is true, send a DidUpdate message. 32 33 (WebKit::PluginProxy::update): 34 Set m_waitingForPaintInResponseToUpdate to true. 35 1 36 2010-10-19 Sam Weinig <sam@webkit.org> 2 37 -
trunk/WebKit2/PluginProcess/PluginControllerProxy.cpp
r68989 r70098 54 54 , m_isPrivateBrowsingEnabled(isPrivateBrowsingEnabled) 55 55 , m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint) 56 , m_waitingForDidUpdate(false) 56 57 { 57 58 } … … 103 104 } 104 105 106 void PluginControllerProxy::startPaintTimer() 107 { 108 // Check if we should start the timer. 109 110 if (m_dirtyRect.isEmpty()) 111 return; 112 113 // FIXME: Check clip rect. 114 115 if (m_paintTimer.isActive()) 116 return; 117 118 if (m_waitingForDidUpdate) 119 return; 120 121 // Start the timer. 122 m_paintTimer.startOneShot(0); 123 124 m_waitingForDidUpdate = true; 125 } 126 105 127 void PluginControllerProxy::invalidate(const IntRect& rect) 106 128 { … … 114 136 m_dirtyRect.unite(dirtyRect); 115 137 116 // Check if we should start the timer. 117 118 if (m_dirtyRect.isEmpty()) 119 return; 120 121 // FIXME: Check clip rect. 122 123 if (m_paintTimer.isActive()) 124 return; 125 126 // Start the timer. 127 m_paintTimer.startOneShot(0); 138 startPaintTimer(); 128 139 } 129 140 … … 286 297 } 287 298 299 void PluginControllerProxy::didUpdate() 300 { 301 m_waitingForDidUpdate = false; 302 startPaintTimer(); 303 } 304 288 305 #if PLATFORM(MAC) 289 306 void PluginControllerProxy::windowFocusChanged(bool hasFocus) -
trunk/WebKit2/PluginProcess/PluginControllerProxy.h
r68989 r70098 63 63 PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent, bool isPrivateBrowsingEnabled); 64 64 65 void startPaintTimer(); 65 66 void paint(); 66 67 … … 95 96 void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled); 96 97 void setFocus(bool); 98 void didUpdate(); 97 99 #if PLATFORM(MAC) 98 100 void windowFocusChanged(bool); … … 120 122 RunLoop::Timer<PluginControllerProxy> m_paintTimer; 121 123 124 // Whether we're waiting for the plug-in proxy in the web process to draw the contents of its 125 // backing store into the web process backing store. 126 bool m_waitingForDidUpdate; 127 122 128 // The backing store that this plug-in draws into. 123 129 RefPtr<BackingStore> m_backingStore; -
trunk/WebKit2/PluginProcess/PluginControllerProxy.messages.in
r68989 r70098 60 60 SetFocus(bool isFocused) 61 61 62 # Sent when the update requested by Update has been painted. 63 DidUpdate() 64 62 65 #if PLATFORM(MAC) 63 66 # Sent when the containing NSWindow's focus changes -
trunk/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r68989 r70098 59 59 , m_pluginController(0) 60 60 , m_isStarted(false) 61 61 , m_waitingForPaintInResponseToUpdate(false) 62 62 { 63 63 } … … 123 123 124 124 graphicsContext->restore(); 125 126 if (m_waitingForPaintInResponseToUpdate) { 127 m_waitingForPaintInResponseToUpdate = false; 128 m_connection->connection()->send(Messages::PluginControllerProxy::DidUpdate(), m_pluginInstanceID); 129 return; 130 } 125 131 } 126 132 … … 350 356 } 351 357 352 // Ask the controller to invalidate the rect for us. 358 // Ask the controller to invalidate the rect for us. 359 m_waitingForPaintInResponseToUpdate = true; 353 360 m_pluginController->invalidate(paintedRectPluginCoordinates); 354 361 } -
trunk/WebKit2/WebProcess/Plugins/PluginProxy.h
r68989 r70098 115 115 116 116 bool m_isStarted; 117 118 // Whether we're called invalidate in response to an update call, and are now waiting for a paint call. 119 bool m_waitingForPaintInResponseToUpdate; 117 120 }; 118 121
Note: See TracChangeset
for help on using the changeset viewer.