LCOV - code coverage report
Current view: top level - gfx/layers/apz/util - InputAPZContext.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 26 33 78.8 %
Date: 2017-07-14 16:53:18 Functions: 6 9 66.7 %
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             : #include "InputAPZContext.h"
       7             : 
       8             : namespace mozilla {
       9             : namespace layers {
      10             : 
      11           3 : ScrollableLayerGuid InputAPZContext::sGuid;
      12             : uint64_t InputAPZContext::sBlockId = 0;
      13             : nsEventStatus InputAPZContext::sApzResponse = nsEventStatus_eIgnore;
      14             : bool InputAPZContext::sRoutedToChildProcess = false;
      15             : bool InputAPZContext::sPendingLayerization = false;
      16             : 
      17             : /*static*/ ScrollableLayerGuid
      18          12 : InputAPZContext::GetTargetLayerGuid()
      19             : {
      20          12 :   return sGuid;
      21             : }
      22             : 
      23             : /*static*/ uint64_t
      24           6 : InputAPZContext::GetInputBlockId()
      25             : {
      26           6 :   return sBlockId;
      27             : }
      28             : 
      29             : /*static*/ nsEventStatus
      30           0 : InputAPZContext::GetApzResponse()
      31             : {
      32           0 :   return sApzResponse;
      33             : }
      34             : 
      35             : /*static*/ void
      36           6 : InputAPZContext::SetRoutedToChildProcess()
      37             : {
      38           6 :   sRoutedToChildProcess = true;
      39           6 : }
      40             : 
      41             : /*static*/ void
      42           0 : InputAPZContext::SetPendingLayerization()
      43             : {
      44           0 :   sPendingLayerization = true;
      45           0 : }
      46             : 
      47          12 : InputAPZContext::InputAPZContext(const ScrollableLayerGuid& aGuid,
      48             :                                  const uint64_t& aBlockId,
      49          12 :                                  const nsEventStatus& aApzResponse)
      50             :   : mOldGuid(sGuid)
      51             :   , mOldBlockId(sBlockId)
      52             :   , mOldApzResponse(sApzResponse)
      53             :   , mOldRoutedToChildProcess(sRoutedToChildProcess)
      54          12 :   , mOldPendingLayerization(sPendingLayerization)
      55             : {
      56          12 :   sGuid = aGuid;
      57          12 :   sBlockId = aBlockId;
      58          12 :   sApzResponse = aApzResponse;
      59          12 :   sRoutedToChildProcess = false;
      60          12 :   sPendingLayerization = false;
      61          12 : }
      62             : 
      63          24 : InputAPZContext::~InputAPZContext()
      64             : {
      65          12 :   sGuid = mOldGuid;
      66          12 :   sBlockId = mOldBlockId;
      67          12 :   sApzResponse = mOldApzResponse;
      68          12 :   sRoutedToChildProcess = mOldRoutedToChildProcess;
      69          12 :   sPendingLayerization = mOldPendingLayerization;
      70          12 : }
      71             : 
      72             : /*static*/ bool
      73           6 : InputAPZContext::WasRoutedToChildProcess()
      74             : {
      75           6 :   return sRoutedToChildProcess;
      76             : }
      77             : 
      78             : /*static*/ bool
      79           0 : InputAPZContext::HavePendingLayerization()
      80             : {
      81           0 :   return sPendingLayerization;
      82             : }
      83             : 
      84             : } // namespace layers
      85             : } // namespace mozilla

Generated by: LCOV version 1.13