2011-06-24 10:41:16 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 04:12:37 -07: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/. */
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
#ifndef MOZILLA_GFX_GRADIENTSTOPSD2D_H_
|
|
|
|
#define MOZILLA_GFX_GRADIENTSTOPSD2D_H_
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
#include "2D.h"
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-08-23 08:35:13 -07:00
|
|
|
#include <d2d1.h>
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
class GradientStopsD2D : public GradientStops
|
|
|
|
{
|
|
|
|
public:
|
2014-02-24 05:23:37 -08:00
|
|
|
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsD2D)
|
2015-01-27 16:54:19 -08:00
|
|
|
GradientStopsD2D(ID2D1GradientStopCollection *aStopCollection, ID3D11Device *aDevice)
|
2011-06-24 10:41:16 -07:00
|
|
|
: mStopCollection(aStopCollection)
|
2015-01-27 16:54:19 -08:00
|
|
|
, mDevice(aDevice)
|
2011-06-24 10:41:16 -07:00
|
|
|
{}
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2014-01-10 11:06:16 -08:00
|
|
|
virtual BackendType GetBackendType() const { return BackendType::DIRECT2D; }
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2015-01-27 16:54:19 -08:00
|
|
|
virtual bool IsValid() const MOZ_FINAL{ return mDevice == Factory::GetDirect3D11Device(); }
|
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
private:
|
|
|
|
friend class DrawTargetD2D;
|
2013-07-17 05:12:22 -07:00
|
|
|
friend class DrawTargetD2D1;
|
2011-05-26 12:41:33 -07:00
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
mutable RefPtr<ID2D1GradientStopCollection> mStopCollection;
|
2015-01-27 16:54:19 -08:00
|
|
|
RefPtr<ID3D11Device> mDevice;
|
2011-05-26 12:41:33 -07:00
|
|
|
};
|
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
}
|
2011-05-26 12:41:33 -07:00
|
|
|
}
|
|
|
|
|
2011-06-24 10:41:16 -07:00
|
|
|
#endif /* MOZILLA_GFX_GRADIENTSTOPSD2D_H_ */
|