1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/layers/composite/ImageLayerComposite.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 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_ImageLayerComposite_H 1.10 +#define GFX_ImageLayerComposite_H 1.11 + 1.12 +#include "GLTextureImage.h" // for TextureImage 1.13 +#include "ImageLayers.h" // for ImageLayer 1.14 +#include "mozilla/Attributes.h" // for MOZ_OVERRIDE 1.15 +#include "mozilla/RefPtr.h" // for RefPtr 1.16 +#include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc 1.17 +#include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc 1.18 +#include "nsISupportsImpl.h" // for TextureImage::AddRef, etc 1.19 +#include "nscore.h" // for nsACString 1.20 + 1.21 +struct nsIntPoint; 1.22 +struct nsIntRect; 1.23 + 1.24 +namespace mozilla { 1.25 +namespace layers { 1.26 + 1.27 +class CompositableHost; 1.28 +class ImageHost; 1.29 +class Layer; 1.30 + 1.31 +class ImageLayerComposite : public ImageLayer, 1.32 + public LayerComposite 1.33 +{ 1.34 + typedef gl::TextureImage TextureImage; 1.35 + 1.36 +public: 1.37 + ImageLayerComposite(LayerManagerComposite* aManager); 1.38 + 1.39 + virtual ~ImageLayerComposite(); 1.40 + 1.41 + virtual LayerRenderState GetRenderState() MOZ_OVERRIDE; 1.42 + 1.43 + virtual void Disconnect() MOZ_OVERRIDE; 1.44 + 1.45 + virtual bool SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE; 1.46 + 1.47 + virtual Layer* GetLayer() MOZ_OVERRIDE; 1.48 + 1.49 + virtual void RenderLayer(const nsIntRect& aClipRect); 1.50 + 1.51 + virtual void ComputeEffectiveTransforms(const mozilla::gfx::Matrix4x4& aTransformToSurface) MOZ_OVERRIDE; 1.52 + 1.53 + virtual void CleanupResources() MOZ_OVERRIDE; 1.54 + 1.55 + CompositableHost* GetCompositableHost() MOZ_OVERRIDE; 1.56 + 1.57 + virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; } 1.58 + 1.59 + virtual const char* Name() const { return "ImageLayerComposite"; } 1.60 + 1.61 +protected: 1.62 + virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE; 1.63 + 1.64 +private: 1.65 + RefPtr<CompositableHost> mImageHost; 1.66 +}; 1.67 + 1.68 +} /* layers */ 1.69 +} /* mozilla */ 1.70 + 1.71 +#endif /* GFX_ImageLayerComposite_H */