diff options
author | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-09 00:21:26 +0000 |
---|---|---|
committer | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-09 00:21:26 +0000 |
commit | 251699bdcff5063ceafe1442072f756085e2643b (patch) | |
tree | 1e9046aaccc1aa732f11323855a0a053d8a6b33e /cc/layers | |
parent | 77439eb431f1a1152c9ba6a7de0fd874a67ff946 (diff) | |
download | chromium_src-251699bdcff5063ceafe1442072f756085e2643b.zip chromium_src-251699bdcff5063ceafe1442072f756085e2643b.tar.gz chromium_src-251699bdcff5063ceafe1442072f756085e2643b.tar.bz2 |
Make Android WebView filtering depend on scrolling status.
This patch makes bilinear filtering of software images enabled only when
there is no scrolling or CSS animation active, which matches the
policy of classic WebView. In the long run, we'll likely want to support
software tiling to avoid this kind of hack, but for now this maintains
bugwards compatibility.
Most of this patch is to solve the problem that CC was not aware whether
or not WebView-handled fling is active. I added a new getter
ScrollOffsetDelegate::IsExternalFlingActive for this. This also
enables prefer-smoothness mode for these flings.
New test RendererPixelTest.PictureDrawQuadDisableImageFiltering
NOTRY=true
BUG= internal b/10706494
Review URL: https://codereview.chromium.org/25233002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers')
-rw-r--r-- | cc/layers/layer_impl.cc | 5 | ||||
-rw-r--r-- | cc/layers/layer_impl.h | 2 | ||||
-rw-r--r-- | cc/layers/layer_impl_unittest.cc | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index dde14e2..c1fb321 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -980,6 +980,11 @@ void LayerImpl::SetScrollOffsetDelegate( } } +bool LayerImpl::IsExternalFlingActive() const { + return scroll_offset_delegate_ && + scroll_offset_delegate_->IsExternalFlingActive(); +} + void LayerImpl::SetScrollOffset(gfx::Vector2d scroll_offset) { SetScrollOffsetAndDelta(scroll_offset, ScrollDelta()); } diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index c97afc7..6513b32 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -345,6 +345,8 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { void SetScrollOffsetDelegate( LayerScrollOffsetDelegate* scroll_offset_delegate); + bool IsExternalFlingActive() const; + void SetScrollOffset(gfx::Vector2d scroll_offset); void SetScrollOffsetAndDelta(gfx::Vector2d scroll_offset, gfx::Vector2dF scroll_delta); diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc index 5e36e81..3a0b1ce 100644 --- a/cc/layers/layer_impl_unittest.cc +++ b/cc/layers/layer_impl_unittest.cc @@ -376,6 +376,7 @@ class ScrollDelegateIgnore : public LayerScrollOffsetDelegate { virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE { return fixed_offset_; } + virtual bool IsExternalFlingActive() const OVERRIDE { return false; } void set_fixed_offset(gfx::Vector2dF fixed_offset) { fixed_offset_ = fixed_offset; @@ -432,6 +433,7 @@ class ScrollDelegateAccept : public LayerScrollOffsetDelegate { virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE { return current_offset_; } + virtual bool IsExternalFlingActive() const OVERRIDE { return false; } virtual void SetPageScaleFactor(float page_scale_factor) OVERRIDE {} virtual void SetScrollableSize(gfx::SizeF scrollable_size) OVERRIDE {} |