gfx/layers/basic/BasicCanvasLayer.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef GFX_BASICCANVASLAYER_H
michael@0 7 #define GFX_BASICCANVASLAYER_H
michael@0 8
michael@0 9 #include "BasicImplData.h" // for BasicImplData
michael@0 10 #include "BasicLayers.h" // for BasicLayerManager
michael@0 11 #include "CopyableCanvasLayer.h" // for CopyableCanvasLayer
michael@0 12 #include "Layers.h" // for CanvasLayer, etc
michael@0 13 #include "nsDebug.h" // for NS_ASSERTION
michael@0 14 #include "nsRegion.h" // for nsIntRegion
michael@0 15
michael@0 16 class gfxContext;
michael@0 17
michael@0 18 namespace mozilla {
michael@0 19 namespace layers {
michael@0 20
michael@0 21 class BasicCanvasLayer : public CopyableCanvasLayer,
michael@0 22 public BasicImplData
michael@0 23 {
michael@0 24 public:
michael@0 25 BasicCanvasLayer(BasicLayerManager* aLayerManager) :
michael@0 26 CopyableCanvasLayer(aLayerManager,
michael@0 27 static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
michael@0 28 { }
michael@0 29
michael@0 30 virtual void SetVisibleRegion(const nsIntRegion& aRegion)
michael@0 31 {
michael@0 32 NS_ASSERTION(BasicManager()->InConstruction(),
michael@0 33 "Can only set properties in construction phase");
michael@0 34 CanvasLayer::SetVisibleRegion(aRegion);
michael@0 35 }
michael@0 36
michael@0 37 virtual void Paint(gfx::DrawTarget* aDT,
michael@0 38 const gfx::Point& aDeviceOffset,
michael@0 39 Layer* aMaskLayer) MOZ_OVERRIDE;
michael@0 40
michael@0 41 protected:
michael@0 42 BasicLayerManager* BasicManager()
michael@0 43 {
michael@0 44 return static_cast<BasicLayerManager*>(mManager);
michael@0 45 }
michael@0 46 };
michael@0 47
michael@0 48 }
michael@0 49 }
michael@0 50
michael@0 51 #endif

mercurial