layout/style/nsStyleTransformMatrix.h

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /*
michael@0 7 * A class representing three matrices that can be used for style transforms.
michael@0 8 */
michael@0 9
michael@0 10 #ifndef nsStyleTransformMatrix_h_
michael@0 11 #define nsStyleTransformMatrix_h_
michael@0 12
michael@0 13 #include "nsCSSValue.h"
michael@0 14 #include "gfx3DMatrix.h"
michael@0 15
michael@0 16 class nsStyleContext;
michael@0 17 class nsPresContext;
michael@0 18 struct nsRect;
michael@0 19
michael@0 20 /**
michael@0 21 * A helper to generate gfxMatrixes from css transform functions.
michael@0 22 */
michael@0 23 namespace nsStyleTransformMatrix {
michael@0 24
michael@0 25 /**
michael@0 26 * Return the transform function, as an nsCSSKeyword, for the given
michael@0 27 * nsCSSValue::Array from a transform list.
michael@0 28 */
michael@0 29 nsCSSKeyword TransformFunctionOf(const nsCSSValue::Array* aData);
michael@0 30
michael@0 31 float ProcessTranslatePart(const nsCSSValue& aValue,
michael@0 32 nsStyleContext* aContext,
michael@0 33 nsPresContext* aPresContext,
michael@0 34 bool& aCanStoreInRuleTree,
michael@0 35 nscoord aSize,
michael@0 36 float aAppUnitsPerMatrixUnit);
michael@0 37
michael@0 38 void
michael@0 39 ProcessInterpolateMatrix(gfx3DMatrix& aMatrix,
michael@0 40 const nsCSSValue::Array* aData,
michael@0 41 nsStyleContext* aContext,
michael@0 42 nsPresContext* aPresContext,
michael@0 43 bool& aCanStoreInRuleTree,
michael@0 44 nsRect& aBounds, float aAppUnitsPerMatrixUnit);
michael@0 45
michael@0 46 /**
michael@0 47 * Given an nsCSSValueList containing -moz-transform functions,
michael@0 48 * returns a matrix containing the value of those functions.
michael@0 49 *
michael@0 50 * @param aData The nsCSSValueList containing the transform functions
michael@0 51 * @param aContext The style context, used for unit conversion.
michael@0 52 * @param aPresContext The presentation context, used for unit conversion.
michael@0 53 * @param aCanStoreInRuleTree Set to false if the result cannot be cached
michael@0 54 * in the rule tree, otherwise untouched.
michael@0 55 * @param aBounds The frame's bounding rectangle.
michael@0 56 * @param aAppUnitsPerMatrixUnit The number of app units per device pixel.
michael@0 57 *
michael@0 58 * aContext and aPresContext may be null if all of the (non-percent)
michael@0 59 * length values in aData are already known to have been converted to
michael@0 60 * eCSSUnit_Pixel (as they are in an nsStyleAnimation::Value)
michael@0 61 */
michael@0 62 gfx3DMatrix ReadTransforms(const nsCSSValueList* aList,
michael@0 63 nsStyleContext* aContext,
michael@0 64 nsPresContext* aPresContext,
michael@0 65 bool &aCanStoreInRuleTree,
michael@0 66 nsRect& aBounds,
michael@0 67 float aAppUnitsPerMatrixUnit);
michael@0 68
michael@0 69 } // namespace nsStyleTransformMatrix
michael@0 70
michael@0 71 #endif

mercurial