diff options
author | vangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-04 00:29:09 +0000 |
---|---|---|
committer | vangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-04 00:29:09 +0000 |
commit | 5a1e29a6ac13a861ed44e6b65ab24893d812776d (patch) | |
tree | 2edcd0044a254ec27ae92476a3484e12389c8493 | |
parent | 345e238dd0c04bdb4a8470763e9f7876b2d93431 (diff) | |
download | chromium_src-5a1e29a6ac13a861ed44e6b65ab24893d812776d.zip chromium_src-5a1e29a6ac13a861ed44e6b65ab24893d812776d.tar.gz chromium_src-5a1e29a6ac13a861ed44e6b65ab24893d812776d.tar.bz2 |
Fix scrolling of full-frame pdf docs in accelerated compositing mode by forcing a full
frame invalidation on scroll offset changes. Current Pepper2D plugin
scrolling is fundamentally incompatible with how pages scroll in the accelerated compositing. Plugins rely on
shifting the existing backing and backfilling whereas the compositor scrolls by moving the viewport on top
of a fixed document.
BUG=chromium-os:18521
Review URL: http://codereview.chromium.org/8100017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103831 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 20 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.h | 4 |
2 files changed, 22 insertions, 2 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index ceffe30..ccb349e 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -335,11 +335,12 @@ void PluginInstance::ScrollRect(int dx, int dy, const gfx::Rect& rect) { if (fullscreen_container_) { fullscreen_container_->ScrollRect(dx, dy, rect); } else { - if (full_frame_) { + if (full_frame_ && !IsViewAccelerated()) { container_->scrollRect(dx, dy, rect); } else { // Can't do optimized scrolling since there could be other elements on top - // of us. + // of us or the view renders via the accelerated compositor which is + // incompatible with the move and backfill scrolling model. InvalidateRect(rect); } } @@ -1052,6 +1053,21 @@ int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, return PP_OK; } +bool PluginInstance::IsViewAccelerated() { + if (!container_) + return false; + + WebDocument document = container_->element().document(); + WebFrame* frame = document.frame(); + if (!frame) + return false; + WebView* view = frame->view(); + if (!view) + return false; + + return view->isAcceleratedCompositingActive(); +} + PluginDelegate::PlatformContext3D* PluginInstance::CreateContext3D() { if (fullscreen_container_) return fullscreen_container_->CreateContext3D(); diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h index a035b61..f802e0d 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.h +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h @@ -403,6 +403,10 @@ class PluginInstance : public base::RefCounted<PluginInstance>, // assess the security origin of the main frame document. bool CanAccessMainFrame() const; + // Returns true if the WebView the plugin is in renders via the accelerated + // compositing path. + bool IsViewAccelerated(); + PluginDelegate* delegate_; scoped_refptr<PluginModule> module_; scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |