diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 16:16:20 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 16:16:20 +0000 |
commit | daaaef4c3fa2cf8ccc6e49cb40c359c10ae79c9b (patch) | |
tree | 69a0bce8600e65ba5edc91c91d629c4f00f5a649 /webkit/glue/plugins | |
parent | 4b154a9ba6dc10562837bb745d8735a6c14f238d (diff) | |
download | chromium_src-daaaef4c3fa2cf8ccc6e49cb40c359c10ae79c9b.zip chromium_src-daaaef4c3fa2cf8ccc6e49cb40c359c10ae79c9b.tar.gz chromium_src-daaaef4c3fa2cf8ccc6e49cb40c359c10ae79c9b.tar.bz2 |
Make timer-driven CA plugins less wasteful, and up the timer frequency
Don't do cross-process IOSurface work if nothing has changed in the layer. Now that it's less expensive, up the frequency of the timer a bit to minimize the chance of dropped frames due to drift if the plugin is updating at a different speed.
BUG=None
TEST=Core Animation plugins on the Mac still work.
Review URL: http://codereview.chromium.org/2847003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 5d85208..e0f479e 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -44,7 +44,7 @@ using WebKit::WebInputEvent; using WebKit::WebMouseEvent; using WebKit::WebMouseWheelEvent; -const int kCoreAnimationRedrawPeriodMs = 20; // 50fps +const int kCoreAnimationRedrawPeriodMs = 10; // 100 Hz // Important implementation notes: The Mac definition of NPAPI, particularly // the distinction between windowed and windowless modes, differs from the @@ -995,6 +995,11 @@ void WebPluginDelegateImpl::DrawLayerInSurface() { surface_->Clear(window_rect_); [renderer_ beginFrameAtTime:CACurrentMediaTime() timeStamp:NULL]; + if (CGRectIsEmpty([renderer_ updateBounds])) { + // If nothing has changed, we are done. + [renderer_ endFrame]; + return; + } CGRect layerRect = [layer_ bounds]; [renderer_ addUpdateRect:layerRect]; [renderer_ render]; |