LCOV - code coverage report
Current view: top level - gfx/src - RegionBuilder.h (source / functions) Hit Total Coverage
Test: output.info Lines: 9 9 100.0 %
Date: 2017-07-14 16:53:18 Functions: 12 20 60.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* This Source Code Form is subject to the terms of the Mozilla Public
       2             :  *  * License, v. 2.0. If a copy of the MPL was not distributed with this
       3             :  *  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       4             : 
       5             : #ifndef RegionBuilder_h__
       6             : #define RegionBuilder_h__
       7             : 
       8             : #include <nsTArray.h>
       9             : 
      10             : template <typename RegionType>
      11        1055 : class RegionBuilder
      12             : {
      13             : public:
      14             :   typedef typename RegionType::RectType RectType;
      15             : 
      16        1055 :   RegionBuilder()
      17        1055 :   {}
      18             : 
      19         407 :   void OrWith(const RectType& aRect) {
      20         407 :     pixman_box32_t box = { aRect.x, aRect.y, aRect.XMost(), aRect.YMost() };
      21         407 :     mRects.AppendElement(box);
      22         407 :   }
      23             : 
      24        1055 :   RegionType ToRegion() const {
      25        1055 :     return RegionType(mRects);
      26             :   }
      27             : 
      28             : private:
      29             :   nsTArray<pixman_box32_t> mRects;
      30             : };
      31             : 
      32             : #endif // RegionBuilder_h__

Generated by: LCOV version 1.13