|
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_ColorLayerComposite_H |
|
7 #define GFX_ColorLayerComposite_H |
|
8 |
|
9 #include "Layers.h" // for ColorLayer, etc |
|
10 #include "mozilla/Attributes.h" // for MOZ_OVERRIDE |
|
11 #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc |
|
12 #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc |
|
13 |
|
14 struct nsIntPoint; |
|
15 struct nsIntRect; |
|
16 |
|
17 namespace mozilla { |
|
18 namespace layers { |
|
19 |
|
20 class CompositableHost; |
|
21 |
|
22 class ColorLayerComposite : public ColorLayer, |
|
23 public LayerComposite |
|
24 { |
|
25 public: |
|
26 ColorLayerComposite(LayerManagerComposite *aManager) |
|
27 : ColorLayer(aManager, nullptr) |
|
28 , LayerComposite(aManager) |
|
29 { |
|
30 MOZ_COUNT_CTOR(ColorLayerComposite); |
|
31 mImplData = static_cast<LayerComposite*>(this); |
|
32 } |
|
33 ~ColorLayerComposite() |
|
34 { |
|
35 MOZ_COUNT_DTOR(ColorLayerComposite); |
|
36 Destroy(); |
|
37 } |
|
38 |
|
39 // LayerComposite Implementation |
|
40 virtual Layer* GetLayer() MOZ_OVERRIDE { return this; } |
|
41 |
|
42 virtual void Destroy() MOZ_OVERRIDE { mDestroyed = true; } |
|
43 |
|
44 virtual void RenderLayer(const nsIntRect& aClipRect) MOZ_OVERRIDE; |
|
45 virtual void CleanupResources() MOZ_OVERRIDE {}; |
|
46 |
|
47 CompositableHost* GetCompositableHost() MOZ_OVERRIDE { return nullptr; } |
|
48 |
|
49 virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; } |
|
50 |
|
51 virtual const char* Name() const MOZ_OVERRIDE { return "ColorLayerComposite"; } |
|
52 }; |
|
53 |
|
54 } /* layers */ |
|
55 } /* mozilla */ |
|
56 #endif /* GFX_ColorLayerComposite_H */ |