[EFL][WK2] Fix cursor change detection in EwkViewImpl::setCursor()

https://bugs.webkit.org/show_bug.cgi?id=100662

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-10-29
Reviewed by Kenneth Rohde Christiansen.

Cursor change detection in EwkViewImpl::setCursor() relies on
addresses returned by Cursor::platformCursor(). However, the
value returned is currently assigned to a WKEinaSharedString
instead of a raw pointer. Therefore, the address is always
different and we keep recreating Evas Objects for the same
cursor.

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::EwkViewImpl):
(EwkViewImpl::setCursor): Call smartData() after same cursor
detection since it is not needed if the cursor has not changed
and it may affect performance.
* UIProcess/API/efl/EwkViewImpl.h:
(EwkViewImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 64359240
2012-10-29 Christophe Dumez <christophe.dumez@intel.com>
[EFL][WK2] Fix cursor change detection in EwkViewImpl::setCursor()
https://bugs.webkit.org/show_bug.cgi?id=100662
Reviewed by Kenneth Rohde Christiansen.
Cursor change detection in EwkViewImpl::setCursor() relies on
addresses returned by Cursor::platformCursor(). However, the
value returned is currently assigned to a WKEinaSharedString
instead of a raw pointer. Therefore, the address is always
different and we keep recreating Evas Objects for the same
cursor.
* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::EwkViewImpl):
(EwkViewImpl::setCursor): Call smartData() after same cursor
detection since it is not needed if the cursor has not changed
and it may affect performance.
* UIProcess/API/efl/EwkViewImpl.h:
(EwkViewImpl):
2012-10-29 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Coordinated Graphics: Make sure that we release images immediately when purging resources
......
......@@ -111,6 +111,7 @@ EwkViewImpl::EwkViewImpl(Evas_Object* view, PassRefPtr<Ewk_Context> context, Pas
, m_evasGlSurface(0)
#endif
, m_settings(Ewk_Settings::create(this))
, m_cursorGroup(0)
, m_mouseEventsEnabled(false)
#if ENABLE(TOUCH_EVENTS)
, m_touchEventsEnabled(false)
......@@ -187,13 +188,12 @@ WKPageRef EwkViewImpl::wkPage()
void EwkViewImpl::setCursor(const Cursor& cursor)
{
Ewk_View_Smart_Data* sd = smartData();
const char* group = cursor.platformCursor();
if (!group || group == m_cursorGroup)
return;
m_cursorGroup = group;
Ewk_View_Smart_Data* sd = smartData();
m_cursorObject = adoptRef(edje_object_add(sd->base.evas));
Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(sd->base.evas);
......
......@@ -260,7 +260,7 @@ private:
#endif
OwnPtr<Ewk_Settings> m_settings;
RefPtr<Evas_Object> m_cursorObject;
WKEinaSharedString m_cursorGroup;
const char* m_cursorGroup; // This is an address, do not free it or use WKEinaSharedString.
WKEinaSharedString m_faviconURL;
WKEinaSharedString m_url;
mutable WKEinaSharedString m_title;
......
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