https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f4d733d1fb784ebb1521…
commit 9f4d733d1fb784ebb1521c02cf8483597f4134f8
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Dec 31 14:54:41 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Dec 31 14:54:41 2019 +0900
[SDK][INCLUDE] Implement Gdiplus::Brush (#2205)
CORE-16585
---
sdk/include/psdk/gdiplusbrush.h | 400 +++++++++++++++++++++++-------
sdk/include/psdk/gdiplusheaders.h | 77 ++++++
sdk/include/psdk/gdiplusimageattributes.h | 2 +
sdk/include/psdk/gdiplusmatrix.h | 3 +
4 files changed, 399 insertions(+), 83 deletions(-)
diff --git a/sdk/include/psdk/gdiplusbrush.h b/sdk/include/psdk/gdiplusbrush.h
index 581f88d16f1..afee9fb94bb 100644
--- a/sdk/include/psdk/gdiplusbrush.h
+++ b/sdk/include/psdk/gdiplusbrush.h
@@ -27,329 +27,563 @@ class Brush : public GdiplusBase
friend class Graphics;
friend class Pen;
- Brush *Clone(VOID) const
+ virtual ~Brush()
{
- return NULL;
+ DllExports::GdipDeleteBrush(nativeBrush);
}
- Status GetLastStatus(VOID)
+ Brush *
+ Clone() const
{
- return status;
+ GpBrush *brush = NULL;
+ SetStatus(DllExports::GdipCloneBrush(nativeBrush, &brush));
+ if (lastStatus != Ok)
+ return NULL;
+
+ Brush *newBrush = new Brush(brush, lastStatus);
+ if (newBrush == NULL)
+ {
+ DllExports::GdipDeleteBrush(brush);
+ }
+ return newBrush;
+ }
+
+ Status
+ GetLastStatus() const
+ {
+ return lastStatus;
}
- BrushType GetType(VOID)
+ BrushType
+ GetType() const
{
BrushType type;
SetStatus(DllExports::GdipGetBrushType(nativeBrush, &type));
return type;
}
- private:
- mutable Status status;
+ protected:
GpBrush *nativeBrush;
+ mutable Status lastStatus;
+
+ Brush()
+ {
+ }
+
+ Brush(GpBrush *brush, Status status) : nativeBrush(brush), lastStatus(status)
+ {
+ }
Status
SetStatus(Status status) const
{
- if (status == Ok)
- return status;
- this->status = status;
+ if (status != Ok)
+ lastStatus = status;
return status;
}
+
+ void
+ SetNativeBrush(GpBrush *brush)
+ {
+ nativeBrush = brush;
+ }
+
+ private:
+ // Brush is not copyable
+ Brush(const Brush &);
+ Brush &
+ operator=(const Brush &);
};
class HatchBrush : public Brush
{
public:
+ friend class Pen;
+
HatchBrush(HatchStyle hatchStyle, const Color &foreColor, const Color
&backColor)
{
+ GpHatch *brush = NULL;
+ lastStatus = DllExports::GdipCreateHatchBrush(hatchStyle, foreColor.GetValue(),
backColor.GetValue(), &brush);
+ SetNativeBrush(brush);
}
Status
GetBackgroundColor(Color *color) const
{
- return NotImplemented;
+ if (!color)
+ return SetStatus(InvalidParameter);
+
+ ARGB argb;
+ GpHatch *hatch = GetNativeHatch();
+ SetStatus(DllExports::GdipGetHatchBackgroundColor(hatch, &argb));
+
+ color->SetValue(argb);
+ return lastStatus;
}
Status
GetForegroundColor(Color *color) const
{
- return NotImplemented;
+ if (!color)
+ return SetStatus(InvalidParameter);
+
+ ARGB argb;
+ GpHatch *hatch = GetNativeHatch();
+ SetStatus(DllExports::GdipGetHatchForegroundColor(hatch, &argb));
+
+ color->SetValue(argb);
+ return lastStatus;
+ }
+
+ HatchStyle
+ GetHatchStyle() const
+ {
+ HatchStyle hatchStyle;
+ GpHatch *hatch = GetNativeHatch();
+ SetStatus(DllExports::GdipGetHatchStyle(hatch, &hatchStyle));
+ return hatchStyle;
+ }
+
+ protected:
+ HatchBrush()
+ {
}
- HatchStyle GetHatchStyle(VOID) const
+ GpHatch *
+ GetNativeHatch() const
{
- return HatchStyleHorizontal;
+ return static_cast<GpHatch *>(nativeBrush);
}
};
class LinearGradientBrush : public Brush
{
public:
+ friend class Pen;
+
LinearGradientBrush(const PointF &point1, const PointF &point2, const Color
&color1, const Color &color2)
{
+ GpLineGradient *brush = NULL;
+ lastStatus = DllExports::GdipCreateLineBrush(
+ &point1, &point2, color1.GetValue(), color2.GetValue(), WrapModeTile,
&brush);
+ SetNativeBrush(brush);
}
- LinearGradientBrush(const Rect &rect, const Color &color1, const Color
&color2, REAL angle, BOOL isAngleScalable)
+ LinearGradientBrush(
+ const Rect &rect,
+ const Color &color1,
+ const Color &color2,
+ REAL angle,
+ BOOL isAngleScalable = FALSE)
{
+ GpLineGradient *brush = NULL;
+ lastStatus = DllExports::GdipCreateLineBrushFromRectWithAngleI(
+ &rect, color1.GetValue(), color2.GetValue(), angle, isAngleScalable,
WrapModeTile, &brush);
+ SetNativeBrush(brush);
}
LinearGradientBrush(const Rect &rect, const Color &color1, const Color
&color2, LinearGradientMode mode)
{
+ GpLineGradient *brush = NULL;
+ lastStatus = DllExports::GdipCreateLineBrushFromRectI(
+ &rect, color1.GetValue(), color2.GetValue(), mode, WrapModeTile,
&brush);
+ SetNativeBrush(brush);
}
LinearGradientBrush(const Point &point1, const Point &point2, const Color
&color1, const Color &color2)
{
+ GpLineGradient *brush = NULL;
+ lastStatus = DllExports::GdipCreateLineBrushI(
+ &point1, &point2, color1.GetValue(), color2.GetValue(), WrapModeTile,
&brush);
+ SetNativeBrush(brush);
}
- LinearGradientBrush(const RectF &rect, const Color &color1, const Color
&color2, REAL angle, BOOL isAngleScalable)
+ LinearGradientBrush(
+ const RectF &rect,
+ const Color &color1,
+ const Color &color2,
+ REAL angle,
+ BOOL isAngleScalable = FALSE)
{
+ GpLineGradient *brush = NULL;
+ lastStatus = DllExports::GdipCreateLineBrushFromRectWithAngle(
+ &rect, color1.GetValue(), color2.GetValue(), angle, isAngleScalable,
WrapModeTile, &brush);
+ SetNativeBrush(brush);
}
LinearGradientBrush(const RectF &rect, const Color &color1, const Color
&color2, LinearGradientMode mode)
{
+ GpLineGradient *brush = NULL;
+ lastStatus = DllExports::GdipCreateLineBrushFromRect(
+ &rect, color1.GetValue(), color2.GetValue(), mode, WrapModeTile,
&brush);
+ SetNativeBrush(brush);
}
Status
GetBlend(REAL *blendFactors, REAL *blendPositions, INT count)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipGetLineBlend(gradient, blendFactors,
blendPositions, count));
}
- INT GetBlendCount(VOID) const
+ INT
+ GetBlendCount() const
{
- return 0;
+ INT count = 0;
+ GpLineGradient *gradient = GetNativeGradient();
+ SetStatus(DllExports::GdipGetLineBlendCount(gradient, &count));
+ return count;
}
- BOOL GetGammaCorrection(VOID) const
+ BOOL
+ GetGammaCorrection() const
{
- return FALSE;
+ BOOL useGammaCorrection;
+ GpLineGradient *gradient = GetNativeGradient();
+ SetStatus(DllExports::GdipGetLineGammaCorrection(gradient,
&useGammaCorrection));
+ return useGammaCorrection;
}
- INT GetInterpolationColorCount(VOID) const
+ INT
+ GetInterpolationColorCount() const
{
- return 0;
+ INT count = 0;
+ GpLineGradient *gradient = GetNativeGradient();
+ SetStatus(DllExports::GdipGetLinePresetBlendCount(gradient, &count));
+ return count;
}
Status
GetInterpolationColors(Color *presetColors, REAL *blendPositions, INT count) const
{
- return NotImplemented;
+ return SetStatus(NotImplemented);
}
Status
GetLinearColors(Color *colors) const
{
- return NotImplemented;
+ if (!colors)
+ return SetStatus(InvalidParameter);
+
+ GpLineGradient *gradient = GetNativeGradient();
+
+ ARGB argb[2];
+ SetStatus(DllExports::GdipGetLineColors(gradient, argb));
+ if (lastStatus == Ok)
+ {
+ colors[0] = Color(argb[0]);
+ colors[1] = Color(argb[1]);
+ }
+ return lastStatus;
}
Status
GetRectangle(Rect *rect) const
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipGetLineRectI(gradient, rect));
}
Status
GetRectangle(RectF *rect) const
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipGetLineRect(gradient, rect));
}
Status
GetTransform(Matrix *matrix) const
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipGetLineTransform(gradient,
matrix->nativeMatrix));
}
- WrapMode GetWrapMode(VOID) const
+ WrapMode
+ GetWrapMode() const
{
- return WrapModeTile;
+
+ WrapMode wrapMode;
+ GpLineGradient *gradient = GetNativeGradient();
+ SetStatus(DllExports::GdipGetLineWrapMode(gradient, &wrapMode));
+ return wrapMode;
}
Status
MultiplyTransform(const Matrix *matrix, MatrixOrder order)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipMultiplyLineTransform(gradient,
matrix->nativeMatrix, order));
}
- Status ResetTransform(VOID)
+ Status
+ ResetTransform()
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipResetLineTransform(gradient));
}
Status
RotateTransform(REAL angle, MatrixOrder order)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipRotateLineTransform(gradient, angle, order));
}
Status
- ScaleTransform(REAL sx, REAL sy, MatrixOrder order)
+ ScaleTransform(REAL sx, REAL sy, MatrixOrder order = MatrixOrderPrepend)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipScaleLineTransform(gradient, sx, sy, order));
}
Status
SetBlend(const REAL *blendFactors, const REAL *blendPositions, INT count)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineBlend(gradient, blendFactors,
blendPositions, count));
}
Status
SetBlendBellShape(REAL focus, REAL scale)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineSigmaBlend(gradient, focus, scale));
}
Status
- SetBlendTriangularShape(REAL focus, REAL scale)
+ SetBlendTriangularShape(REAL focus, REAL scale = 1.0f)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineLinearBlend(gradient, focus, scale));
}
Status
SetGammaCorrection(BOOL useGammaCorrection)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineGammaCorrection(gradient,
useGammaCorrection));
}
Status
SetInterpolationColors(const Color *presetColors, const REAL *blendPositions, INT
count)
{
- return NotImplemented;
+ return SetStatus(NotImplemented);
}
Status
SetLinearColors(const Color &color1, const Color &color2)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineColors(gradient, color1.GetValue(),
color2.GetValue()));
}
Status
SetTransform(const Matrix *matrix)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineTransform(gradient,
matrix->nativeMatrix));
}
Status
SetWrapMode(WrapMode wrapMode)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLineWrapMode(gradient, wrapMode));
}
Status
- TranslateTransform(REAL dx, REAL dy, MatrixOrder order)
+ TranslateTransform(REAL dx, REAL dy, MatrixOrder order = MatrixOrderPrepend)
{
- return NotImplemented;
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipTranslateLineTransform(gradient, dx, dy,
order));
}
-};
-class SolidBrush : Brush
-{
- public:
- SolidBrush(const Color &color)
+ Status
+ SetLinearPoints(const PointF &point1, const PointF &point2)
{
+#if 1
+ return SetStatus(NotImplemented);
+#else
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLinePoints(gradient, &point1,
&point2));
+#endif
}
Status
- GetColor(Color *color) const
+ GetLinearPoints(PointF *points) const
{
- return NotImplemented;
+#if 1
+ return SetStatus(NotImplemented);
+#else
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipGetLinePoints(gradient, points));
+#endif
}
Status
- SetColor(const Color &color)
+ SetLinearPoints(const Point &point1, const Point &point2)
{
- return NotImplemented;
+#if 1
+ return SetStatus(NotImplemented);
+#else
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipSetLinePointsI(gradient, &point1,
&point2));
+#endif
}
-};
-class TextureBrush : Brush
-{
- public:
- TextureBrush(Image *image, WrapMode wrapMode, const RectF &dstRect)
+ Status
+ GetLinearPoints(Point *points) const
{
+#if 1
+ return SetStatus(NotImplemented);
+#else
+ GpLineGradient *gradient = GetNativeGradient();
+ return SetStatus(DllExports::GdipGetLinePointsI(gradient, points));
+#endif
}
- TextureBrush(Image *image, Rect &dstRect, ImageAttributes *imageAttributes)
+ protected:
+ GpLineGradient *
+ GetNativeGradient() const
{
+ return static_cast<GpLineGradient *>(nativeBrush);
}
+};
- TextureBrush(Image *image, WrapMode wrapMode, INT dstX, INT dstY, INT dstWidth, INT
dstHeight)
- {
- }
+class SolidBrush : Brush
+{
+ public:
+ friend class Pen;
- TextureBrush(Image *image, WrapMode wrapMode, REAL dstX, REAL dstY, REAL dstWidth,
REAL dstHeight)
+ SolidBrush(const Color &color)
{
+ GpSolidFill *brush = NULL;
+ lastStatus = DllExports::GdipCreateSolidFill(color.GetValue(), &brush);
+ SetNativeBrush(brush);
}
- TextureBrush(Image *image, RectF &dstRect, ImageAttributes *imageAttributes)
+ Status
+ GetColor(Color *color) const
{
+ if (!color)
+ return SetStatus(InvalidParameter);
+
+ ARGB argb;
+ GpSolidFill *fill = GetNativeFill();
+ SetStatus(DllExports::GdipGetSolidFillColor(fill, &argb));
+
+ *color = Color(argb);
+ return lastStatus;
}
- TextureBrush(Image *image, WrapMode wrapMode)
+ Status
+ SetColor(const Color &color)
{
+ GpSolidFill *fill = GetNativeFill();
+ return SetStatus(DllExports::GdipSetSolidFillColor(fill, color.GetValue()));
}
- TextureBrush(Image *image, WrapMode wrapMode, const Rect &dstRect)
+ protected:
+ SolidBrush()
{
}
- Image *GetImage(VOID) const
+ GpSolidFill *
+ GetNativeFill() const
{
- return NULL;
+ return static_cast<GpSolidFill *>(nativeBrush);
}
+};
+
+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);
+
+ Image *
+ GetImage() const;
Status
GetTransform(Matrix *matrix) const
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipGetTextureTransform(texture,
matrix->nativeMatrix));
}
- WrapMode GetWrapMode(VOID) const
+ WrapMode
+ GetWrapMode() const
{
- return WrapModeTile;
+ WrapMode wrapMode;
+ GpTexture *texture = GetNativeTexture();
+ SetStatus(DllExports::GdipGetTextureWrapMode(texture, &wrapMode));
+ return wrapMode;
}
Status
- MultiplyTransform(Matrix *matrix, MatrixOrder order)
+ MultiplyTransform(Matrix *matrix, MatrixOrder order = MatrixOrderPrepend)
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipMultiplyTextureTransform(texture,
matrix->nativeMatrix, order));
}
- Status ResetTransform(VOID)
+ Status
+ ResetTransform()
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipResetTextureTransform(texture));
}
Status
RotateTransform(REAL angle, MatrixOrder order)
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipRotateTextureTransform(texture, angle, order));
}
Status
ScaleTransform(REAL sx, REAL sy, MatrixOrder order)
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipScaleTextureTransform(texture, sx, sy, order));
}
Status
SetTransform(const Matrix *matrix)
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipSetTextureTransform(texture,
matrix->nativeMatrix));
}
Status
SetWrapMode(WrapMode wrapMode)
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipSetTextureWrapMode(texture, wrapMode));
}
Status
TranslateTransform(REAL dx, REAL dy, MatrixOrder order)
{
- return NotImplemented;
+ GpTexture *texture = GetNativeTexture();
+ return SetStatus(DllExports::GdipTranslateTextureTransform(texture, dx, dy,
order));
+ }
+
+ protected:
+ GpTexture *
+ GetNativeTexture() const
+ {
+ return static_cast<GpTexture *>(nativeBrush);
+ }
+
+ TextureBrush()
+ {
}
};
diff --git a/sdk/include/psdk/gdiplusheaders.h b/sdk/include/psdk/gdiplusheaders.h
index dccaa2e1460..eb139741bab 100644
--- a/sdk/include/psdk/gdiplusheaders.h
+++ b/sdk/include/psdk/gdiplusheaders.h
@@ -23,6 +23,7 @@ class Image : public GdiplusBase
{
public:
friend class Graphics;
+ friend class TextureBrush;
Image(IStream *stream, BOOL useEmbeddedColorManagement = FALSE) : nativeImage(NULL)
{
@@ -1438,4 +1439,80 @@ class CustomLineCap : public GdiplusBase
operator=(const CustomLineCap &);
};
+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
+{
+#if 1
+ return NULL; // FIXME
+#else
+ GpImage *image = NULL;
+ GpTexture *texture = GetNativeTexture();
+ SetStatus(DllExports::GdipGetTextureImage(texture, &image));
+ if (lastStatus != Ok)
+ return NULL;
+
+ Image *newImage = new Image(image, lastStatus);
+ if (!newImage)
+ DllExports::GdipDisposeImage(image);
+ return newImage;
+#endif
+}
+
#endif /* _GDIPLUSHEADERS_H */
diff --git a/sdk/include/psdk/gdiplusimageattributes.h
b/sdk/include/psdk/gdiplusimageattributes.h
index e68e1908558..4cda385608b 100644
--- a/sdk/include/psdk/gdiplusimageattributes.h
+++ b/sdk/include/psdk/gdiplusimageattributes.h
@@ -22,6 +22,8 @@
class ImageAttributes : public GdiplusBase
{
public:
+ friend class TextureBrush;
+
ImageAttributes() : nativeImageAttr(NULL)
{
lastStatus = DllExports::GdipCreateImageAttributes(&nativeImageAttr);
diff --git a/sdk/include/psdk/gdiplusmatrix.h b/sdk/include/psdk/gdiplusmatrix.h
index c2425c3ff1c..72981f72190 100644
--- a/sdk/include/psdk/gdiplusmatrix.h
+++ b/sdk/include/psdk/gdiplusmatrix.h
@@ -24,6 +24,9 @@ class Matrix : public GdiplusBase
friend class Pen;
friend class Region;
friend class GraphicsPath;
+ friend class Brush;
+ friend class LinearGradientBrush;
+ friend class TextureBrush;
public:
Matrix(const RectF &rect, const PointF *dstplg)