summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorwjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-24 07:43:49 +0000
committerwjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-24 07:43:49 +0000
commit0f4e80949fcbac5145e68f81b8ddb63d76788d90 (patch)
tree45dd6348873d719e0b9b3fb563004760579667bf /ui
parenta5320b4678073d0f86d62566d782c79d759640a5 (diff)
downloadchromium_src-0f4e80949fcbac5145e68f81b8ddb63d76788d90.zip
chromium_src-0f4e80949fcbac5145e68f81b8ddb63d76788d90.tar.gz
chromium_src-0f4e80949fcbac5145e68f81b8ddb63d76788d90.tar.bz2
Pinch/Zoom Infrastructure & Plumbing CL
This CL supplies the necessary changes to CC to support the inner/outer viewport model for pinch-zoom and fixed-position elements. The specification for these changes is contained in the document "Layer-based Solution for Pinch Zoom / Fixed Position". It incorporates a change to how scrollbar parameters are computed (removes the notion of max_scroll_offset as a quantity set be the embedder, and instead inferred from the relative sizes of a clip layer w.r.t. the scroll layer). Scrollbars are generalized so that a layer may have more than two scrollbars, and the parameters of the scrollbar are set w.r.t. the sizes and positions of a clip and a scroll layer. Further, changes to the scrip/scroll layer automatically notify any attached scrollbars. The CL also removes existing references to root_scroll_layer from LTH, LTI and LTHI and replaces them with either Inner/OuterViewportScrollLayer (dual-layer operation only exists at present if the --enable-pinch-virtual-viewport flag is specified, otherwise behavior is unchanged). Logic is added to (i) combine scroll offsets for the two viewports before passing it to the embedder, and (ii) splitting any offsets received from the embedder appropriately between the two viewports. This CL relies on https://codereview.chromium.org/138453004/ for changes in Blink to support it. BUG=148816 Review URL: https://codereview.chromium.org/23983047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/transform.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 5e3b830..b319831 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -89,6 +89,9 @@ class GFX_EXPORT Transform {
// to |this|.
void Scale(SkMScalar x, SkMScalar y);
void Scale3d(SkMScalar x, SkMScalar y, SkMScalar z);
+ gfx::Vector2dF Scale2d() const {
+ return gfx::Vector2dF(matrix_.get(0,0), matrix_.get(1,1));
+ }
// Applies the current transformation on a translation and assigns the result
// to |this|.
@@ -136,6 +139,11 @@ class GFX_EXPORT Transform {
// translation.
bool IsIdentityOrIntegerTranslation() const;
+ // Returns true if the matrix had only scaling components.
+ bool IsScale2d() const {
+ return !(matrix_.getType() & ~SkMatrix44::kScale_Mask);
+ }
+
// Returns true if the matrix is has only scaling and translation components.
bool IsScaleOrTranslation() const {
int mask = SkMatrix44::kScale_Mask | SkMatrix44::kTranslate_Mask;