LCOV - code coverage report
Current view: top level - gfx/layers/mlgpu - MemoryReportingMLGPU.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 5 17 29.4 %
Date: 2017-07-14 16:53:18 Functions: 5 7 71.4 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 20; 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             : #include "MemoryReportingMLGPU.h"
       7             : #include "nsIMemoryReporter.h"
       8             : 
       9             : namespace mozilla {
      10             : namespace layers {
      11             : namespace mlg {
      12             : 
      13             : mozilla::Atomic<size_t> sConstantBufferUsage;
      14             : mozilla::Atomic<size_t> sVertexBufferUsage;
      15             : mozilla::Atomic<size_t> sRenderTargetUsage;
      16             : 
      17           3 : class MemoryReportingMLGPU final : public nsIMemoryReporter
      18             : {
      19             : public:
      20             :   NS_DECL_ISUPPORTS
      21             : 
      22           0 :   NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
      23             :                             nsISupports* aData,
      24             :                             bool aAnonymize) override
      25             :   {
      26           0 :     if (sConstantBufferUsage) {
      27           0 :       MOZ_COLLECT_REPORT(
      28             :         "mlgpu-constant-buffers", KIND_OTHER, UNITS_BYTES,
      29             :         sConstantBufferUsage,
      30           0 :         "Advanced Layers shader constant buffers.");
      31             :     }
      32           0 :     if (sVertexBufferUsage) {
      33           0 :       MOZ_COLLECT_REPORT(
      34             :         "mlgpu-vertex-buffers", KIND_OTHER, UNITS_BYTES,
      35             :         sVertexBufferUsage,
      36           0 :         "Advanced Layers shader vertex buffers.");
      37             :     }
      38           0 :     if (sRenderTargetUsage) {
      39           0 :       MOZ_COLLECT_REPORT(
      40             :         "mlgpu-render-targets", KIND_OTHER, UNITS_BYTES,
      41             :         sRenderTargetUsage,
      42           0 :         "Advanced Layers render target textures and depth buffers.");
      43             :     }
      44           0 :     return NS_OK;
      45             :   }
      46             : 
      47             : private:
      48           0 :   ~MemoryReportingMLGPU() {}
      49             : };
      50             : 
      51          39 : NS_IMPL_ISUPPORTS(MemoryReportingMLGPU, nsIMemoryReporter);
      52             : 
      53             : void
      54           3 : InitializeMemoryReporters()
      55             : {
      56           3 :   RegisterStrongMemoryReporter(new MemoryReportingMLGPU());
      57           3 : }
      58             : 
      59             : } // namespace mlg
      60             : } // namespace layers
      61             : } // namespace mozilla

Generated by: LCOV version 1.13