Bug 1638136 [wpt PR 23617] - Clipboard API Tests: Move permissions tests to WPT....
[gecko.git] / gfx / 2d / GradientStopsD2D.h
blob20e60eb1d0f079f0a9d325c874b60d56ff7e30ee
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_
10 #include "2D.h"
12 #include <d2d1.h>
14 namespace mozilla {
15 namespace gfx {
17 class GradientStopsD2D : public GradientStops {
18 public:
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();
31 private:
32 friend class DrawTargetD2D;
33 friend class DrawTargetD2D1;
35 mutable RefPtr<ID2D1GradientStopCollection> mStopCollection;
36 RefPtr<ID3D11Device> mDevice;
39 } // namespace gfx
40 } // namespace mozilla
42 #endif /* MOZILLA_GFX_GRADIENTSTOPSD2D_H_ */