2008-09-13 13:42:11 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-09-13 13:42:11 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* A class representing three matrices that can be used for style transforms.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsStyleTransformMatrix_h_
|
|
|
|
#define nsStyleTransformMatrix_h_
|
|
|
|
|
|
|
|
#include "nsCSSValue.h"
|
2011-07-23 02:28:07 +04:00
|
|
|
#include "gfx3DMatrix.h"
|
2008-09-13 13:42:11 +04:00
|
|
|
|
2011-05-25 12:01:11 +04:00
|
|
|
class nsStyleContext;
|
|
|
|
class nsPresContext;
|
2013-03-03 04:31:48 +04:00
|
|
|
struct nsRect;
|
2010-07-03 08:18:56 +04:00
|
|
|
|
2008-09-13 13:42:11 +04:00
|
|
|
/**
|
2011-09-27 01:54:45 +04:00
|
|
|
* A helper to generate gfxMatrixes from css transform functions.
|
2008-09-13 13:42:11 +04:00
|
|
|
*/
|
2011-09-27 01:54:45 +04:00
|
|
|
namespace nsStyleTransformMatrix {
|
|
|
|
|
2010-07-03 08:18:56 +04:00
|
|
|
/**
|
|
|
|
* Return the transform function, as an nsCSSKeyword, for the given
|
|
|
|
* nsCSSValue::Array from a transform list.
|
|
|
|
*/
|
2011-09-27 01:54:45 +04:00
|
|
|
nsCSSKeyword TransformFunctionOf(const nsCSSValue::Array* aData);
|
2010-07-03 08:18:56 +04:00
|
|
|
|
2012-07-31 21:28:21 +04:00
|
|
|
float ProcessTranslatePart(const nsCSSValue& aValue,
|
|
|
|
nsStyleContext* aContext,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
bool& aCanStoreInRuleTree,
|
2014-05-08 09:35:00 +04:00
|
|
|
nscoord aSize);
|
2012-07-31 21:28:21 +04:00
|
|
|
|
2012-12-12 01:12:43 +04:00
|
|
|
void
|
|
|
|
ProcessInterpolateMatrix(gfx3DMatrix& aMatrix,
|
|
|
|
const nsCSSValue::Array* aData,
|
|
|
|
nsStyleContext* aContext,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
bool& aCanStoreInRuleTree,
|
2014-05-08 09:35:00 +04:00
|
|
|
nsRect& aBounds);
|
2012-12-12 01:12:43 +04:00
|
|
|
|
2008-09-13 13:42:11 +04:00
|
|
|
/**
|
2011-09-27 01:54:45 +04:00
|
|
|
* Given an nsCSSValueList containing -moz-transform functions,
|
|
|
|
* returns a matrix containing the value of those functions.
|
2008-09-13 13:42:11 +04:00
|
|
|
*
|
2011-09-27 01:54:45 +04:00
|
|
|
* @param aData The nsCSSValueList containing the transform functions
|
2008-09-13 13:42:11 +04:00
|
|
|
* @param aContext The style context, used for unit conversion.
|
|
|
|
* @param aPresContext The presentation context, used for unit conversion.
|
2009-02-05 00:24:18 +03:00
|
|
|
* @param aCanStoreInRuleTree Set to false if the result cannot be cached
|
|
|
|
* in the rule tree, otherwise untouched.
|
2011-07-23 02:28:07 +04:00
|
|
|
* @param aBounds The frame's bounding rectangle.
|
|
|
|
* @param aAppUnitsPerMatrixUnit The number of app units per device pixel.
|
2010-07-03 08:18:56 +04:00
|
|
|
*
|
|
|
|
* aContext and aPresContext may be null if all of the (non-percent)
|
|
|
|
* length values in aData are already known to have been converted to
|
2014-06-24 10:29:54 +04:00
|
|
|
* eCSSUnit_Pixel (as they are in an StyleAnimationValue)
|
2008-09-13 13:42:11 +04:00
|
|
|
*/
|
2011-09-27 01:54:45 +04:00
|
|
|
gfx3DMatrix ReadTransforms(const nsCSSValueList* aList,
|
|
|
|
nsStyleContext* aContext,
|
|
|
|
nsPresContext* aPresContext,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool &aCanStoreInRuleTree,
|
2011-09-27 01:54:45 +04:00
|
|
|
nsRect& aBounds,
|
|
|
|
float aAppUnitsPerMatrixUnit);
|
2008-09-13 13:42:11 +04:00
|
|
|
|
2011-09-27 01:54:45 +04:00
|
|
|
} // namespace nsStyleTransformMatrix
|
2008-09-13 13:42:11 +04:00
|
|
|
|
|
|
|
#endif
|