Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
626ab3a9
Commit
626ab3a9
authored
14 years ago
by
Huw Davies
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gdi32: Add support for solid diagonal lines.
parent
cd39f0cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/gdi32/dibdrv/objects.c
+20
-4
20 additions, 4 deletions
dlls/gdi32/dibdrv/objects.c
dlls/gdi32/tests/dib.c
+14
-0
14 additions, 0 deletions
dlls/gdi32/tests/dib.c
with
34 additions
and
4 deletions
dlls/gdi32/dibdrv/objects.c
+
20
−
4
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
;
}
/***********************************************************************
...
...
This diff is collapsed.
Click to expand it.
dlls/gdi32/tests/dib.c
+
14
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment