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_ImageLayerComposite_H michael@0: #define GFX_ImageLayerComposite_H michael@0: michael@0: #include "GLTextureImage.h" // for TextureImage michael@0: #include "ImageLayers.h" // for ImageLayer michael@0: #include "mozilla/Attributes.h" // for MOZ_OVERRIDE michael@0: #include "mozilla/RefPtr.h" // for RefPtr michael@0: #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc michael@0: #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc michael@0: #include "nsISupportsImpl.h" // for TextureImage::AddRef, etc michael@0: #include "nscore.h" // for nsACString 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: class ImageHost; michael@0: class Layer; michael@0: michael@0: class ImageLayerComposite : public ImageLayer, michael@0: public LayerComposite michael@0: { michael@0: typedef gl::TextureImage TextureImage; michael@0: michael@0: public: michael@0: ImageLayerComposite(LayerManagerComposite* aManager); michael@0: michael@0: virtual ~ImageLayerComposite(); michael@0: michael@0: virtual LayerRenderState GetRenderState() MOZ_OVERRIDE; michael@0: michael@0: virtual void Disconnect() MOZ_OVERRIDE; michael@0: michael@0: virtual bool SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE; michael@0: michael@0: virtual Layer* GetLayer() MOZ_OVERRIDE; michael@0: michael@0: virtual void RenderLayer(const nsIntRect& aClipRect); michael@0: michael@0: virtual void ComputeEffectiveTransforms(const mozilla::gfx::Matrix4x4& aTransformToSurface) MOZ_OVERRIDE; michael@0: michael@0: virtual void CleanupResources() MOZ_OVERRIDE; michael@0: michael@0: CompositableHost* GetCompositableHost() MOZ_OVERRIDE; michael@0: michael@0: virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; } michael@0: michael@0: virtual const char* Name() const { return "ImageLayerComposite"; } michael@0: michael@0: protected: michael@0: virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: RefPtr mImageHost; michael@0: }; michael@0: michael@0: } /* layers */ michael@0: } /* mozilla */ michael@0: michael@0: #endif /* GFX_ImageLayerComposite_H */