gfx/layers/composite/ImageLayerComposite.h

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:b8ef21928d61
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef GFX_ImageLayerComposite_H
7 #define GFX_ImageLayerComposite_H
8
9 #include "GLTextureImage.h" // for TextureImage
10 #include "ImageLayers.h" // for ImageLayer
11 #include "mozilla/Attributes.h" // for MOZ_OVERRIDE
12 #include "mozilla/RefPtr.h" // for RefPtr
13 #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc
14 #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc
15 #include "nsISupportsImpl.h" // for TextureImage::AddRef, etc
16 #include "nscore.h" // for nsACString
17
18 struct nsIntPoint;
19 struct nsIntRect;
20
21 namespace mozilla {
22 namespace layers {
23
24 class CompositableHost;
25 class ImageHost;
26 class Layer;
27
28 class ImageLayerComposite : public ImageLayer,
29 public LayerComposite
30 {
31 typedef gl::TextureImage TextureImage;
32
33 public:
34 ImageLayerComposite(LayerManagerComposite* aManager);
35
36 virtual ~ImageLayerComposite();
37
38 virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
39
40 virtual void Disconnect() MOZ_OVERRIDE;
41
42 virtual bool SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;
43
44 virtual Layer* GetLayer() MOZ_OVERRIDE;
45
46 virtual void RenderLayer(const nsIntRect& aClipRect);
47
48 virtual void ComputeEffectiveTransforms(const mozilla::gfx::Matrix4x4& aTransformToSurface) MOZ_OVERRIDE;
49
50 virtual void CleanupResources() MOZ_OVERRIDE;
51
52 CompositableHost* GetCompositableHost() MOZ_OVERRIDE;
53
54 virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
55
56 virtual const char* Name() const { return "ImageLayerComposite"; }
57
58 protected:
59 virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
60
61 private:
62 RefPtr<CompositableHost> mImageHost;
63 };
64
65 } /* layers */
66 } /* mozilla */
67
68 #endif /* GFX_ImageLayerComposite_H */

mercurial