|
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 class gfxContext; |
|
17 |
|
18 namespace mozilla { |
|
19 namespace layers { |
|
20 |
|
21 class BasicCanvasLayer : public CopyableCanvasLayer, |
|
22 public BasicImplData |
|
23 { |
|
24 public: |
|
25 BasicCanvasLayer(BasicLayerManager* aLayerManager) : |
|
26 CopyableCanvasLayer(aLayerManager, |
|
27 static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())) |
|
28 { } |
|
29 |
|
30 virtual void SetVisibleRegion(const nsIntRegion& aRegion) |
|
31 { |
|
32 NS_ASSERTION(BasicManager()->InConstruction(), |
|
33 "Can only set properties in construction phase"); |
|
34 CanvasLayer::SetVisibleRegion(aRegion); |
|
35 } |
|
36 |
|
37 virtual void Paint(gfx::DrawTarget* aDT, |
|
38 const gfx::Point& aDeviceOffset, |
|
39 Layer* aMaskLayer) MOZ_OVERRIDE; |
|
40 |
|
41 protected: |
|
42 BasicLayerManager* BasicManager() |
|
43 { |
|
44 return static_cast<BasicLayerManager*>(mManager); |
|
45 } |
|
46 }; |
|
47 |
|
48 } |
|
49 } |
|
50 |
|
51 #endif |