RESOLVED FIXED 115896
[BlackBerry] Use requestAnimationFrame for animations
https://bugs.webkit.org/show_bug.cgi?id=115896
Summary [BlackBerry] Use requestAnimationFrame for animations
Carlos Garcia Campos
Reported 2013-05-10 03:42:34 PDT
This way we don't need the changes proposed in bug #114501 to get 60fps in the BlackBerry port.
Attachments
Patch (8.09 KB, patch)
2013-05-10 03:48 PDT, Carlos Garcia Campos
no flags
Updated patch (7.97 KB, patch)
2013-05-10 05:12 PDT, Carlos Garcia Campos
no flags
Updated patch (8.24 KB, patch)
2013-05-13 03:35 PDT, Carlos Garcia Campos
no flags
Another update (8.12 KB, patch)
2013-05-13 03:45 PDT, Carlos Garcia Campos
no flags
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (1.25 MB, application/zip)
2013-05-13 17:28 PDT, Build Bot
no flags
Carlos Garcia Campos
Comment 1 2013-05-10 03:48:40 PDT
Arvid Nilsson
Comment 2 2013-05-10 04:03:57 PDT
Comment on attachment 201330 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=201330&action=review The only call that will happen on a non-UI thread is animationFrameChanged(), perhaps we can invent a "weak" synchronization scheme similar to void WebPagePrivate::updateDelegatedOverlays(bool duringCommit, bool dispatched) to avoid using a mutex. > Source/WebKit/blackberry/Api/WebPage.cpp:6333 > + BlackBerry::Platform::AnimationFrameRateController::instance()->lockMutex(); Since addClient() already locks/unlocks the internal mutex, is this external lock/unlock pair really necessary? Perhaps it tries to use the mutex to protect m_isRunningRefreshAnimationClient, since stopRefreshAnimationClient is sometimes called on the UI thread (when it's called from animationFrameChanged)?
Carlos Garcia Campos
Comment 3 2013-05-10 04:10:27 PDT
(In reply to comment #2) > (From update of attachment 201330 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=201330&action=review > > The only call that will happen on a non-UI thread is animationFrameChanged(), perhaps we can invent a "weak" synchronization scheme similar to void WebPagePrivate::updateDelegatedOverlays(bool duringCommit, bool dispatched) to avoid using a mutex. > > > Source/WebKit/blackberry/Api/WebPage.cpp:6333 > > + BlackBerry::Platform::AnimationFrameRateController::instance()->lockMutex(); > > Since addClient() already locks/unlocks the internal mutex, is this external lock/unlock pair really necessary? Perhaps it tries to use the mutex to protect m_isRunningRefreshAnimationClient, since stopRefreshAnimationClient is sometimes called on the UI thread (when it's called from animationFrameChanged)? I took this approach from the BlackBerry::Platform::AnimationBase implementation, but I think the mutex in this case is to call frameChanged with the lock, so maybe we don't need it here.
Carlos Garcia Campos
Comment 4 2013-05-10 05:12:38 PDT
Created attachment 201336 [details] Updated patch Removed the mutexes and added early return in scheduleAnimation
Arvid Nilsson
Comment 5 2013-05-10 05:30:00 PDT
Comment on attachment 201336 [details] Updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=201336&action=review > Source/WebKit/blackberry/Api/WebPage.cpp:6312 > +void WebPagePrivate::animationFrameChanged() Now to be sure there are memory barriers all over the place (when dispatching messages, locking mutexes etc) but just looking at these two methods in isolation... > Source/WebKit/blackberry/Api/WebPage.cpp:6329 > +} In the complete absence of memory barriers, scheduleAnimation() could set m_animationScheduled to true on Core 1, but that change is not synced over to Core 2, and when core 2 executes animationFrameChanged(), it will just stop and return.
Arvid Nilsson
Comment 6 2013-05-10 05:33:07 PDT
there's also a "one shot" mode of operation for AnimationFrameRateController that might be more appropriate for the RAF usage, see WebPageCompositorPrivate for an example of one shot AFRClient When useing the one shot flavour, you don't have to manually remove yourself
Andrew Lo
Comment 7 2013-05-10 09:16:49 PDT
Comment on attachment 201336 [details] Updated patch looks good to me
Carlos Garcia Campos
Comment 8 2013-05-13 03:35:22 PDT
Created attachment 201542 [details] Updated patch Added a mutex following the same approach as DisplayRefreshMonitor
Carlos Garcia Campos
Comment 9 2013-05-13 03:45:17 PDT
Created attachment 201544 [details] Another update Sorry, attached the wrong patch, this one should apply.
Arvid Nilsson
Comment 10 2013-05-13 03:55:48 PDT
Comment on attachment 201544 [details] Another update This looks pretty much exactly like the old code, and looks threadsafe to me. Informal R+
Build Bot
Comment 11 2013-05-13 17:28:57 PDT
Comment on attachment 201544 [details] Another update Attachment 201544 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/460868 New failing tests: editing/unsupported-content/table-delete-003.html editing/unsupported-content/list-type-before.html editing/unsupported-content/table-type-before.html editing/unsupported-content/list-delete-003.html editing/unsupported-content/list-delete-001.html editing/unsupported-content/list-type-after.html editing/unsupported-content/table-delete-002.html editing/unsupported-content/table-type-after.html editing/unsupported-content/table-delete-001.html
Build Bot
Comment 12 2013-05-13 17:28:59 PDT
Created attachment 201648 [details] Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-16 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.2
Rob Buis
Comment 13 2013-05-14 08:17:19 PDT
Comment on attachment 201544 [details] Another update Ok.
WebKit Commit Bot
Comment 14 2013-05-14 09:16:36 PDT
Comment on attachment 201544 [details] Another update Clearing flags on attachment: 201544 Committed r150071: <http://trac.webkit.org/changeset/150071>
WebKit Commit Bot
Comment 15 2013-05-14 09:16:39 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.