Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
48b80725
Commit
48b80725
authored
Sep 25, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetTextureTransform with test.
parent
067a08ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
1 deletion
+75
-1
brush.c
dlls/gdiplus/brush.c
+26
-0
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
brush.c
dlls/gdiplus/tests/brush.c
+47
-0
No files found.
dlls/gdiplus/brush.c
View file @
48b80725
...
...
@@ -485,6 +485,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
INT
n_x
,
n_y
,
n_width
,
n_height
,
abs_height
,
stride
,
image_stride
,
i
,
bytespp
;
BOOL
bm_is_selected
;
BYTE
*
dibits
,
*
buff
,
*
textbits
;
GpStatus
status
;
TRACE
(
"(%p, %p, %.2f, %.2f, %.2f, %.2f, %p)
\n
"
,
image
,
imageattr
,
x
,
y
,
width
,
height
,
texture
);
...
...
@@ -577,6 +578,13 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
*
texture
=
GdipAlloc
(
sizeof
(
GpTexture
));
if
(
!*
texture
)
return
OutOfMemory
;
if
((
status
=
GdipCreateMatrix
(
&
(
*
texture
)
->
transform
))
!=
Ok
){
GdipFree
(
*
texture
);
GdipFree
(
dibits
);
GdipFree
(
buff
);
return
status
;
}
(
*
texture
)
->
brush
.
lb
.
lbStyle
=
BS_DIBPATTERNPT
;
(
*
texture
)
->
brush
.
lb
.
lbColor
=
DIB_RGB_COLORS
;
(
*
texture
)
->
brush
.
lb
.
lbHatch
=
(
ULONG_PTR
)
buff
;
...
...
@@ -642,7 +650,10 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
break
;
case
BrushTypeSolidColor
:
case
BrushTypeLinearGradient
:
break
;
case
BrushTypeTextureFill
:
GdipDeleteMatrix
(((
GpTexture
*
)
brush
)
->
transform
);
break
;
default:
break
;
}
...
...
@@ -872,6 +883,21 @@ GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
return
Ok
;
}
/******************************************************************************
* GdipGetTextureTransform [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipGetTextureTransform
(
GpTexture
*
brush
,
GpMatrix
*
matrix
)
{
TRACE
(
"(%p, %p)
\n
"
,
brush
,
matrix
);
if
(
!
brush
||
!
matrix
)
return
InvalidParameter
;
memcpy
(
matrix
,
brush
->
transform
,
sizeof
(
GpMatrix
));
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipSetLineBlend
(
GpLineGradient
*
brush
,
GDIPCONST
REAL
*
blend
,
GDIPCONST
REAL
*
positions
,
INT
count
)
{
...
...
dlls/gdiplus/gdiplus.spec
View file @
48b80725
...
...
@@ -398,7 +398,7 @@
@ stub GdipGetTextContrast
@ stdcall GdipGetTextRenderingHint(ptr ptr)
@ stub GdipGetTextureImage
@ st
ub GdipGetTextureTransform
@ st
dcall GdipGetTextureTransform(ptr ptr)
@ stub GdipGetTextureWrapMode
@ stub GdipGetVisibleClipBounds
@ stub GdipGetVisibleClipBoundsI
...
...
dlls/gdiplus/gdiplus_private.h
View file @
48b80725
...
...
@@ -138,6 +138,7 @@ struct GpLineGradient{
struct
GpTexture
{
GpBrush
brush
;
GpMatrix
*
transform
;
};
struct
GpPath
{
...
...
dlls/gdiplus/tests/brush.c
View file @
48b80725
...
...
@@ -169,6 +169,52 @@ static void test_getgamma(void)
GdipDeleteBrush
((
GpBrush
*
)
line
);
}
static
void
test_transform
(
void
)
{
GpStatus
status
;
GpTexture
*
texture
;
GpGraphics
*
graphics
=
NULL
;
GpBitmap
*
bitmap
;
HDC
hdc
=
GetDC
(
0
);
GpMatrix
*
m
;
BOOL
res
;
status
=
GdipCreateMatrix2
(
2
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
&
m
);
expect
(
Ok
,
status
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipCreateBitmapFromGraphics
(
1
,
1
,
graphics
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipCreateTexture
((
GpImage
*
)
bitmap
,
WrapModeTile
,
&
texture
);
expect
(
Ok
,
status
);
/* NULL */
status
=
GdipGetTextureTransform
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetTextureTransform
(
texture
,
NULL
);
expect
(
InvalidParameter
,
status
);
/* default value - identity matrix */
status
=
GdipGetTextureTransform
(
texture
,
m
);
expect
(
Ok
,
status
);
status
=
GdipIsMatrixIdentity
(
m
,
&
res
);
expect
(
Ok
,
status
);
expect
(
TRUE
,
res
);
status
=
GdipDeleteBrush
((
GpBrush
*
)
texture
);
expect
(
Ok
,
status
);
status
=
GdipDeleteMatrix
(
m
);
expect
(
Ok
,
status
);
status
=
GdipDisposeImage
((
GpImage
*
)
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
status
);
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
brush
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -187,6 +233,7 @@ START_TEST(brush)
test_getblend
();
test_getbounds
();
test_getgamma
();
test_transform
();
GdiplusShutdown
(
gdiplusToken
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment