Title: [133046] trunk/Source/WebKit2
- Revision
- 133046
- Author
- [email protected]
- Date
- 2012-10-31 11:02:00 -0700 (Wed, 31 Oct 2012)
Log Message
[EFL][WK2][AC] Avoid storing dirty rects in a Vector inside EwkViewImpl
https://bugs.webkit.org/show_bug.cgi?id=100736
Patch by Christophe Dumez <[email protected]> on 2012-10-31
Reviewed by Kenneth Rohde Christiansen.
No longer store dirty rectangles in a temporary Vector and construct
a WebCore::Region directly from them instead. This avoid having to
iterate over the Vector in EwkViewImpl::displayTimerFired() to construct
a Region object, which should be more efficient.
* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::displayTimerFired):
(EwkViewImpl::redrawRegion):
* UIProcess/API/efl/EwkViewImpl.h:
(WebCore):
(EwkViewImpl):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (133045 => 133046)
--- trunk/Source/WebKit2/ChangeLog 2012-10-31 17:36:38 UTC (rev 133045)
+++ trunk/Source/WebKit2/ChangeLog 2012-10-31 18:02:00 UTC (rev 133046)
@@ -1,3 +1,22 @@
+2012-10-31 Christophe Dumez <[email protected]>
+
+ [EFL][WK2][AC] Avoid storing dirty rects in a Vector inside EwkViewImpl
+ https://bugs.webkit.org/show_bug.cgi?id=100736
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ No longer store dirty rectangles in a temporary Vector and construct
+ a WebCore::Region directly from them instead. This avoid having to
+ iterate over the Vector in EwkViewImpl::displayTimerFired() to construct
+ a Region object, which should be more efficient.
+
+ * UIProcess/API/efl/EwkViewImpl.cpp:
+ (EwkViewImpl::displayTimerFired):
+ (EwkViewImpl::redrawRegion):
+ * UIProcess/API/efl/EwkViewImpl.h:
+ (WebCore):
+ (EwkViewImpl):
+
2012-10-30 Anders Carlsson <[email protected]>
Connection::Client::didReceiveInvalidMessage should take the full message name
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp (133045 => 133046)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2012-10-31 17:36:38 UTC (rev 133045)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2012-10-31 18:02:00 UTC (rev 133046)
@@ -235,24 +235,21 @@
ecore_evas_object_cursor_set(ecoreEvas, cursorObject.release().leakRef(), EVAS_LAYER_MAX, hotspotX, hotspotY);
}
-void EwkViewImpl::displayTimerFired(WebCore::Timer<EwkViewImpl>*)
+void EwkViewImpl::displayTimerFired(Timer<EwkViewImpl>*)
{
Ewk_View_Smart_Data* sd = smartData();
if (!sd->image)
return;
- Region dirtyRegion;
- for (Vector<IntRect>::iterator it = m_dirtyRects.begin(); it != m_dirtyRects.end(); ++it)
- dirtyRegion.unite(*it);
+ ASSERT(m_dirtyRegion);
+ Vector<IntRect> rects = m_dirtyRegion->rects();
+ // Clear region.
+ m_dirtyRegion.clear();
- m_dirtyRects.clear();
-
- Vector<IntRect> rects = dirtyRegion.rects();
- Vector<IntRect>::iterator end = rects.end();
-
- for (Vector<IntRect>::iterator it = rects.begin(); it != end; ++it) {
- IntRect rect = *it;
+ Vector<IntRect>::const_iterator end = rects.end();
+ for (Vector<IntRect>::const_iterator it = rects.begin(); it != end; ++it) {
+ const IntRect& rect = *it;
#if USE(COORDINATED_GRAPHICS)
evas_gl_make_current(evasGL(), evasGLSurface(), evasGLContext());
m_pageViewportControllerClient->display(rect, IntPoint(sd->view.x, sd->view.y));
@@ -264,9 +261,14 @@
void EwkViewImpl::redrawRegion(const IntRect& rect)
{
+ if (m_dirtyRegion)
+ m_dirtyRegion->unite(rect);
+ else
+ m_dirtyRegion = adoptPtr(new Region(rect));
+
+ // Update display in the event loop.
if (!m_displayTimer.isActive())
m_displayTimer.startOneShot(0);
- m_dirtyRects.append(rect);
}
#if ENABLE(FULLSCREEN_API)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h (133045 => 133046)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h 2012-10-31 17:36:38 UTC (rev 133045)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h 2012-10-31 18:02:00 UTC (rev 133046)
@@ -65,6 +65,7 @@
class Cursor;
class IntRect;
class IntSize;
+class Region;
}
class Ewk_Back_Forward_List;
@@ -236,7 +237,7 @@
bool m_touchEventsEnabled;
#endif
WebCore::Timer<EwkViewImpl> m_displayTimer;
- WTF::Vector <WebCore::IntRect> m_dirtyRects;
+ OwnPtr<WebCore::Region> m_dirtyRegion;
OwnPtr<Ewk_Popup_Menu> m_popupMenu;
OwnPtr<WebKit::InputMethodContextEfl> m_inputMethodContext;
OwnPtr<Ewk_Color_Picker> m_colorPicker;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes