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
cc8cc65f
Commit
cc8cc65f
authored
Aug 12, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix mismatched use of Begin/EndContainer and Save/RestoreGraphics.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8fbdd670
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
22 deletions
+41
-22
graphics.c
dlls/gdiplus/graphics.c
+39
-20
graphics.c
dlls/gdiplus/tests/graphics.c
+2
-2
No files found.
dlls/gdiplus/graphics.c
View file @
cc8cc65f
...
...
@@ -1924,9 +1924,15 @@ GpStatus trace_path(GpGraphics *graphics, GpPath *path)
return
result
;
}
typedef
enum
GraphicsContainerType
{
BEGIN_CONTAINER
,
SAVE_GRAPHICS
}
GraphicsContainerType
;
typedef
struct
_GraphicsContainerItem
{
struct
list
entry
;
GraphicsContainer
contid
;
GraphicsContainerType
type
;
SmoothingMode
smoothing
;
CompositingQuality
compqual
;
...
...
@@ -1943,7 +1949,7 @@ typedef struct _GraphicsContainerItem {
}
GraphicsContainerItem
;
static
GpStatus
init_container
(
GraphicsContainerItem
**
container
,
GDIPCONST
GpGraphics
*
graphics
){
GDIPCONST
GpGraphics
*
graphics
,
GraphicsContainerType
type
){
GpStatus
sts
;
*
container
=
heap_alloc_zero
(
sizeof
(
GraphicsContainerItem
));
...
...
@@ -1951,6 +1957,7 @@ static GpStatus init_container(GraphicsContainerItem** container,
return
OutOfMemory
;
(
*
container
)
->
contid
=
graphics
->
contid
+
1
;
(
*
container
)
->
type
=
type
;
(
*
container
)
->
smoothing
=
graphics
->
smoothing
;
(
*
container
)
->
compqual
=
graphics
->
compqual
;
...
...
@@ -5148,11 +5155,6 @@ GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
return
GdipSetMatrixElements
(
&
graphics
->
worldtrans
,
1
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
);
}
GpStatus
WINGDIPAPI
GdipRestoreGraphics
(
GpGraphics
*
graphics
,
GraphicsState
state
)
{
return
GdipEndContainer
(
graphics
,
state
);
}
GpStatus
WINGDIPAPI
GdipRotateWorldTransform
(
GpGraphics
*
graphics
,
REAL
angle
,
GpMatrixOrder
order
)
{
...
...
@@ -5176,23 +5178,16 @@ GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics *graphics, REAL angle,
return
GdipRotateMatrix
(
&
graphics
->
worldtrans
,
angle
,
order
);
}
GpStatus
WINGDIPAPI
GdipSaveGraphics
(
GpGraphics
*
graphics
,
GraphicsState
*
state
)
{
return
GdipBeginContainer2
(
graphics
,
state
);
}
GpStatus
WINGDIPAPI
GdipBeginContainer2
(
GpGraphics
*
graphics
,
GraphicsContainer
*
state
)
static
GpStatus
begin_container
(
GpGraphics
*
graphics
,
GraphicsContainerType
type
,
GraphicsContainer
*
state
)
{
GraphicsContainerItem
*
container
;
GpStatus
sts
;
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
state
);
if
(
!
graphics
||
!
state
)
return
InvalidParameter
;
sts
=
init_container
(
&
container
,
graphics
);
sts
=
init_container
(
&
container
,
graphics
,
type
);
if
(
sts
!=
Ok
)
return
sts
;
...
...
@@ -5202,6 +5197,19 @@ GpStatus WINGDIPAPI GdipBeginContainer2(GpGraphics *graphics,
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipSaveGraphics
(
GpGraphics
*
graphics
,
GraphicsState
*
state
)
{
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
state
);
return
begin_container
(
graphics
,
SAVE_GRAPHICS
,
state
);
}
GpStatus
WINGDIPAPI
GdipBeginContainer2
(
GpGraphics
*
graphics
,
GraphicsContainer
*
state
)
{
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
state
);
return
begin_container
(
graphics
,
BEGIN_CONTAINER
,
state
);
}
GpStatus
WINGDIPAPI
GdipBeginContainer
(
GpGraphics
*
graphics
,
GDIPCONST
GpRectF
*
dstrect
,
GDIPCONST
GpRectF
*
srcrect
,
GpUnit
unit
,
GraphicsContainer
*
state
)
{
FIXME
(
"(%p, %p, %p, %d, %p): stub
\n
"
,
graphics
,
dstrect
,
srcrect
,
unit
,
state
);
...
...
@@ -5220,18 +5228,17 @@ GpStatus WINGDIPAPI GdipComment(GpGraphics *graphics, UINT sizeData, GDIPCONST B
return
NotImplemented
;
}
GpStatus
WINGDIPAPI
GdipEndContainer
(
GpGraphics
*
graphics
,
GraphicsContainer
state
)
static
GpStatus
end_container
(
GpGraphics
*
graphics
,
GraphicsContainerType
type
,
GraphicsContainer
state
)
{
GpStatus
sts
;
GraphicsContainerItem
*
container
,
*
container2
;
TRACE
(
"(%p, %x)
\n
"
,
graphics
,
state
);
if
(
!
graphics
)
return
InvalidParameter
;
LIST_FOR_EACH_ENTRY
(
container
,
&
graphics
->
containers
,
GraphicsContainerItem
,
entry
){
if
(
container
->
contid
==
state
)
if
(
container
->
contid
==
state
&&
container
->
type
==
type
)
break
;
}
...
...
@@ -5257,6 +5264,18 @@ GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsContainer sta
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipEndContainer
(
GpGraphics
*
graphics
,
GraphicsContainer
state
)
{
TRACE
(
"(%p, %x)
\n
"
,
graphics
,
state
);
return
end_container
(
graphics
,
BEGIN_CONTAINER
,
state
);
}
GpStatus
WINGDIPAPI
GdipRestoreGraphics
(
GpGraphics
*
graphics
,
GraphicsState
state
)
{
TRACE
(
"(%p, %x)
\n
"
,
graphics
,
state
);
return
end_container
(
graphics
,
SAVE_GRAPHICS
,
state
);
}
GpStatus
WINGDIPAPI
GdipScaleWorldTransform
(
GpGraphics
*
graphics
,
REAL
sx
,
REAL
sy
,
GpMatrixOrder
order
)
{
...
...
dlls/gdiplus/tests/graphics.c
View file @
cc8cc65f
...
...
@@ -335,7 +335,7 @@ static void test_save_restore(void)
stat
=
GdipEndContainer
(
graphics1
,
state_a
);
expect
(
Ok
,
stat
);
GdipGetInterpolationMode
(
graphics1
,
&
mode
);
todo_wine
expect
(
InterpolationModeBicubic
,
mode
);
expect
(
InterpolationModeBicubic
,
mode
);
stat
=
GdipRestoreGraphics
(
graphics1
,
state_a
);
expect
(
Ok
,
stat
);
GdipGetInterpolationMode
(
graphics1
,
&
mode
);
...
...
@@ -353,7 +353,7 @@ static void test_save_restore(void)
stat
=
GdipRestoreGraphics
(
graphics1
,
state_a
);
expect
(
Ok
,
stat
);
GdipGetInterpolationMode
(
graphics1
,
&
mode
);
todo_wine
expect
(
InterpolationModeBicubic
,
mode
);
expect
(
InterpolationModeBicubic
,
mode
);
stat
=
GdipEndContainer
(
graphics1
,
state_a
);
expect
(
Ok
,
stat
);
GdipGetInterpolationMode
(
graphics1
,
&
mode
);
...
...
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