diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 00:12:47 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 00:12:47 +0000 |
commit | 904e9138fb2ca78ba6ae1f1054f9ce8cfe19eda5 (patch) | |
tree | 931236a109d66ef40f169888e95b47b17da6d9ea /cc/tiled_layer.h | |
parent | e2946a407e60e0334292644310fb53a93badf70c (diff) | |
download | chromium_src-904e9138fb2ca78ba6ae1f1054f9ce8cfe19eda5.zip chromium_src-904e9138fb2ca78ba6ae1f1054f9ce8cfe19eda5.tar.gz chromium_src-904e9138fb2ca78ba6ae1f1054f9ce8cfe19eda5.tar.bz2 |
Pass accurate contentsScale to LayerImpl.
This is the first part of fixing fuzzy content issue in composited layers in
scaled pages.
There are two reasons of fuzzy content:
1) Inaccurate scale: The scale in transformation is calculated with
contentBounds.width / bounds.width
contentBounds.height / bounds.height
in layer_tree_host_common.cc and other places.
However, contentBounds is a IntSize which is calculated from bounds
and contentsScale in layer.cc:
IntRect(lroundf(bounds.width * contentsScale),
lroundf(bounds.height * contentsScale))
This causes the scale like 0.993 or 1.007 in the drawTransformation etc.
where identity transformation is expected.
To resolve the issue, instead of calculating scale using contentBounds,
pass the accurate contentsScale from Layer to LayerImpl.
2) Pixel on surfaces are not aligned. Will describe this in the CL for the
second part.
(See https://bugs.webkit.org/show_bug.cgi?id=84187 for more details).
Change-Id: I8f59f0460e1b212223e2c8c551b4127d8239e5cc
BUG=bugs.webkit.org/show_bug.cgi?id=84187
TEST=ContentsScalingLayerTest.checkContentBounds, LayerTreeHostCommonTest.verifyLayerTransformsInHighDPIAccurateScaleZeroPosition, LayerTreeHostCommonTest.verifyRenderSurfaceTransformsInHighDPIAccurateScaleZeroPosition
Review URL: https://chromiumcodereview.appspot.com/11276060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/tiled_layer.h')
-rw-r--r-- | cc/tiled_layer.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cc/tiled_layer.h b/cc/tiled_layer.h index c6cb541..7994d2c 100644 --- a/cc/tiled_layer.h +++ b/cc/tiled_layer.h @@ -5,14 +5,14 @@ #ifndef TiledLayerChromium_h #define TiledLayerChromium_h -#include "cc/layer.h" +#include "cc/contents_scaling_layer.h" #include "cc/layer_updater.h" #include "cc/layer_tiling_data.h" namespace cc { class UpdatableTile; -class TiledLayer : public Layer { +class TiledLayer : public ContentsScalingLayer { public: enum TilingOption { AlwaysTile, NeverTile, AutoTile }; @@ -21,9 +21,6 @@ public: virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; virtual bool drawsContent() const OVERRIDE; - virtual bool needsContentsScale() const OVERRIDE; - - virtual IntSize contentBounds() const OVERRIDE; virtual void setNeedsDisplayRect(const FloatRect&) OVERRIDE; |