author Chris Jones <>
Mon, 19 Nov 2012 09:58:38 -0800
changeset 113713 cf8750abee06cde395c659f8ecd8ae019d7512e3
parent 98649 7bcd7c51ce46e9aa5886f570eca661f39b3664c6
permissions -rw-r--r--
Bug 804852: Support for the hwc implementation of Composer2D. r=mattwoodrow,mwu,roc sr=roc This is a rollup of the following patches part 0: Add a dynamic cast to ColorLayer* part 1: Add a Composer2D interface to enable implementations to more efficiently compose layer trees part 2: Let widgets expose Composer2Ds, if they have them part 3: Expose a layers ogl "friend" API that Composer2D will consume part 4: Hook Composer2D into the LayerManagerOGL rendering pipeline part 5: Implement all the goop to let widget/gonk use a Composer2D (HwcComposer2D)

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 */

#ifndef gfxCrashReporterUtils_h__
#define gfxCrashReporterUtils_h__

#include "gfxCore.h"

namespace mozilla {

/** \class ScopedGfxFeatureReporter
  * On creation, adds "FeatureName?" to AppNotes
  * On destruction, adds "FeatureName-", or "FeatureName+" if you called SetSuccessful().
  * Any such string is added at most once to AppNotes, and is subsequently skipped.
  * This ScopedGfxFeatureReporter class is designed to be fool-proof to use in functions that
  * have many exit points. We don't want to encourage having function with many exit points.
  * It just happens that our graphics features initialization functions are like that.
class NS_GFX ScopedGfxFeatureReporter
  ScopedGfxFeatureReporter(const char *aFeature, bool force = false)
    : mFeature(aFeature), mStatusChar('-')
    WriteAppNote(force ? '!' : '?');
  ~ScopedGfxFeatureReporter() {
  void SetSuccessful() { mStatusChar = '+'; }

  class AppNoteWritingRunnable;

  const char *mFeature;
  char mStatusChar;

  void WriteAppNote(char statusChar);

} // end namespace mozilla

#endif // gfxCrashReporterUtils_h__