gfx/2d/SourceSurfaceDual.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 20; 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 MOZILLA_GFX_SOURCESURFACEDUAL_H_
     7 #define MOZILLA_GFX_SOURCESURFACEDUAL_H_
     9 #include "2D.h"
    11 namespace mozilla {
    12 namespace gfx {
    14 class DualSurface;
    15 class DualPattern;
    17 class SourceSurfaceDual : public SourceSurface
    18 {
    19 public:
    20   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceDual)
    21   SourceSurfaceDual(DrawTarget *aDTA, DrawTarget *aDTB)
    22     : mA(aDTA->Snapshot())
    23     , mB(aDTB->Snapshot())
    24   { }
    26   virtual SurfaceType GetType() const { return SurfaceType::DUAL_DT; }
    27   virtual IntSize GetSize() const { return mA->GetSize(); }
    28   virtual SurfaceFormat GetFormat() const { return mA->GetFormat(); }
    30   /* Readback from this surface type is not supported! */
    31   virtual TemporaryRef<DataSourceSurface> GetDataSurface() { return nullptr; }
    32 private:
    33   friend class DualSurface;
    34   friend class DualPattern;
    36   RefPtr<SourceSurface> mA;
    37   RefPtr<SourceSurface> mB;
    38 };
    40 }
    41 }
    43 #endif /* MOZILLA_GFX_SOURCESURFACEDUAL_H_ */

mercurial