/src/mozilla-central/gfx/layers/composite/ImageLayerComposite.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef GFX_ImageLayerComposite_H |
8 | | #define GFX_ImageLayerComposite_H |
9 | | |
10 | | #include "GLTextureImage.h" // for TextureImage |
11 | | #include "ImageLayers.h" // for ImageLayer |
12 | | #include "mozilla/Attributes.h" // for override |
13 | | #include "mozilla/gfx/Rect.h" |
14 | | #include "mozilla/RefPtr.h" // for RefPtr |
15 | | #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc |
16 | | #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc |
17 | | #include "nsISupportsImpl.h" // for TextureImage::AddRef, etc |
18 | | #include "nscore.h" // for nsACString |
19 | | #include "CompositableHost.h" // for CompositableHost |
20 | | |
21 | | namespace mozilla { |
22 | | namespace layers { |
23 | | |
24 | | class ImageHost; |
25 | | class Layer; |
26 | | |
27 | | class ImageLayerComposite : public ImageLayer, |
28 | | public LayerComposite |
29 | | { |
30 | | typedef gl::TextureImage TextureImage; |
31 | | |
32 | | public: |
33 | | explicit ImageLayerComposite(LayerManagerComposite* aManager); |
34 | | |
35 | | protected: |
36 | | virtual ~ImageLayerComposite(); |
37 | | |
38 | | public: |
39 | | virtual void Disconnect() override; |
40 | | |
41 | | virtual bool SetCompositableHost(CompositableHost* aHost) override; |
42 | | |
43 | | virtual Layer* GetLayer() override; |
44 | | |
45 | | virtual void SetLayerManager(HostLayerManager* aManager) override; |
46 | | |
47 | | virtual void RenderLayer(const gfx::IntRect& aClipRect, |
48 | | const Maybe<gfx::Polygon>& aGeometry) override; |
49 | | |
50 | | virtual void ComputeEffectiveTransforms(const mozilla::gfx::Matrix4x4& aTransformToSurface) override; |
51 | | |
52 | | virtual void CleanupResources() override; |
53 | | |
54 | | CompositableHost* GetCompositableHost() override; |
55 | | |
56 | | virtual void GenEffectChain(EffectChain& aEffect) override; |
57 | | |
58 | 0 | virtual HostLayer* AsHostLayer() override { return this; } |
59 | | |
60 | 0 | virtual const char* Name() const override { return "ImageLayerComposite"; } |
61 | | |
62 | | virtual bool IsOpaque() override; |
63 | | |
64 | | virtual nsIntRegion GetFullyRenderedRegion() override; |
65 | | |
66 | | protected: |
67 | | virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override; |
68 | | |
69 | | private: |
70 | | gfx::SamplingFilter GetSamplingFilter(); |
71 | | |
72 | | private: |
73 | | RefPtr<ImageHost> mImageHost; |
74 | | }; |
75 | | |
76 | | } // namespace layers |
77 | | } // namespace mozilla |
78 | | |
79 | | #endif /* GFX_ImageLayerComposite_H */ |