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
626ab3a9
Commit
626ab3a9
authored
Apr 13, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Apr 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add support for solid diagonal lines.
parent
cd39f0cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
objects.c
dlls/gdi32/dibdrv/objects.c
+20
-4
dib.c
dlls/gdi32/tests/dib.c
+14
-0
No files found.
dlls/gdi32/dibdrv/objects.c
View file @
626ab3a9
...
...
@@ -106,6 +106,19 @@ static inline BOOL pt_in_rect( const RECT *rect, POINT pt )
(
pt
.
y
>=
rect
->
top
)
&&
(
pt
.
y
<
rect
->
bottom
));
}
static
void
WINAPI
solid_pen_line_callback
(
INT
x
,
INT
y
,
LPARAM
lparam
)
{
dibdrv_physdev
*
pdev
=
(
dibdrv_physdev
*
)
lparam
;
RECT
rect
;
rect
.
left
=
x
;
rect
.
right
=
x
+
1
;
rect
.
top
=
y
;
rect
.
bottom
=
y
+
1
;
pdev
->
dib
.
funcs
->
solid_rects
(
&
pdev
->
dib
,
1
,
&
rect
,
pdev
->
pen_and
,
pdev
->
pen_xor
);
return
;
}
static
BOOL
solid_pen_line
(
dibdrv_physdev
*
pdev
,
POINT
*
start
,
POINT
*
end
)
{
RECT
rc
;
...
...
@@ -124,17 +137,20 @@ static BOOL solid_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end)
order_end_points
(
&
rc
.
left
,
&
rc
.
right
);
rc
.
bottom
++
;
pdev
->
dib
.
funcs
->
solid_rects
(
&
pdev
->
dib
,
1
,
&
rc
,
pdev
->
pen_and
,
pdev
->
pen_xor
);
return
TRUE
;
}
else
if
(
rc
.
left
==
rc
.
right
)
{
order_end_points
(
&
rc
.
top
,
&
rc
.
bottom
);
rc
.
right
++
;
pdev
->
dib
.
funcs
->
solid_rects
(
&
pdev
->
dib
,
1
,
&
rc
,
pdev
->
pen_and
,
pdev
->
pen_xor
);
return
TRUE
;
}
return
FALSE
;
else
{
/* FIXME: Optimize by moving Bresenham algorithm to the primitive functions,
or at least cache adjacent points in the callback */
LineDDA
(
start
->
x
,
start
->
y
,
end
->
x
,
end
->
y
,
solid_pen_line_callback
,
(
LPARAM
)
pdev
);
}
return
TRUE
;
}
/***********************************************************************
...
...
dlls/gdi32/tests/dib.c
View file @
626ab3a9
...
...
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -76,6 +77,7 @@ static const char *sha1_graphics_a8r8g8b8[] =
{
"a3cadd34d95d3d5cc23344f69aab1c2e55935fcf"
,
"2426172d9e8fec27d9228088f382ef3c93717da9"
,
"9e8f27ca952cdba01dbf25d07c34e86a7820c012"
,
"17b2c177bdce5e94433574a928bda5c94a8cdfa5"
,
NULL
};
...
...
@@ -174,6 +176,18 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char ***sh
compare_hash
(
bmi
,
bits
,
sha1
,
"h and v solid lines"
);
memset
(
bits
,
0xcc
,
dib_size
);
SetROP2
(
hdc
,
R2_COPYPEN
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
double
s
=
sin
(
M_PI
*
i
/
8
.
0
);
double
c
=
cos
(
M_PI
*
i
/
8
.
0
);
MoveToEx
(
hdc
,
200
.
5
+
10
*
c
,
200
.
5
+
10
*
s
,
NULL
);
LineTo
(
hdc
,
200
.
5
+
100
*
c
,
200
.
5
+
100
*
s
);
}
compare_hash
(
bmi
,
bits
,
sha1
,
"diagonal solid lines"
);
memset
(
bits
,
0xcc
,
dib_size
);
solid_brush
=
CreateSolidBrush
(
RGB
(
0x33
,
0xaa
,
0xff
));
orig_brush
=
SelectObject
(
hdc
,
solid_brush
);
...
...
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