https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a3c77dc2fde6cae32f9a…
commit 1a3c77dc2fde6cae32f9ad38f1515cc0feababb0
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Dec 31 17:53:35 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Dec 31 17:53:35 2019 +0900
[SDK][INCLUDE] Move Gdiplus::TextureBrush codes (#2208)
Move the code into the place it should be in. CORE-16585
---
sdk/include/psdk/gdiplusbrush.h | 68 ++++++++++++++++++++++++++++++++++-----
sdk/include/psdk/gdiplusheaders.h | 64 ++++--------------------------------
2 files changed, 67 insertions(+), 65 deletions(-)
diff --git a/sdk/include/psdk/gdiplusbrush.h b/sdk/include/psdk/gdiplusbrush.h
index afee9fb94bb..3ee939bb30e 100644
--- a/sdk/include/psdk/gdiplusbrush.h
+++ b/sdk/include/psdk/gdiplusbrush.h
@@ -495,18 +495,70 @@ class SolidBrush : Brush
}
};
+// get native
+GpImage *&
+getNat(const Image *image);
+
class TextureBrush : Brush
{
public:
- // Defined in "gdiplusheaders.h":
- TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect);
- TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes);
- TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT
dstHeight);
- TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth,
REAL dstHeight);
- TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes);
- TextureBrush(Image *image, WrapMode wrapMode);
- TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect);
+ TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect)
+ {
+ GpTexture *texture = NULL;
+ lastStatus = DllExports::GdipCreateTexture2(
+ getNat(image), wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height,
&texture);
+ SetNativeBrush(texture);
+ }
+
+ TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes)
+ {
+ GpTexture *texture = NULL;
+ GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr
: NULL;
+ lastStatus = DllExports::GdipCreateTextureIA(
+ getNat(image), attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height,
&texture);
+ SetNativeBrush(texture);
+ }
+
+ TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT
dstHeight)
+ {
+ GpTexture *texture = NULL;
+ lastStatus =
+ DllExports::GdipCreateTexture2I(getNat(image), wrapMode, dstX, dstY,
dstWidth, dstHeight, &texture);
+ SetNativeBrush(texture);
+ }
+ TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth,
REAL dstHeight)
+ {
+ GpTexture *texture = NULL;
+ lastStatus = DllExports::GdipCreateTexture2(getNat(image), wrapMode, dstX, dstY,
dstWidth, dstHeight, &texture);
+ SetNativeBrush(texture);
+ }
+
+ TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes)
+ {
+ GpTexture *texture = NULL;
+ GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr
: NULL;
+ lastStatus = DllExports::GdipCreateTextureIA(
+ getNat(image), attrs, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height,
&texture);
+ SetNativeBrush(texture);
+ }
+
+ TextureBrush(Image *image, WrapMode wrapMode)
+ {
+ GpTexture *texture = NULL;
+ lastStatus = DllExports::GdipCreateTexture(getNat(image), wrapMode,
&texture);
+ SetNativeBrush(texture);
+ }
+
+ TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect)
+ {
+ GpTexture *texture = NULL;
+ lastStatus = DllExports::GdipCreateTexture2I(
+ getNat(image), wrapMode, dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height,
&texture);
+ SetNativeBrush(texture);
+ }
+
+ // Defined in "gdiplusheaders.h":
Image *
GetImage() const;
diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h
index 4c464d5669c..c28e78fd5a1 100644
--- a/sdk/include/psdk/gdiplusheaders.h
+++ b/sdk/include/psdk/gdiplusheaders.h
@@ -377,6 +377,13 @@ class Image : public GdiplusBase
Image(const Image &);
Image &
operator=(const Image &);
+
+ // get native
+ friend inline GpImage *&
+ getNat(const Image *image)
+ {
+ return const_cast<Image *>(image)->nativeImage;
+ }
};
class Bitmap : public Image
@@ -1446,63 +1453,6 @@ class CustomLineCap : public GdiplusBase
}
};
-inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const RectF
&dstRect)
-{
- GpTexture *texture = NULL;
- lastStatus = DllExports::GdipCreateTexture2(
- image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width,
dstRect.Height, &texture);
- SetNativeBrush(texture);
-}
-
-inline TextureBrush::TextureBrush(Image *image, Rect &dstRect, ImageAttributes
*imageAttributes)
-{
- GpTexture *texture = NULL;
- GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr :
NULL;
- lastStatus = DllExports::GdipCreateTextureIA(
- image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width,
dstRect.Height, &texture);
- SetNativeBrush(texture);
-}
-
-inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY,
INT dstWidth, INT dstHeight)
-{
- GpTexture *texture = NULL;
- lastStatus =
- DllExports::GdipCreateTexture2I(image->nativeImage, wrapMode, dstX, dstY,
dstWidth, dstHeight, &texture);
- SetNativeBrush(texture);
-}
-
-inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY,
REAL dstWidth, REAL dstHeight)
-{
- GpTexture *texture = NULL;
- lastStatus =
- DllExports::GdipCreateTexture2(image->nativeImage, wrapMode, dstX, dstY,
dstWidth, dstHeight, &texture);
- SetNativeBrush(texture);
-}
-
-inline TextureBrush::TextureBrush(Image *image, RectF &dstRect, ImageAttributes
*imageAttributes)
-{
- GpTexture *texture = NULL;
- GpImageAttributes *attrs = imageAttributes ? imageAttributes->nativeImageAttr :
NULL;
- lastStatus = DllExports::GdipCreateTextureIA(
- image->nativeImage, attrs, dstRect.X, dstRect.Y, dstRect.Width,
dstRect.Height, &texture);
- SetNativeBrush(texture);
-}
-
-inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode)
-{
- GpTexture *texture = NULL;
- lastStatus = DllExports::GdipCreateTexture(image->nativeImage, wrapMode,
&texture);
- SetNativeBrush(texture);
-}
-
-inline TextureBrush::TextureBrush(Image *image, WrapMode wrapMode, const Rect
&dstRect)
-{
- GpTexture *texture = NULL;
- lastStatus = DllExports::GdipCreateTexture2I(
- image->nativeImage, wrapMode, dstRect.X, dstRect.Y, dstRect.Width,
dstRect.Height, &texture);
- SetNativeBrush(texture);
-}
-
inline Image *
TextureBrush::GetImage() const
{