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