Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; 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_BASICCANVASLAYER_H
7 : #define GFX_BASICCANVASLAYER_H
8 :
9 : #include "BasicImplData.h" // for BasicImplData
10 : #include "BasicLayers.h" // for BasicLayerManager
11 : #include "CopyableCanvasLayer.h" // for CopyableCanvasLayer
12 : #include "Layers.h" // for CanvasLayer, etc
13 : #include "nsDebug.h" // for NS_ASSERTION
14 : #include "nsRegion.h" // for nsIntRegion
15 :
16 : namespace mozilla {
17 : namespace layers {
18 :
19 0 : class BasicCanvasLayer : public CopyableCanvasLayer,
20 : public BasicImplData
21 : {
22 : public:
23 0 : explicit BasicCanvasLayer(BasicLayerManager* aLayerManager) :
24 0 : CopyableCanvasLayer(aLayerManager, static_cast<BasicImplData*>(this))
25 0 : { }
26 :
27 0 : virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override
28 : {
29 0 : NS_ASSERTION(BasicManager()->InConstruction(),
30 : "Can only set properties in construction phase");
31 0 : CanvasLayer::SetVisibleRegion(aRegion);
32 0 : }
33 :
34 : virtual void Paint(gfx::DrawTarget* aDT,
35 : const gfx::Point& aDeviceOffset,
36 : Layer* aMaskLayer) override;
37 :
38 : protected:
39 :
40 : already_AddRefed<gfx::SourceSurface> UpdateSurface();
41 :
42 0 : BasicLayerManager* BasicManager()
43 : {
44 0 : return static_cast<BasicLayerManager*>(mManager);
45 : }
46 : };
47 :
48 : } // namespace layers
49 : } // namespace mozilla
50 :
51 : #endif
|