summaryrefslogtreecommitdiffstats
path: root/cc/scrollbar_layer.h
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 00:12:47 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 00:12:47 +0000
commit904e9138fb2ca78ba6ae1f1054f9ce8cfe19eda5 (patch)
tree931236a109d66ef40f169888e95b47b17da6d9ea /cc/scrollbar_layer.h
parente2946a407e60e0334292644310fb53a93badf70c (diff)
downloadchromium_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/scrollbar_layer.h')
-rw-r--r--cc/scrollbar_layer.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/cc/scrollbar_layer.h b/cc/scrollbar_layer.h
index 95847a9..035d3ee 100644
--- a/cc/scrollbar_layer.h
+++ b/cc/scrollbar_layer.h
@@ -6,8 +6,8 @@
#ifndef ScrollbarLayerChromium_h
#define ScrollbarLayerChromium_h
-#include "caching_bitmap_content_layer_updater.h"
-#include "cc/layer.h"
+#include "cc/caching_bitmap_content_layer_updater.h"
+#include "cc/contents_scaling_layer.h"
#include <public/WebScrollbar.h>
#include <public/WebScrollbarThemeGeometry.h>
#include <public/WebScrollbarThemePainter.h>
@@ -18,15 +18,13 @@ class ResourceUpdateQueue;
class Scrollbar;
class ScrollbarThemeComposite;
-class ScrollbarLayer : public Layer {
+class ScrollbarLayer : public ContentsScalingLayer {
public:
virtual scoped_ptr<LayerImpl> createLayerImpl() OVERRIDE;
static scoped_refptr<ScrollbarLayer> create(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId);
// Layer interface
- virtual bool needsContentsScale() const OVERRIDE;
- virtual IntSize contentBounds() const OVERRIDE;
virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE;
virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&) OVERRIDE;
virtual void setLayerTreeHost(LayerTreeHost*) OVERRIDE;
@@ -44,6 +42,7 @@ protected:
private:
void updatePart(CachingBitmapContentLayerUpdater*, LayerUpdater::Resource*, const IntRect&, ResourceUpdateQueue&, RenderingStats&);
void createUpdaterIfNeeded();
+ IntRect scrollbarLayerRectToContentRect(const WebKit::WebRect& layerRect) const;
scoped_ptr<WebKit::WebScrollbar> m_scrollbar;
WebKit::WebScrollbarThemePainter m_painter;