Home | History | Annotate | Download | only in api
      1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  */
      5 
      6 /**
      7  * This file defines the width and height of a 2D rectangle.
      8  */
      9 
     10 /**
     11  * The <code>PP_Size</code> struct contains the size of a 2D rectangle.
     12  */
     13 [assert_size(8)]
     14 struct PP_Size {
     15   /** This value represents the width of the rectangle. */
     16   int32_t width;
     17   /** This value represents the height of the rectangle. */
     18   int32_t height;
     19 };
     20 
     21 /**
     22  * The <code>PP_FloatSize</code> struct contains the size of a 2D rectangle.
     23  */
     24 struct PP_FloatSize {
     25    /** This value represents the width of the rectangle. */
     26   float_t width;
     27   /** This value represents the height of the rectangle. */
     28   float_t height;
     29 };
     30 
     31 #inline c
     32 /**
     33  * @addtogroup Functions
     34  * @{
     35  */
     36 
     37 /**
     38  * PP_MakeSize() creates a <code>PP_Size</code> given a width and height as
     39  * int32_t values.
     40  *
     41  * @param[in] w An int32_t value representing a width.
     42  * @param[in] h An int32_t value representing a height.
     43  *
     44  * @return A <code>PP_Size</code> structure.
     45  */
     46 PP_INLINE struct PP_Size PP_MakeSize(int32_t w, int32_t h) {
     47   struct PP_Size ret;
     48   ret.width = w;
     49   ret.height = h;
     50   return ret;
     51 }
     52 
     53 /**
     54  * PP_MakeFloatSize() creates a <code>PP_FloatSize</code> given a
     55  * width and height as float values.
     56  *
     57  * @param[in] w An float value representing a width.
     58  * @param[in] h An float value representing a height.
     59  *
     60  * @return A <code>PP_FloatSize</code> structure.
     61  */
     62 PP_INLINE struct PP_FloatSize PP_MakeFloatSize(float w, float h) {
     63   struct PP_FloatSize ret;
     64   ret.width = w;
     65   ret.height = h;
     66   return ret;
     67 }
     68 /**
     69  * @}
     70  */
     71 #endinl
     72 
     73