Bug 849918 - Initial support for PannerNode's 3D positional audio (equalpower panning...
[gecko.git] / gfx / 2d / SourceSurfaceDual.h
blob0b783cbb4c1061211b47b9d46d848a35a6b7227a
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
19 public:
20 SourceSurfaceDual(DrawTarget *aDTA, DrawTarget *aDTB)
21 : mA(aDTA->Snapshot())
22 , mB(aDTB->Snapshot())
23 { }
25 virtual SurfaceType GetType() const { return SURFACE_DUAL_DT; }
26 virtual IntSize GetSize() const { return mA->GetSize(); }
27 virtual SurfaceFormat GetFormat() const { return mA->GetFormat(); }
29 /* Readback from this surface type is not supported! */
30 virtual TemporaryRef<DataSourceSurface> GetDataSurface() { return nullptr; }
31 private:
32 friend class DualSurface;
33 friend class DualPattern;
35 RefPtr<SourceSurface> mA;
36 RefPtr<SourceSurface> mB;
42 #endif /* MOZILLA_GFX_SOURCESURFACEDUAL_H_ */