michael@0: /* -*- Mode: C++; tab-width: 20; 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 MOZILLA_GFX_SOURCESURFACEDUAL_H_ michael@0: #define MOZILLA_GFX_SOURCESURFACEDUAL_H_ michael@0: michael@0: #include "2D.h" michael@0: michael@0: namespace mozilla { michael@0: namespace gfx { michael@0: michael@0: class DualSurface; michael@0: class DualPattern; michael@0: michael@0: class SourceSurfaceDual : public SourceSurface michael@0: { michael@0: public: michael@0: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceDual) michael@0: SourceSurfaceDual(DrawTarget *aDTA, DrawTarget *aDTB) michael@0: : mA(aDTA->Snapshot()) michael@0: , mB(aDTB->Snapshot()) michael@0: { } michael@0: michael@0: virtual SurfaceType GetType() const { return SurfaceType::DUAL_DT; } michael@0: virtual IntSize GetSize() const { return mA->GetSize(); } michael@0: virtual SurfaceFormat GetFormat() const { return mA->GetFormat(); } michael@0: michael@0: /* Readback from this surface type is not supported! */ michael@0: virtual TemporaryRef GetDataSurface() { return nullptr; } michael@0: private: michael@0: friend class DualSurface; michael@0: friend class DualPattern; michael@0: michael@0: RefPtr mA; michael@0: RefPtr mB; michael@0: }; michael@0: michael@0: } michael@0: } michael@0: michael@0: #endif /* MOZILLA_GFX_SOURCESURFACEDUAL_H_ */