d2d1helper.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _INC_D2D1HELPER
  7. #define _INC_D2D1HELPER
  8. #ifndef D2D_USE_C_DEFINITIONS
  9. namespace D2D1 {
  10. D2D1FORCEINLINE D2D1_MATRIX_3X2_F IdentityMatrix();
  11. template<typename T> struct TypeTraits {
  12. typedef D2D1_POINT_2F Point;
  13. typedef D2D1_SIZE_F Size;
  14. typedef D2D1_RECT_F Rect;
  15. };
  16. template<> struct TypeTraits<UINT32> {
  17. typedef D2D1_POINT_2U Point;
  18. typedef D2D1_SIZE_U Size;
  19. typedef D2D1_RECT_U Rect;
  20. };
  21. static inline FLOAT FloatMax() {
  22. return 3.402823466e+38f;
  23. }
  24. template<typename T> D2D1FORCEINLINE typename TypeTraits<T>::Point Point2(T x, T y) {
  25. typename TypeTraits<T>::Point r = {x,y};
  26. return r;
  27. }
  28. D2D1FORCEINLINE D2D1_POINT_2F Point2F(FLOAT x = 0.f, FLOAT y = 0.f) {
  29. return Point2<FLOAT>(x, y);
  30. }
  31. D2D1FORCEINLINE D2D1_POINT_2U Point2U(UINT32 x = 0, UINT32 y = 0) {
  32. return Point2<UINT32>(x, y);
  33. }
  34. template<typename T> D2D1FORCEINLINE typename TypeTraits<T>::Size Size(T width, T height) {
  35. typename TypeTraits<T>::Size r = {width, height};
  36. return r;
  37. }
  38. D2D1FORCEINLINE D2D1_SIZE_F SizeF(FLOAT width = 0.0f, FLOAT height = 0.0f) {
  39. return Size<FLOAT>(width, height);
  40. }
  41. D2D1FORCEINLINE D2D1_SIZE_U SizeU(UINT32 width = 0, UINT32 height = 0) {
  42. return Size<UINT32>(width, height);
  43. }
  44. template<typename T> D2D1FORCEINLINE typename TypeTraits<T>::Rect Rect(T left, T top, T right, T bottom) {
  45. typename TypeTraits<T>::Rect r = {left, top, right, bottom};
  46. return r;
  47. }
  48. D2D1FORCEINLINE D2D1_RECT_F RectF(FLOAT left = 0.0f, FLOAT top = 0.0f, FLOAT right = 0.0f, FLOAT bottom = 0.0f) {
  49. return Rect<FLOAT>(left, top, right, bottom);
  50. }
  51. D2D1FORCEINLINE D2D1_RECT_U RectU(UINT32 left = 0, UINT32 top = 0, UINT32 right = 0, UINT32 bottom = 0) {
  52. return Rect<UINT32>(left, top, right, bottom);
  53. }
  54. D2D1FORCEINLINE D2D1_RECT_F InfiniteRect() {
  55. D2D1_RECT_F r = {-FloatMax(), -FloatMax(), FloatMax(), FloatMax()};
  56. return r;
  57. }
  58. D2D1FORCEINLINE D2D1_ARC_SEGMENT ArcSegment(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const FLOAT rotationAngle, D2D1_SWEEP_DIRECTION sweepDirection, D2D1_ARC_SIZE arcSize) {
  59. D2D1_ARC_SEGMENT r = {point, size, rotationAngle, sweepDirection, arcSize};
  60. return r;
  61. }
  62. D2D1FORCEINLINE D2D1_BEZIER_SEGMENT BezierSegment(const D2D1_POINT_2F &point1, const D2D1_POINT_2F &point2, const D2D1_POINT_2F &point3) {
  63. D2D1_BEZIER_SEGMENT r = {point1, point2, point3};
  64. return r;
  65. }
  66. D2D1FORCEINLINE D2D1_ELLIPSE Ellipse(const D2D1_POINT_2F &center, FLOAT radiusX, FLOAT radiusY) {
  67. D2D1_ELLIPSE r = {center, radiusX, radiusY};
  68. return r;
  69. }
  70. D2D1FORCEINLINE D2D1_ROUNDED_RECT RoundedRect(const D2D1_RECT_F &rect, FLOAT radiusX, FLOAT radiusY) {
  71. D2D1_ROUNDED_RECT r = {rect, radiusX, radiusY};
  72. return r;
  73. }
  74. D2D1FORCEINLINE D2D1_BRUSH_PROPERTIES BrushProperties(
  75. FLOAT opacity = 1.0f,
  76. const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix()) {
  77. D2D1_BRUSH_PROPERTIES r = {opacity, transform};
  78. return r;
  79. }
  80. D2D1FORCEINLINE D2D1_GRADIENT_STOP GradientStop(FLOAT position, const D2D1_COLOR_F &color) {
  81. D2D1_GRADIENT_STOP r = {position, color};
  82. return r;
  83. }
  84. D2D1FORCEINLINE D2D1_QUADRATIC_BEZIER_SEGMENT QuadraticBezierSegment(const D2D1_POINT_2F &point1, const D2D1_POINT_2F &point2) {
  85. D2D1_QUADRATIC_BEZIER_SEGMENT r = {point1, point2};
  86. return r;
  87. }
  88. D2D1FORCEINLINE D2D1_STROKE_STYLE_PROPERTIES StrokeStyleProperties(
  89. D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT,
  90. D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT,
  91. D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT,
  92. D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER,
  93. FLOAT miterLimit = 10.0f,
  94. D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID,
  95. FLOAT dashOffset = 0.0f) {
  96. D2D1_STROKE_STYLE_PROPERTIES r = {startCap, endCap, dashCap, lineJoin, miterLimit, dashStyle, dashOffset};
  97. return r;
  98. }
  99. D2D1FORCEINLINE D2D1_BITMAP_BRUSH_PROPERTIES BitmapBrushProperties(
  100. D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
  101. D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
  102. D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR) {
  103. D2D1_BITMAP_BRUSH_PROPERTIES r = {extendModeX, extendModeY, interpolationMode};
  104. return r;
  105. }
  106. D2D1FORCEINLINE D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES LinearGradientBrushProperties(const D2D1_POINT_2F &startPoint, const D2D1_POINT_2F &endPoint) {
  107. D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES r = {startPoint, endPoint};
  108. return r;
  109. }
  110. D2D1FORCEINLINE D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES RadialGradientBrushProperties(const D2D1_POINT_2F &center, const D2D1_POINT_2F &gradientOriginOffset, FLOAT radiusX, FLOAT radiusY) {
  111. D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES r = {center, gradientOriginOffset, radiusX, radiusY};
  112. return r;
  113. }
  114. D2D1FORCEINLINE D2D1_PIXEL_FORMAT PixelFormat(
  115. DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN,
  116. D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_UNKNOWN)
  117. {
  118. D2D1_PIXEL_FORMAT r = {dxgiFormat, alphaMode};
  119. return r;
  120. }
  121. D2D1FORCEINLINE D2D1_BITMAP_PROPERTIES BitmapProperties(CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(),
  122. FLOAT dpiX = 96.0f, FLOAT dpiY = 96.0f) {
  123. D2D1_BITMAP_PROPERTIES r = {pixelFormat, dpiX, dpiY};
  124. return r;
  125. }
  126. D2D1FORCEINLINE D2D1_RENDER_TARGET_PROPERTIES RenderTargetProperties(
  127. D2D1_RENDER_TARGET_TYPE type = D2D1_RENDER_TARGET_TYPE_DEFAULT,
  128. CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(),
  129. FLOAT dpiX = 0.0,
  130. FLOAT dpiY = 0.0,
  131. D2D1_RENDER_TARGET_USAGE usage = D2D1_RENDER_TARGET_USAGE_NONE,
  132. D2D1_FEATURE_LEVEL minLevel = D2D1_FEATURE_LEVEL_DEFAULT)
  133. {
  134. D2D1_RENDER_TARGET_PROPERTIES r = {type, pixelFormat, dpiX, dpiY, usage, minLevel};
  135. return r;
  136. }
  137. D2D1FORCEINLINE D2D1_HWND_RENDER_TARGET_PROPERTIES HwndRenderTargetProperties(
  138. HWND hwnd,
  139. D2D1_SIZE_U pixelSize = D2D1::Size(static_cast<UINT>(0), static_cast<UINT>(0)),
  140. D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS_NONE) {
  141. D2D1_HWND_RENDER_TARGET_PROPERTIES r = {hwnd, pixelSize, presentOptions};
  142. return r;
  143. }
  144. D2D1FORCEINLINE D2D1_LAYER_PARAMETERS LayerParameters(
  145. CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
  146. ID2D1Geometry *geometricMask = NULL,
  147. D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
  148. D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
  149. FLOAT opacity = 1.0,
  150. ID2D1Brush *opacityBrush = NULL,
  151. D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE) {
  152. D2D1_LAYER_PARAMETERS r =
  153. {contentBounds, geometricMask, maskAntialiasMode, maskTransform, opacity, opacityBrush, layerOptions };
  154. return r;
  155. }
  156. D2D1FORCEINLINE D2D1_DRAWING_STATE_DESCRIPTION DrawingStateDescription(
  157. D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
  158. D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT,
  159. D2D1_TAG tag1 = 0,
  160. D2D1_TAG tag2 = 0,
  161. const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix()) {
  162. D2D1_DRAWING_STATE_DESCRIPTION r = {antialiasMode, textAntialiasMode, tag1, tag2, transform};
  163. return r;
  164. }
  165. class ColorF : public D2D1_COLOR_F {
  166. public:
  167. enum Enum {
  168. AliceBlue = 0xf0f8ff,
  169. AntiqueWhite = 0xfaebd7,
  170. Aqua = 0x00ffff,
  171. Aquamarine = 0x7fffd4,
  172. Azure = 0xf0ffff,
  173. Beige = 0xf5f5dc,
  174. Bisque = 0xffe4c4,
  175. Black = 0x000000,
  176. BlanchedAlmond = 0xffebcd,
  177. Blue = 0x0000ff,
  178. BlueViolet = 0x8a2be2,
  179. Brown = 0xa52a2a,
  180. BurlyWood = 0xdeb887,
  181. CadetBlue = 0x5f9ea0,
  182. Chartreuse = 0x7fff00,
  183. Chocolate = 0xd2691e,
  184. Coral = 0xff7f50,
  185. CornflowerBlue = 0x6495ed,
  186. Cornsilk = 0xfff8dc,
  187. Crimson = 0xdc143c,
  188. Cyan = 0x00ffff,
  189. DarkBlue = 0x00008b,
  190. DarkCyan = 0x008b8b,
  191. DarkGoldenrod = 0xb8860b,
  192. DarkGray = 0xa9a9a9,
  193. DarkGreen = 0x006400,
  194. DarkKhaki = 0xbdb76b,
  195. DarkMagenta = 0x8b008b,
  196. DarkOliveGreen = 0x556B2f,
  197. DarkOrange = 0xff8c00,
  198. DarkOrchid = 0x9932cc,
  199. DarkRed = 0x8b0000,
  200. DarkSalmon = 0xe9967a,
  201. DarkSeaGreen = 0x8fbc8f,
  202. DarkSlateBlue = 0x483d8b,
  203. DarkSlateGray = 0x2f4f4f,
  204. DarkTurquoise = 0x00ced1,
  205. DarkViolet = 0x9400d3,
  206. DeepPink = 0xff1493,
  207. DeepSkyBlue = 0x00bfff,
  208. DimGray = 0x696969,
  209. DodgerBlue = 0x1e90ff,
  210. Firebrick = 0xb22222,
  211. FloralWhite = 0xfffaf0,
  212. ForestGreen = 0x228b22,
  213. Fuchsia = 0xff00ff,
  214. Gainsboro = 0xdcdcdc,
  215. GhostWhite = 0xf8f8ff,
  216. Gold = 0xffd700,
  217. Goldenrod = 0xdaa520,
  218. Gray = 0x808080,
  219. Green = 0x008000,
  220. GreenYellow = 0xadff2f,
  221. Honeydew = 0xf0fff0,
  222. HotPink = 0xff69b4,
  223. IndianRed = 0xcd5c5c,
  224. Indigo = 0x4b0082,
  225. Ivory = 0xfffff0,
  226. Khaki = 0xf0e68c,
  227. Lavender = 0xe6e6fa,
  228. LavenderBlush = 0xfff0f5,
  229. LawnGreen = 0x7cfc00,
  230. LemonChiffon = 0xfffacd,
  231. LightBlue = 0xadd8e6,
  232. LightCoral = 0xf08080,
  233. LightCyan = 0xe0ffff,
  234. LightGoldenrodYellow = 0xfafad2,
  235. LightGreen = 0x90ee90,
  236. LightGray = 0xd3d3d3,
  237. LightPink = 0xffb6c1,
  238. LightSalmon = 0xffa07a,
  239. LightSeaGreen = 0x20b2aa,
  240. LightSkyBlue = 0x87cefa,
  241. LightSlateGray = 0x778899,
  242. LightSteelBlue = 0xb0c4de,
  243. LightYellow = 0xffffe0,
  244. Lime = 0x00ff00,
  245. LimeGreen = 0x32cd32,
  246. Linen = 0xfaf0e6,
  247. Magenta = 0xff00ff,
  248. Maroon = 0x800000,
  249. MediumAquamarine = 0x66cdaa,
  250. MediumBlue = 0x0000cd,
  251. MediumOrchid = 0xba55d3,
  252. MediumPurple = 0x9370db,
  253. MediumSeaGreen = 0x3cb371,
  254. MediumSlateBlue = 0x7b68ee,
  255. MediumSpringGreen = 0x00fa9a,
  256. MediumTurquoise = 0x48d1cc,
  257. MediumVioletRed = 0xc71585,
  258. MidnightBlue = 0x191970,
  259. MintCream = 0xf5fffa,
  260. MistyRose = 0xffe4e1,
  261. Moccasin = 0xffe4b5,
  262. NavajoWhite = 0xffdead,
  263. Navy = 0x000080,
  264. OldLace = 0xfdf5e6,
  265. Olive = 0x808000,
  266. OliveDrab = 0x6b8e23,
  267. Orange = 0xffa500,
  268. OrangeRed = 0xff4500,
  269. Orchid = 0xda70d6,
  270. PaleGoldenrod = 0xeee8aa,
  271. PaleGreen = 0x98fb98,
  272. PaleTurquoise = 0xafeeee,
  273. PaleVioletRed = 0xdb7093,
  274. PapayaWhip = 0xffefd5,
  275. PeachPuff = 0xffdab9,
  276. Peru = 0xcd853f,
  277. Pink = 0xffc0cb,
  278. Plum = 0xdda0dd,
  279. PowderBlue = 0xb0e0e6,
  280. Purple = 0x800080,
  281. Red = 0xff0000,
  282. RosyBrown = 0xbc8f8f,
  283. RoyalBlue = 0x4169e1,
  284. SaddleBrown = 0x8b4513,
  285. Salmon = 0xfa8072,
  286. SandyBrown = 0xf4a460,
  287. SeaGreen = 0x2e8B57,
  288. SeaShell = 0xfff5ee,
  289. Sienna = 0xa0522d,
  290. Silver = 0xc0c0c0,
  291. SkyBlue = 0x87ceeb,
  292. SlateBlue = 0x6a5acd,
  293. SlateGray = 0x708090,
  294. Snow = 0xfffafa,
  295. SpringGreen = 0x00ff7f,
  296. SteelBlue = 0x4682B4,
  297. Tan = 0xd2b48c,
  298. Teal = 0x008080,
  299. Thistle = 0xd8bfd8,
  300. Tomato = 0xff6347,
  301. Turquoise = 0x40e0d0,
  302. Violet = 0xee82ee,
  303. Wheat = 0xf5deb3,
  304. White = 0xffffff,
  305. WhiteSmoke = 0xf5f5f5,
  306. Yellow = 0xffff00,
  307. YellowGreen = 0x9acd32
  308. };
  309. FORCEINLINE ColorF(UINT32 rgb, FLOAT _a = 1.0) {
  310. init(rgb, _a);
  311. }
  312. D2D1FORCEINLINE ColorF(Enum knownColor, FLOAT _a = 1.0) {
  313. init(knownColor, _a);
  314. }
  315. D2D1FORCEINLINE ColorF(FLOAT _r, FLOAT _g, FLOAT _b, FLOAT _a = 1.0) {
  316. r = _r;
  317. g = _g;
  318. b = _b;
  319. a = _a;
  320. }
  321. private:
  322. D2D1FORCEINLINE void init(UINT32 rgb, FLOAT _a) {
  323. r = static_cast<float>((rgb>>16)&0xff)/255.0f;
  324. g = static_cast<float>((rgb>>8)&0xff)/255.0f;
  325. b = static_cast<float>(rgb&0xff)/255.0f;
  326. a = _a;
  327. }
  328. };
  329. class Matrix3x2F : public D2D1_MATRIX_3X2_F {
  330. public:
  331. D2D1FORCEINLINE Matrix3x2F(FLOAT __11, FLOAT __12, FLOAT __21, FLOAT __22, FLOAT __31, FLOAT __32) {
  332. _11 = __11;
  333. _12 = __12;
  334. _21 = __21;
  335. _22 = __22;
  336. _31 = __31;
  337. _32 = __32;
  338. }
  339. D2D1FORCEINLINE Matrix3x2F() {}
  340. static D2D1FORCEINLINE Matrix3x2F Identity() {
  341. return Matrix3x2F(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
  342. }
  343. static D2D1FORCEINLINE Matrix3x2F Translation(D2D1_SIZE_F size) {
  344. return Translation(size.width, size.height);
  345. }
  346. static D2D1FORCEINLINE Matrix3x2F Translation(FLOAT x, FLOAT y) {
  347. return Matrix3x2F(1.0f, 0.0f, 0.0f, 1.0f, x, y);
  348. }
  349. static D2D1FORCEINLINE Matrix3x2F Scale(D2D1_SIZE_F size, D2D1_POINT_2F center = D2D1::Point2F()) {
  350. return Scale(size.width, size.height, center);
  351. }
  352. static D2D1FORCEINLINE Matrix3x2F Scale(FLOAT x, FLOAT y, D2D1_POINT_2F center = D2D1::Point2F()) {
  353. return Matrix3x2F(x, 0.0f, 0.0f, y, center.x - x*center.x, center.y - y*center.y);
  354. }
  355. static D2D1FORCEINLINE Matrix3x2F Rotation(FLOAT angle, D2D1_POINT_2F center = D2D1::Point2F()) {
  356. Matrix3x2F r;
  357. D2D1MakeRotateMatrix(angle, center, &r);
  358. return r;
  359. }
  360. static D2D1FORCEINLINE Matrix3x2F Skew(FLOAT angleX, FLOAT angleY, D2D1_POINT_2F center = D2D1::Point2F()) {
  361. Matrix3x2F r;
  362. D2D1MakeSkewMatrix(angleX, angleY, center, &r);
  363. return r;
  364. }
  365. static inline const Matrix3x2F *ReinterpretBaseType(const D2D1_MATRIX_3X2_F *pMatrix) {
  366. return static_cast<const Matrix3x2F *>(pMatrix);
  367. }
  368. static inline Matrix3x2F *ReinterpretBaseType(D2D1_MATRIX_3X2_F *pMatrix) {
  369. return static_cast<Matrix3x2F *>(pMatrix);
  370. }
  371. inline FLOAT Determinant() const {
  372. return _11*_22 - _12*_21;
  373. }
  374. inline bool IsInvertible() const {
  375. return !!D2D1IsMatrixInvertible(this);
  376. }
  377. inline bool Invert() {
  378. return !!D2D1InvertMatrix(this);
  379. }
  380. inline bool IsIdentity() const {
  381. return _11 == 1.0f && _12 == 0.0f && _21 == 0.0f && _22 == 1.0f && _31 == 0.0f && _32 == 0.0f;
  382. }
  383. inline void SetProduct(const Matrix3x2F &a, const Matrix3x2F &b) {
  384. _11 = a._11*b._11 + a._12*b._21;
  385. _12 = a._11*b._12 + a._12*b._22;
  386. _21 = a._21*b._11 + a._22*b._21;
  387. _22 = a._21*b._12 + a._22*b._22;
  388. _31 = a._31*b._11 + a._32*b._21 + b._31;
  389. _32 = a._31*b._12 + a._32*b._22 + b._32;
  390. }
  391. D2D1FORCEINLINE Matrix3x2F operator*(const Matrix3x2F &matrix) const {
  392. Matrix3x2F r;
  393. r.SetProduct(*this, matrix);
  394. return r;
  395. }
  396. D2D1FORCEINLINE D2D1_POINT_2F TransformPoint(D2D1_POINT_2F point) const {
  397. return Point2F(point.x*_11 + point.y*_21 + _31, point.x*_12 + point.y*_22 + _32);
  398. }
  399. };
  400. D2D1FORCEINLINE D2D1_POINT_2F operator*(const D2D1_POINT_2F &point, const D2D1_MATRIX_3X2_F &matrix) {
  401. return Matrix3x2F::ReinterpretBaseType(&matrix)->TransformPoint(point);
  402. }
  403. D2D1FORCEINLINE D2D1_MATRIX_3X2_F IdentityMatrix() {
  404. return Matrix3x2F::Identity();
  405. }
  406. }
  407. D2D1FORCEINLINE D2D1_MATRIX_3X2_F operator*(const D2D1_MATRIX_3X2_F &matrix1, const D2D1_MATRIX_3X2_F &matrix2) {
  408. D2D1::Matrix3x2F r;
  409. r.SetProduct(*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix1), *D2D1::Matrix3x2F::ReinterpretBaseType(&matrix2));
  410. return r;
  411. }
  412. #endif /* D2D_USE_C_DEFINITIONS */
  413. #endif /*_INC_D2D1HELPER*/