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

          Line data    Source code
       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/. */
       5             : 
       6             : // This is a general tool that will let you visualize platform operation.
       7             : // Currently used for the layer system, the general syntax allows this
       8             : // tools to be adapted to trace other operations.
       9             : //
      10             : // For the front end see: https://github.com/staktrace/rendertrace
      11             : 
      12             : // Uncomment this line to enable RENDERTRACE
      13             : //#define MOZ_RENDERTRACE
      14             : 
      15             : #ifndef GFX_RENDERTRACE_H
      16             : #define GFX_RENDERTRACE_H
      17             : 
      18             : #include "nsRect.h"
      19             : #include "mozilla/gfx/Matrix.h"
      20             : 
      21             : namespace mozilla {
      22             : namespace layers {
      23             : 
      24             : class Layer;
      25             : 
      26             : void RenderTraceLayers(Layer *aLayer, const char *aColor, const gfx::Matrix4x4 aRootTransform = gfx::Matrix4x4(), bool aReset = true);
      27             : 
      28             : void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor, const gfx::IntRect aRect);
      29             : void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor);
      30             : 
      31             : void renderTraceEventStart(const char *aComment, const char *aColor);
      32             : void renderTraceEventEnd(const char *aComment, const char *aColor);
      33             : void renderTraceEventEnd(const char *aColor);
      34             : 
      35             : struct RenderTraceScope {
      36             : public:
      37         208 :   RenderTraceScope(const char *aComment, const char *aColor)
      38         208 :     : mComment(aComment)
      39         208 :     , mColor(aColor)
      40             :   {
      41         208 :     renderTraceEventStart(mComment, mColor);
      42         208 :   }
      43         416 :   ~RenderTraceScope() {
      44         208 :     renderTraceEventEnd(mComment, mColor);
      45         208 :   }
      46             : private:
      47             :   const char *mComment;
      48             :   const char *mColor;
      49             : };
      50             : 
      51             : #ifndef MOZ_RENDERTRACE
      52          77 : inline void RenderTraceLayers(Layer *aLayer, const char *aColor, const gfx::Matrix4x4 aRootTransform, bool aReset)
      53          77 : {}
      54             : 
      55          84 : inline void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor, const gfx::IntRect aRect)
      56          84 : {}
      57             : 
      58          84 : inline void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor)
      59          84 : {}
      60             : 
      61         208 : inline void renderTraceEventStart(const char *aComment, const char *aColor)
      62         208 : {}
      63             : 
      64         208 : inline void renderTraceEventEnd(const char *aComment, const char *aColor)
      65         208 : {}
      66             : 
      67             : inline void renderTraceEventEnd(const char *aColor)
      68             : {}
      69             : 
      70             : #endif // MOZ_RENDERTRACE
      71             : 
      72             : } // namespace layers
      73             : } // namespace mozilla
      74             : 
      75             : #endif //GFX_RENDERTRACE_H

Generated by: LCOV version 1.13