/src/mozilla-central/gfx/layers/basic/BasicCanvasLayer.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_BASICCANVASLAYER_H |
8 | | #define GFX_BASICCANVASLAYER_H |
9 | | |
10 | | #include "BasicImplData.h" // for BasicImplData |
11 | | #include "BasicLayers.h" // for BasicLayerManager |
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 | | class BasicCanvasLayer : public CanvasLayer, |
20 | | public BasicImplData |
21 | | { |
22 | | public: |
23 | | explicit BasicCanvasLayer(BasicLayerManager* aLayerManager) : |
24 | | CanvasLayer(aLayerManager, static_cast<BasicImplData*>(this)) |
25 | 0 | { } |
26 | | |
27 | | virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override |
28 | 0 | { |
29 | 0 | NS_ASSERTION(BasicManager()->InConstruction(), |
30 | 0 | "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 | | BasicLayerManager* BasicManager() |
40 | 0 | { |
41 | 0 | return static_cast<BasicLayerManager*>(mManager); |
42 | 0 | } |
43 | | |
44 | | CanvasRenderer* CreateCanvasRendererInternal() override; |
45 | | }; |
46 | | |
47 | | } // namespace layers |
48 | | } // namespace mozilla |
49 | | |
50 | | #endif |