1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GFX_GRADIENTSTOPSD2D_H_
8 #define MOZILLA_GFX_GRADIENTSTOPSD2D_H_
17 class GradientStopsD2D
: public GradientStops
{
19 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsD2D
, override
)
21 GradientStopsD2D(ID2D1GradientStopCollection
* aStopCollection
,
22 ID3D11Device
* aDevice
)
23 : mStopCollection(aStopCollection
), mDevice(aDevice
) {}
25 virtual BackendType
GetBackendType() const { return BackendType::DIRECT2D
; }
27 bool IsValid() const final
{
28 return mDevice
== Factory::GetDirect3D11Device();
32 friend class DrawTargetD2D
;
33 friend class DrawTargetD2D1
;
35 mutable RefPtr
<ID2D1GradientStopCollection
> mStopCollection
;
36 RefPtr
<ID3D11Device
> mDevice
;
40 } // namespace mozilla
42 #endif /* MOZILLA_GFX_GRADIENTSTOPSD2D_H_ */