michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_ColorLayerComposite_H michael@0: #define GFX_ColorLayerComposite_H michael@0: michael@0: #include "Layers.h" // for ColorLayer, etc michael@0: #include "mozilla/Attributes.h" // for MOZ_OVERRIDE michael@0: #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc michael@0: #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc michael@0: michael@0: struct nsIntPoint; michael@0: struct nsIntRect; michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: class CompositableHost; michael@0: michael@0: class ColorLayerComposite : public ColorLayer, michael@0: public LayerComposite michael@0: { michael@0: public: michael@0: ColorLayerComposite(LayerManagerComposite *aManager) michael@0: : ColorLayer(aManager, nullptr) michael@0: , LayerComposite(aManager) michael@0: { michael@0: MOZ_COUNT_CTOR(ColorLayerComposite); michael@0: mImplData = static_cast(this); michael@0: } michael@0: ~ColorLayerComposite() michael@0: { michael@0: MOZ_COUNT_DTOR(ColorLayerComposite); michael@0: Destroy(); michael@0: } michael@0: michael@0: // LayerComposite Implementation michael@0: virtual Layer* GetLayer() MOZ_OVERRIDE { return this; } michael@0: michael@0: virtual void Destroy() MOZ_OVERRIDE { mDestroyed = true; } michael@0: michael@0: virtual void RenderLayer(const nsIntRect& aClipRect) MOZ_OVERRIDE; michael@0: virtual void CleanupResources() MOZ_OVERRIDE {}; michael@0: michael@0: CompositableHost* GetCompositableHost() MOZ_OVERRIDE { return nullptr; } michael@0: michael@0: virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; } michael@0: michael@0: virtual const char* Name() const MOZ_OVERRIDE { return "ColorLayerComposite"; } michael@0: }; michael@0: michael@0: } /* layers */ michael@0: } /* mozilla */ michael@0: #endif /* GFX_ColorLayerComposite_H */