gfx/layers/composite/ColorLayerComposite.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/composite/ColorLayerComposite.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef GFX_ColorLayerComposite_H
    1.10 +#define GFX_ColorLayerComposite_H
    1.11 +
    1.12 +#include "Layers.h"                     // for ColorLayer, etc
    1.13 +#include "mozilla/Attributes.h"         // for MOZ_OVERRIDE
    1.14 +#include "mozilla/layers/LayerManagerComposite.h"  // for LayerComposite, etc
    1.15 +#include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
    1.16 +
    1.17 +struct nsIntPoint;
    1.18 +struct nsIntRect;
    1.19 +
    1.20 +namespace mozilla {
    1.21 +namespace layers {
    1.22 +
    1.23 +class CompositableHost;
    1.24 +
    1.25 +class ColorLayerComposite : public ColorLayer,
    1.26 +                            public LayerComposite
    1.27 +{
    1.28 +public:
    1.29 +  ColorLayerComposite(LayerManagerComposite *aManager)
    1.30 +    : ColorLayer(aManager, nullptr)
    1.31 +    , LayerComposite(aManager)
    1.32 +  {
    1.33 +    MOZ_COUNT_CTOR(ColorLayerComposite);
    1.34 +    mImplData = static_cast<LayerComposite*>(this);
    1.35 +  }
    1.36 +  ~ColorLayerComposite()
    1.37 +  {
    1.38 +    MOZ_COUNT_DTOR(ColorLayerComposite);
    1.39 +    Destroy();
    1.40 +  }
    1.41 +
    1.42 +  // LayerComposite Implementation
    1.43 +  virtual Layer* GetLayer() MOZ_OVERRIDE { return this; }
    1.44 +
    1.45 +  virtual void Destroy() MOZ_OVERRIDE { mDestroyed = true; }
    1.46 +
    1.47 +  virtual void RenderLayer(const nsIntRect& aClipRect) MOZ_OVERRIDE;
    1.48 +  virtual void CleanupResources() MOZ_OVERRIDE {};
    1.49 +
    1.50 +  CompositableHost* GetCompositableHost() MOZ_OVERRIDE { return nullptr; }
    1.51 +
    1.52 +  virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
    1.53 +
    1.54 +  virtual const char* Name() const MOZ_OVERRIDE { return "ColorLayerComposite"; }
    1.55 +};
    1.56 +
    1.57 +} /* layers */
    1.58 +} /* mozilla */
    1.59 +#endif /* GFX_ColorLayerComposite_H */

mercurial