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
c3ca6be2
Commit
c3ca6be2
authored
Aug 08, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Give a nice warning when we try to draw to an HDC-less graphics.
parent
5601860b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
1 deletion
+86
-1
graphics.c
dlls/gdiplus/graphics.c
+86
-1
No files found.
dlls/gdiplus/graphics.c
View file @
c3ca6be2
...
...
@@ -94,10 +94,17 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen)
{
HPEN
gdipen
;
REAL
width
;
INT
save_state
=
SaveDC
(
graphics
->
hdc
)
,
i
,
numdashes
;
INT
save_state
,
i
,
numdashes
;
GpPointF
pt
[
2
];
DWORD
dash_array
[
MAX_DASHLEN
];
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
}
save_state
=
SaveDC
(
graphics
->
hdc
);
EndPath
(
graphics
->
hdc
);
if
(
pen
->
unit
==
UnitPixel
){
...
...
@@ -1973,6 +1980,11 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
if
(
image
->
picture
)
{
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
}
/* FIXME: partially implemented (only works for rectangular parallelograms) */
if
(
srcUnit
==
UnitInch
)
dx
=
dy
=
(
REAL
)
INCH_HIMETRIC
;
...
...
@@ -2772,6 +2784,12 @@ GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
ptf
[
0
].
X
=
x
;
ptf
[
0
].
Y
=
y
;
ptf
[
1
].
X
=
x
+
width
;
...
...
@@ -2814,6 +2832,12 @@ GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *p
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
save_state
=
SaveDC
(
graphics
->
hdc
);
EndPath
(
graphics
->
hdc
);
SetPolyFillMode
(
graphics
->
hdc
,
(
path
->
fill
==
FillModeAlternate
?
ALTERNATE
...
...
@@ -2851,6 +2875,12 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
save_state
=
SaveDC
(
graphics
->
hdc
);
EndPath
(
graphics
->
hdc
);
...
...
@@ -2890,6 +2920,12 @@ GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
ptf
=
GdipAlloc
(
count
*
sizeof
(
GpPointF
));
pti
=
GdipAlloc
(
count
*
sizeof
(
POINT
));
if
(
!
ptf
||
!
pti
){
...
...
@@ -2937,6 +2973,12 @@ GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
ptf
=
GdipAlloc
(
count
*
sizeof
(
GpPointF
));
pti
=
GdipAlloc
(
count
*
sizeof
(
POINT
));
if
(
!
ptf
||
!
pti
){
...
...
@@ -3002,6 +3044,12 @@ GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
ptf
[
0
].
X
=
x
;
ptf
[
0
].
Y
=
y
;
ptf
[
1
].
X
=
x
+
width
;
...
...
@@ -3042,6 +3090,12 @@ GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
ptf
[
0
].
X
=
x
;
ptf
[
0
].
Y
=
y
;
ptf
[
1
].
X
=
x
+
width
;
...
...
@@ -3134,6 +3188,12 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
Ok
;
}
status
=
GdipGetRegionHRgn
(
region
,
graphics
,
&
hrgn
);
if
(
status
!=
Ok
)
return
status
;
...
...
@@ -3744,6 +3804,12 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
if
(
regionCount
<
stringFormat
->
range_count
)
return
InvalidParameter
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
NotImplemented
;
}
if
(
stringFormat
->
attr
)
TRACE
(
"may be ignoring some format flags: attr %x
\n
"
,
stringFormat
->
attr
);
...
...
@@ -3813,6 +3879,12 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
if
(
!
graphics
||
!
string
||
!
font
||
!
rect
||
!
bounds
)
return
InvalidParameter
;
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
NotImplemented
;
}
if
(
linesfilled
)
*
linesfilled
=
0
;
if
(
codepointsfitted
)
*
codepointsfitted
=
0
;
...
...
@@ -3886,6 +3958,12 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
return
NotImplemented
;
}
if
(
!
graphics
->
hdc
)
{
FIXME
(
"graphics object has no HDC
\n
"
);
return
NotImplemented
;
}
if
(
format
){
TRACE
(
"may be ignoring some format flags: attr %x
\n
"
,
format
->
attr
);
...
...
@@ -4549,6 +4627,13 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc)
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
hdc
)
{
WARN
(
"no HDC for this graphics
\n
"
);
*
hdc
=
NULL
;
return
GenericError
;
}
*
hdc
=
graphics
->
hdc
;
graphics
->
busy
=
TRUE
;
...
...
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