From 904e9138fb2ca78ba6ae1f1054f9ce8cfe19eda5 Mon Sep 17 00:00:00 2001 From: "wangxianzhu@chromium.org" Date: Thu, 1 Nov 2012 00:12:47 +0000 Subject: 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 --- cc/cc.gyp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cc/cc.gyp') diff --git a/cc/cc.gyp b/cc/cc.gyp index 35606e1..19f72ba 100644 --- a/cc/cc.gyp +++ b/cc/cc.gyp @@ -24,6 +24,8 @@ 'checkerboard_draw_quad.cc', 'checkerboard_draw_quad.h', 'completion_event.h', + 'contents_scaling_layer.cc', + 'contents_scaling_layer.h', 'damage_tracker.cc', 'damage_tracker.h', 'debug_border_draw_quad.cc', -- cgit v1.1