author Bas Schouten <>
Fri, 06 Mar 2015 02:37:12 +0100
changeset 250308 a0dcce4081087e2e1f9d6ec7ebf3b9e37b7dc619
parent 248684 86924ac6a94a9147bcae518239d7a33b5981062b
child 286645 02f08045a3bc004fcd2849fcaca05a220eee72c4
permissions -rw-r--r--
Bug 1138934 - Make sure the white texture of a component alpha pair is fully uploaded when new. r=nical, a=lmandel This is slightly wasteful since this will also always upload the full black texture. The wastage here is so rare and generally so few though that I don't think it's worth adding plumming for the texture host to know if this is the texture on white of on black.

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */

/* Small helper class for asserting uses of a class are non-reentrant. */

#ifndef mozilla_ReentrancyGuard_h
#define mozilla_ReentrancyGuard_h

#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
#include "mozilla/GuardObjects.h"

namespace mozilla {

/* Useful for implementing containers that assert non-reentrancy */
class ReentrancyGuard
#ifdef DEBUG
  bool& mEntered;

  template<class T>
#ifdef DEBUG
  ReentrancyGuard(T& aObj
    : mEntered(aObj.mEntered)
#ifdef DEBUG
    mEntered = true;
#ifdef DEBUG
    mEntered = false;

  ReentrancyGuard(const ReentrancyGuard&) = delete;
  void operator=(const ReentrancyGuard&) = delete;

} // namespace mozilla

#endif /* mozilla_ReentrancyGuard_h */