michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_BASICCANVASLAYER_H michael@0: #define GFX_BASICCANVASLAYER_H michael@0: michael@0: #include "BasicImplData.h" // for BasicImplData michael@0: #include "BasicLayers.h" // for BasicLayerManager michael@0: #include "CopyableCanvasLayer.h" // for CopyableCanvasLayer michael@0: #include "Layers.h" // for CanvasLayer, etc michael@0: #include "nsDebug.h" // for NS_ASSERTION michael@0: #include "nsRegion.h" // for nsIntRegion michael@0: michael@0: class gfxContext; michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: class BasicCanvasLayer : public CopyableCanvasLayer, michael@0: public BasicImplData michael@0: { michael@0: public: michael@0: BasicCanvasLayer(BasicLayerManager* aLayerManager) : michael@0: CopyableCanvasLayer(aLayerManager, michael@0: static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) michael@0: { } michael@0: michael@0: virtual void SetVisibleRegion(const nsIntRegion& aRegion) michael@0: { michael@0: NS_ASSERTION(BasicManager()->InConstruction(), michael@0: "Can only set properties in construction phase"); michael@0: CanvasLayer::SetVisibleRegion(aRegion); michael@0: } michael@0: michael@0: virtual void Paint(gfx::DrawTarget* aDT, michael@0: const gfx::Point& aDeviceOffset, michael@0: Layer* aMaskLayer) MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: BasicLayerManager* BasicManager() michael@0: { michael@0: return static_cast(mManager); michael@0: } michael@0: }; michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif