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.

     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/. */
     6 #ifndef GFX_BASICCANVASLAYER_H
     7 #define GFX_BASICCANVASLAYER_H
     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
    16 class gfxContext;
    18 namespace mozilla {
    19 namespace layers {
    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   { }
    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   }
    37   virtual void Paint(gfx::DrawTarget* aDT,
    38                      const gfx::Point& aDeviceOffset,
    39                      Layer* aMaskLayer) MOZ_OVERRIDE;
    41 protected:
    42   BasicLayerManager* BasicManager()
    43   {
    44     return static_cast<BasicLayerManager*>(mManager);
    45   }
    46 };
    48 }
    49 }
    51 #endif

mercurial