layout/style/nsStyleTransformMatrix.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial