/work/obj-fuzz/dist/include/mozilla/layers/PaintedLayerComposite.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_PaintedLayerComposite_H |
8 | | #define GFX_PaintedLayerComposite_H |
9 | | |
10 | | #include "Layers.h" // for Layer (ptr only), etc |
11 | | #include "mozilla/gfx/Rect.h" |
12 | | #include "mozilla/Attributes.h" // for override |
13 | | #include "mozilla/RefPtr.h" // for RefPtr |
14 | | #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc |
15 | | #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc |
16 | | #include "nsRegion.h" // for nsIntRegion |
17 | | #include "nscore.h" // for nsACString |
18 | | |
19 | | namespace mozilla { |
20 | | namespace layers { |
21 | | |
22 | | /** |
23 | | * PaintedLayers use ContentHosts for their compsositable host. |
24 | | * By using different ContentHosts, PaintedLayerComposite support tiled and |
25 | | * non-tiled PaintedLayers and single or double buffering. |
26 | | */ |
27 | | |
28 | | class CompositableHost; |
29 | | class ContentHost; |
30 | | |
31 | | class PaintedLayerComposite : public PaintedLayer, |
32 | | public LayerComposite |
33 | | { |
34 | | public: |
35 | | explicit PaintedLayerComposite(LayerManagerComposite *aManager); |
36 | | |
37 | | protected: |
38 | | virtual ~PaintedLayerComposite(); |
39 | | |
40 | | public: |
41 | | virtual void Disconnect() override; |
42 | | |
43 | | CompositableHost* GetCompositableHost() override; |
44 | | |
45 | | virtual void Destroy() override; |
46 | | |
47 | | virtual Layer* GetLayer() override; |
48 | | |
49 | | virtual void SetLayerManager(HostLayerManager* aManager) override; |
50 | | |
51 | | virtual void RenderLayer(const gfx::IntRect& aClipRect, |
52 | | const Maybe<gfx::Polygon>& aGeometry) override; |
53 | | |
54 | | virtual void CleanupResources() override; |
55 | | |
56 | | virtual bool IsOpaque() override; |
57 | | |
58 | | virtual void GenEffectChain(EffectChain& aEffect) override; |
59 | | |
60 | | virtual bool SetCompositableHost(CompositableHost* aHost) override; |
61 | | |
62 | 0 | virtual HostLayer* AsHostLayer() override { return this; } |
63 | | |
64 | | virtual void InvalidateRegion(const nsIntRegion& aRegion) override |
65 | 0 | { |
66 | 0 | MOZ_CRASH("PaintedLayerComposites can't fill invalidated regions"); |
67 | 0 | } |
68 | | |
69 | | const virtual gfx::TiledIntRegion& GetInvalidRegion() override; |
70 | | |
71 | | MOZ_LAYER_DECL_NAME("PaintedLayerComposite", TYPE_PAINTED) |
72 | | |
73 | | protected: |
74 | | |
75 | | virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override; |
76 | | |
77 | | private: |
78 | 0 | gfx::SamplingFilter GetSamplingFilter() { return gfx::SamplingFilter::LINEAR; } |
79 | | |
80 | | private: |
81 | | RefPtr<ContentHost> mBuffer; |
82 | | }; |
83 | | |
84 | | } // namespace layers |
85 | | } // namespace mozilla |
86 | | |
87 | | #endif /* GFX_PaintedLayerComposite_H */ |