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