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
6acffba5
Commit
6acffba5
authored
Jan 21, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Factor the matrix creation code out of GdipTransformPoints.
parent
b689e63a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
20 deletions
+33
-20
graphics.c
dlls/gdiplus/graphics.c
+33
-20
No files found.
dlls/gdiplus/graphics.c
View file @
6acffba5
...
...
@@ -147,6 +147,9 @@ static void restore_dc(GpGraphics *graphics, INT state)
RestoreDC
(
graphics
->
hdc
,
state
);
}
static
GpStatus
get_graphics_transform
(
GpGraphics
*
graphics
,
GpCoordinateSpace
dst_space
,
GpCoordinateSpace
src_space
,
GpMatrix
**
matrix
);
/* This helper applies all the changes that the points listed in ptf need in
* order to be drawn on the device context. In the end, this should include at
* least:
...
...
@@ -4909,25 +4912,13 @@ GpStatus WINGDIPAPI GdipGetClip(GpGraphics *graphics, GpRegion *region)
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipTransformPoints
(
GpGraphics
*
graphics
,
GpCoordinateSpace
dst_space
,
GpCoordinateSpace
src_space
,
GpPointF
*
points
,
INT
count
)
static
GpStatus
get_graphics_transform
(
GpGraphics
*
graphics
,
GpCoordinateSpace
dst_space
,
GpCoordinateSpace
src_space
,
GpMatrix
**
matrix
)
{
GpMatrix
*
matrix
;
GpStatus
stat
;
GpStatus
stat
=
GdipCreateMatrix
(
matrix
);
REAL
unitscale
;
if
(
!
graphics
||
!
points
||
count
<=
0
)
return
InvalidParameter
;
if
(
graphics
->
busy
)
return
ObjectBusy
;
TRACE
(
"(%p, %d, %d, %p, %d)
\n
"
,
graphics
,
dst_space
,
src_space
,
points
,
count
);
if
(
src_space
==
dst_space
)
return
Ok
;
stat
=
GdipCreateMatrix
(
&
matrix
);
if
(
stat
==
Ok
)
if
(
dst_space
!=
src_space
&&
stat
==
Ok
)
{
unitscale
=
convert_unit
(
graphics_res
(
graphics
),
graphics
->
unit
);
...
...
@@ -4938,12 +4929,12 @@ GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace
switch
(
src_space
)
{
case
CoordinateSpaceWorld
:
GdipMultiplyMatrix
(
matrix
,
graphics
->
worldtrans
,
MatrixOrderAppend
);
GdipMultiplyMatrix
(
*
matrix
,
graphics
->
worldtrans
,
MatrixOrderAppend
);
break
;
case
CoordinateSpacePage
:
break
;
case
CoordinateSpaceDevice
:
GdipScaleMatrix
(
matrix
,
1
.
0
/
unitscale
,
1
.
0
/
unitscale
,
MatrixOrderAppend
);
GdipScaleMatrix
(
*
matrix
,
1
.
0
/
unitscale
,
1
.
0
/
unitscale
,
MatrixOrderAppend
);
break
;
}
...
...
@@ -4958,7 +4949,7 @@ GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace
{
stat
=
GdipInvertMatrix
(
inverted_transform
);
if
(
stat
==
Ok
)
GdipMultiplyMatrix
(
matrix
,
inverted_transform
,
MatrixOrderAppend
);
GdipMultiplyMatrix
(
*
matrix
,
inverted_transform
,
MatrixOrderAppend
);
GdipDeleteMatrix
(
inverted_transform
);
}
break
;
...
...
@@ -4966,11 +4957,33 @@ GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace
case
CoordinateSpacePage
:
break
;
case
CoordinateSpaceDevice
:
GdipScaleMatrix
(
matrix
,
unitscale
,
unitscale
,
MatrixOrderAppend
);
GdipScaleMatrix
(
*
matrix
,
unitscale
,
unitscale
,
MatrixOrderAppend
);
break
;
}
}
return
stat
;
}
GpStatus
WINGDIPAPI
GdipTransformPoints
(
GpGraphics
*
graphics
,
GpCoordinateSpace
dst_space
,
GpCoordinateSpace
src_space
,
GpPointF
*
points
,
INT
count
)
{
GpMatrix
*
matrix
;
GpStatus
stat
;
if
(
!
graphics
||
!
points
||
count
<=
0
)
return
InvalidParameter
;
if
(
graphics
->
busy
)
return
ObjectBusy
;
TRACE
(
"(%p, %d, %d, %p, %d)
\n
"
,
graphics
,
dst_space
,
src_space
,
points
,
count
);
if
(
src_space
==
dst_space
)
return
Ok
;
stat
=
get_graphics_transform
(
graphics
,
dst_space
,
src_space
,
&
matrix
);
if
(
stat
==
Ok
)
{
stat
=
GdipTransformMatrixPoints
(
matrix
,
points
,
count
);
GdipDeleteMatrix
(
matrix
);
...
...
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