2012-04-04 00:25:52 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2012-04-04 00:25:52 +04:00
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_SOURCESURFACEDUAL_H_
|
|
|
|
#define MOZILLA_GFX_SOURCESURFACEDUAL_H_
|
|
|
|
|
|
|
|
#include "2D.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
class DualSurface;
|
|
|
|
class DualPattern;
|
|
|
|
|
|
|
|
class SourceSurfaceDual : public SourceSurface
|
|
|
|
{
|
|
|
|
public:
|
2014-02-24 17:23:37 +04:00
|
|
|
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceDual)
|
2012-04-04 00:25:52 +04:00
|
|
|
SourceSurfaceDual(DrawTarget *aDTA, DrawTarget *aDTB)
|
|
|
|
: mA(aDTA->Snapshot())
|
|
|
|
, mB(aDTB->Snapshot())
|
|
|
|
{ }
|
|
|
|
|
2014-01-10 22:55:24 +04:00
|
|
|
virtual SurfaceType GetType() const { return SurfaceType::DUAL_DT; }
|
2012-04-04 00:25:52 +04:00
|
|
|
virtual IntSize GetSize() const { return mA->GetSize(); }
|
|
|
|
virtual SurfaceFormat GetFormat() const { return mA->GetFormat(); }
|
|
|
|
|
|
|
|
/* Readback from this surface type is not supported! */
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<DataSourceSurface> GetDataSurface() { return nullptr; }
|
2012-04-04 00:25:52 +04:00
|
|
|
private:
|
|
|
|
friend class DualSurface;
|
|
|
|
friend class DualPattern;
|
|
|
|
|
|
|
|
RefPtr<SourceSurface> mA;
|
|
|
|
RefPtr<SourceSurface> mB;
|
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gfx
|
|
|
|
} // namespace mozilla
|
2012-04-04 00:25:52 +04:00
|
|
|
|
|
|
|
#endif /* MOZILLA_GFX_SOURCESURFACEDUAL_H_ */
|