Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
87f3d120
Kaydet (Commit)
87f3d120
authored
Tem 14, 2011
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use the flat GdiPlus API as needed because of the incomplete headers from Wine
üst
e4e34084
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
47 deletions
+57
-47
salgdi_gdiplus.cxx
vcl/win/source/gdi/salgdi_gdiplus.cxx
+57
-47
No files found.
vcl/win/source/gdi/salgdi_gdiplus.cxx
Dosyayı görüntüle @
87f3d120
...
@@ -50,9 +50,9 @@
...
@@ -50,9 +50,9 @@
#pragma warning(push, 1)
#pragma warning(push, 1)
#endif
#endif
#include <
GdiP
lus.h>
#include <
gdip
lus.h>
#include <
GdiPlusE
nums.h>
#include <
gdipluse
nums.h>
#include <
GdiPlusC
olor.h>
#include <
gdiplusc
olor.h>
#if defined _MSC_VER
#if defined _MSC_VER
#pragma warning(pop)
#pragma warning(pop)
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
void
impAddB2DPolygonToGDIPlusGraphicsPathReal
(
Gdiplus
::
G
raphicsPath
&
r
Path
,
const
basegfx
::
B2DPolygon
&
rPolygon
,
bool
bNoLineJoin
)
void
impAddB2DPolygonToGDIPlusGraphicsPathReal
(
Gdiplus
::
G
pPath
*
p
Path
,
const
basegfx
::
B2DPolygon
&
rPolygon
,
bool
bNoLineJoin
)
{
{
sal_uInt32
nCount
(
rPolygon
.
count
());
sal_uInt32
nCount
(
rPolygon
.
count
());
...
@@ -71,44 +71,42 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, con
...
@@ -71,44 +71,42 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, con
const
sal_uInt32
nEdgeCount
(
rPolygon
.
isClosed
()
?
nCount
:
nCount
-
1
);
const
sal_uInt32
nEdgeCount
(
rPolygon
.
isClosed
()
?
nCount
:
nCount
-
1
);
const
bool
bControls
(
rPolygon
.
areControlPointsUsed
());
const
bool
bControls
(
rPolygon
.
areControlPointsUsed
());
basegfx
::
B2DPoint
aCurr
(
rPolygon
.
getB2DPoint
(
0
));
basegfx
::
B2DPoint
aCurr
(
rPolygon
.
getB2DPoint
(
0
));
Gdiplus
::
PointF
aFCurr
(
Gdiplus
::
REAL
(
aCurr
.
getX
()),
Gdiplus
::
REAL
(
aCurr
.
getY
()));
for
(
sal_uInt32
a
(
0
);
a
<
nEdgeCount
;
a
++
)
for
(
sal_uInt32
a
(
0
);
a
<
nEdgeCount
;
a
++
)
{
{
const
sal_uInt32
nNextIndex
((
a
+
1
)
%
nCount
);
const
sal_uInt32
nNextIndex
((
a
+
1
)
%
nCount
);
const
basegfx
::
B2DPoint
aNext
(
rPolygon
.
getB2DPoint
(
nNextIndex
));
const
basegfx
::
B2DPoint
aNext
(
rPolygon
.
getB2DPoint
(
nNextIndex
));
const
Gdiplus
::
PointF
aFNext
(
Gdiplus
::
REAL
(
aNext
.
getX
()),
Gdiplus
::
REAL
(
aNext
.
getY
()));
if
(
bControls
&&
(
rPolygon
.
isNextControlPointUsed
(
a
)
||
rPolygon
.
isPrevControlPointUsed
(
nNextIndex
)))
if
(
bControls
&&
(
rPolygon
.
isNextControlPointUsed
(
a
)
||
rPolygon
.
isPrevControlPointUsed
(
nNextIndex
)))
{
{
const
basegfx
::
B2DPoint
aCa
(
rPolygon
.
getNextControlPoint
(
a
));
const
basegfx
::
B2DPoint
aCa
(
rPolygon
.
getNextControlPoint
(
a
));
const
basegfx
::
B2DPoint
aCb
(
rPolygon
.
getPrevControlPoint
(
nNextIndex
));
const
basegfx
::
B2DPoint
aCb
(
rPolygon
.
getPrevControlPoint
(
nNextIndex
));
rPath
.
AddBezier
(
Gdiplus
::
DllExports
::
GdipAddPathBezier
(
pPath
,
a
FCurr
,
a
Curr
.
getX
(),
aCurr
.
getY
()
,
Gdiplus
::
PointF
(
Gdiplus
::
REAL
(
aCa
.
getX
()),
Gdiplus
::
REAL
(
aCa
.
getY
())
),
aCa
.
getX
(),
aCa
.
getY
(
),
Gdiplus
::
PointF
(
Gdiplus
::
REAL
(
aCb
.
getX
()),
Gdiplus
::
REAL
(
aCb
.
getY
())
),
aCb
.
getX
(),
aCb
.
getY
(
),
a
FNext
);
a
Next
.
getX
(),
aNext
.
getY
()
);
}
}
else
else
{
{
rPath
.
AddLine
(
aFCurr
,
aFNext
);
Gdiplus
::
DllExports
::
GdipAddPathLine
(
pPath
,
aCurr
.
getX
(),
aCurr
.
getY
(),
aNext
.
getX
(),
aNext
.
getY
()
);
}
}
if
(
a
+
1
<
nEdgeCount
)
if
(
a
+
1
<
nEdgeCount
)
{
{
a
FCurr
=
aF
Next
;
a
Curr
=
a
Next
;
if
(
bNoLineJoin
)
if
(
bNoLineJoin
)
{
{
rPath
.
StartFigure
(
);
Gdiplus
::
DllExports
::
GdipStartPathFigure
(
pPath
);
}
}
}
}
}
}
}
}
}
}
void
impAddB2DPolygonToGDIPlusGraphicsPathInteger
(
Gdiplus
::
G
raphicsPath
&
r
Path
,
const
basegfx
::
B2DPolygon
&
rPolygon
,
bool
bNoLineJoin
)
void
impAddB2DPolygonToGDIPlusGraphicsPathInteger
(
Gdiplus
::
G
pPath
*
p
Path
,
const
basegfx
::
B2DPolygon
&
rPolygon
,
bool
bNoLineJoin
)
{
{
sal_uInt32
nCount
(
rPolygon
.
count
());
sal_uInt32
nCount
(
rPolygon
.
count
());
...
@@ -117,37 +115,36 @@ void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath,
...
@@ -117,37 +115,36 @@ void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath,
const
sal_uInt32
nEdgeCount
(
rPolygon
.
isClosed
()
?
nCount
:
nCount
-
1
);
const
sal_uInt32
nEdgeCount
(
rPolygon
.
isClosed
()
?
nCount
:
nCount
-
1
);
const
bool
bControls
(
rPolygon
.
areControlPointsUsed
());
const
bool
bControls
(
rPolygon
.
areControlPointsUsed
());
basegfx
::
B2DPoint
aCurr
(
rPolygon
.
getB2DPoint
(
0
));
basegfx
::
B2DPoint
aCurr
(
rPolygon
.
getB2DPoint
(
0
));
Gdiplus
::
Point
aICurr
(
INT
(
aCurr
.
getX
()),
INT
(
aCurr
.
getY
()));
for
(
sal_uInt32
a
(
0
);
a
<
nEdgeCount
;
a
++
)
for
(
sal_uInt32
a
(
0
);
a
<
nEdgeCount
;
a
++
)
{
{
const
sal_uInt32
nNextIndex
((
a
+
1
)
%
nCount
);
const
sal_uInt32
nNextIndex
((
a
+
1
)
%
nCount
);
const
basegfx
::
B2DPoint
aNext
(
rPolygon
.
getB2DPoint
(
nNextIndex
));
const
basegfx
::
B2DPoint
aNext
(
rPolygon
.
getB2DPoint
(
nNextIndex
));
const
Gdiplus
::
Point
aINext
(
INT
(
aNext
.
getX
()),
INT
(
aNext
.
getY
()));
if
(
bControls
&&
(
rPolygon
.
isNextControlPointUsed
(
a
)
||
rPolygon
.
isPrevControlPointUsed
(
nNextIndex
)))
if
(
bControls
&&
(
rPolygon
.
isNextControlPointUsed
(
a
)
||
rPolygon
.
isPrevControlPointUsed
(
nNextIndex
)))
{
{
const
basegfx
::
B2DPoint
aCa
(
rPolygon
.
getNextControlPoint
(
a
));
const
basegfx
::
B2DPoint
aCa
(
rPolygon
.
getNextControlPoint
(
a
));
const
basegfx
::
B2DPoint
aCb
(
rPolygon
.
getPrevControlPoint
(
nNextIndex
));
const
basegfx
::
B2DPoint
aCb
(
rPolygon
.
getPrevControlPoint
(
nNextIndex
));
rPath
.
AddBezier
(
Gdiplus
::
DllExports
::
GdipAddPathBezier
(
aICurr
,
pPath
,
Gdiplus
::
Point
(
INT
(
aCa
.
getX
()),
INT
(
aCa
.
getY
())),
aCurr
.
getX
(),
aCurr
.
getY
(),
Gdiplus
::
Point
(
INT
(
aCb
.
getX
()),
INT
(
aCb
.
getY
())),
aCa
.
getX
(),
aCa
.
getY
(),
aINext
);
aCb
.
getX
(),
aCb
.
getY
(),
aNext
.
getX
(),
aNext
.
getY
());
}
}
else
else
{
{
rPath
.
AddLine
(
aICurr
,
aINext
);
Gdiplus
::
DllExports
::
GdipAddPathLine
(
pPath
,
aCurr
.
getX
(),
aCurr
.
getY
(),
aNext
.
getX
(),
aNext
.
getY
()
);
}
}
if
(
a
+
1
<
nEdgeCount
)
if
(
a
+
1
<
nEdgeCount
)
{
{
a
ICurr
=
aI
Next
;
a
Curr
=
a
Next
;
if
(
bNoLineJoin
)
if
(
bNoLineJoin
)
{
{
rPath
.
StartFigure
(
);
Gdiplus
::
DllExports
::
GdipStartPathFigure
(
pPath
);
}
}
}
}
}
}
...
@@ -160,33 +157,39 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
...
@@ -160,33 +157,39 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
if
(
mbBrush
&&
nCount
&&
(
fTransparency
>=
0.0
&&
fTransparency
<
1.0
))
if
(
mbBrush
&&
nCount
&&
(
fTransparency
>=
0.0
&&
fTransparency
<
1.0
))
{
{
Gdiplus
::
Graphics
aGraphics
(
mhDC
);
Gdiplus
::
GpGraphics
*
pGraphics
=
NULL
;
Gdiplus
::
DllExports
::
GdipCreateFromHDC
(
mhDC
,
&
pGraphics
);
const
sal_uInt8
aTrans
((
sal_uInt8
)
255
-
(
sal_uInt8
)
basegfx
::
fround
(
fTransparency
*
255.0
));
const
sal_uInt8
aTrans
((
sal_uInt8
)
255
-
(
sal_uInt8
)
basegfx
::
fround
(
fTransparency
*
255.0
));
Gdiplus
::
Color
aTestColor
(
aTrans
,
SALCOLOR_RED
(
maFillColor
),
SALCOLOR_GREEN
(
maFillColor
),
SALCOLOR_BLUE
(
maFillColor
));
Gdiplus
::
Color
aTestColor
(
aTrans
,
SALCOLOR_RED
(
maFillColor
),
SALCOLOR_GREEN
(
maFillColor
),
SALCOLOR_BLUE
(
maFillColor
));
Gdiplus
::
SolidBrush
aTestBrush
(
aTestColor
);
Gdiplus
::
GpSolidFill
*
pTestBrush
;
Gdiplus
::
GraphicsPath
aPath
;
Gdiplus
::
DllExports
::
GdipCreateSolidFill
(
aTestColor
.
GetValue
(),
&
pTestBrush
);
Gdiplus
::
GpPath
*
pPath
=
NULL
;
Gdiplus
::
DllExports
::
GdipCreatePath
(
Gdiplus
::
FillModeAlternate
,
&
pPath
);
for
(
sal_uInt32
a
(
0
);
a
<
nCount
;
a
++
)
for
(
sal_uInt32
a
(
0
);
a
<
nCount
;
a
++
)
{
{
if
(
0
!=
a
)
if
(
0
!=
a
)
{
{
aPath
.
StartFigure
(
);
// #i101491# not needed for first run
Gdiplus
::
DllExports
::
GdipStartPathFigure
(
pPath
);
// #i101491# not needed for first run
}
}
impAddB2DPolygonToGDIPlusGraphicsPathReal
(
a
Path
,
rPolyPolygon
.
getB2DPolygon
(
a
),
false
);
impAddB2DPolygonToGDIPlusGraphicsPathReal
(
p
Path
,
rPolyPolygon
.
getB2DPolygon
(
a
),
false
);
aPath
.
CloseFigure
(
);
Gdiplus
::
DllExports
::
GdipClosePathFigure
(
pPath
);
}
}
if
(
getAntiAliasB2DDraw
())
if
(
getAntiAliasB2DDraw
())
{
{
aGraphics
.
SetSmoothingMode
(
Gdiplus
::
SmoothingModeAntiAlias
);
Gdiplus
::
DllExports
::
GdipSetSmoothingMode
(
pGraphics
,
Gdiplus
::
SmoothingModeAntiAlias
);
}
}
else
else
{
{
aGraphics
.
SetSmoothingMode
(
Gdiplus
::
SmoothingModeNone
);
Gdiplus
::
DllExports
::
GdipSetSmoothingMode
(
pGraphics
,
Gdiplus
::
SmoothingModeNone
);
}
}
aGraphics
.
FillPath
(
&
aTestBrush
,
&
aPath
);
Gdiplus
::
DllExports
::
GdipFillPath
(
pGraphics
,
pTestBrush
,
pPath
);
Gdiplus
::
DllExports
::
GdipDeletePath
(
pPath
);
Gdiplus
::
DllExports
::
GdipDeleteGraphics
(
pGraphics
);
}
}
return
true
;
return
true
;
...
@@ -198,11 +201,14 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f
...
@@ -198,11 +201,14 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f
if
(
mbPen
&&
nCount
)
if
(
mbPen
&&
nCount
)
{
{
Gdiplus
::
Graphics
aGraphics
(
mhDC
);
Gdiplus
::
GpGraphics
*
pGraphics
=
NULL
;
Gdiplus
::
DllExports
::
GdipCreateFromHDC
(
mhDC
,
&
pGraphics
);
const
sal_uInt8
aTrans
=
(
sal_uInt8
)
basegfx
::
fround
(
255
*
(
1.0
-
fTransparency
)
);
const
sal_uInt8
aTrans
=
(
sal_uInt8
)
basegfx
::
fround
(
255
*
(
1.0
-
fTransparency
)
);
Gdiplus
::
Color
aTestColor
(
aTrans
,
SALCOLOR_RED
(
maLineColor
),
SALCOLOR_GREEN
(
maLineColor
),
SALCOLOR_BLUE
(
maLineColor
));
Gdiplus
::
Color
aTestColor
(
aTrans
,
SALCOLOR_RED
(
maLineColor
),
SALCOLOR_GREEN
(
maLineColor
),
SALCOLOR_BLUE
(
maLineColor
));
Gdiplus
::
Pen
aTestPen
(
aTestColor
,
Gdiplus
::
REAL
(
rLineWidths
.
getX
()));
Gdiplus
::
GpPen
*
pTestPen
=
NULL
;
Gdiplus
::
GraphicsPath
aPath
;
Gdiplus
::
DllExports
::
GdipCreatePen1
(
aTestColor
.
GetValue
(),
Gdiplus
::
REAL
(
rLineWidths
.
getX
()),
Gdiplus
::
UnitWorld
,
&
pTestPen
);
Gdiplus
::
GpPath
*
pPath
;
Gdiplus
::
DllExports
::
GdipCreatePath
(
Gdiplus
::
FillModeAlternate
,
&
pPath
);
bool
bNoLineJoin
(
false
);
bool
bNoLineJoin
(
false
);
switch
(
eLineJoin
)
switch
(
eLineJoin
)
...
@@ -217,49 +223,53 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f
...
@@ -217,49 +223,53 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f
}
}
case
basegfx
:
:
B2DLINEJOIN_BEVEL
:
case
basegfx
:
:
B2DLINEJOIN_BEVEL
:
{
{
aTestPen
.
SetLineJoin
(
Gdiplus
::
LineJoinBevel
);
Gdiplus
::
DllExports
::
GdipSetPenLineJoin
(
pTestPen
,
Gdiplus
::
LineJoinBevel
);
break
;
break
;
}
}
case
basegfx
:
:
B2DLINEJOIN_MIDDLE
:
case
basegfx
:
:
B2DLINEJOIN_MIDDLE
:
case
basegfx
:
:
B2DLINEJOIN_MITER
:
case
basegfx
:
:
B2DLINEJOIN_MITER
:
{
{
const
Gdiplus
::
REAL
aMiterLimit
(
15.0
);
const
Gdiplus
::
REAL
aMiterLimit
(
15.0
);
aTestPen
.
SetMiterLimit
(
aMiterLimit
);
Gdiplus
::
DllExports
::
GdipSetPenMiterLimit
(
pTestPen
,
aMiterLimit
);
aTestPen
.
SetLineJoin
(
Gdiplus
::
LineJoinMiter
);
Gdiplus
::
DllExports
::
GdipSetPenLineJoin
(
pTestPen
,
Gdiplus
::
LineJoinMiter
);
break
;
break
;
}
}
case
basegfx
:
:
B2DLINEJOIN_ROUND
:
case
basegfx
:
:
B2DLINEJOIN_ROUND
:
{
{
aTestPen
.
SetLineJoin
(
Gdiplus
::
LineJoinRound
);
Gdiplus
::
DllExports
::
GdipSetPenLineJoin
(
pTestPen
,
Gdiplus
::
LineJoinRound
);
break
;
break
;
}
}
}
}
if
(
nCount
>
250
&&
basegfx
::
fTools
::
more
(
rLineWidths
.
getX
(),
1.5
))
if
(
nCount
>
250
&&
basegfx
::
fTools
::
more
(
rLineWidths
.
getX
(),
1.5
))
{
{
impAddB2DPolygonToGDIPlusGraphicsPathInteger
(
a
Path
,
rPolygon
,
bNoLineJoin
);
impAddB2DPolygonToGDIPlusGraphicsPathInteger
(
p
Path
,
rPolygon
,
bNoLineJoin
);
}
}
else
else
{
{
impAddB2DPolygonToGDIPlusGraphicsPathReal
(
a
Path
,
rPolygon
,
bNoLineJoin
);
impAddB2DPolygonToGDIPlusGraphicsPathReal
(
p
Path
,
rPolygon
,
bNoLineJoin
);
}
}
if
(
rPolygon
.
isClosed
()
&&
!
bNoLineJoin
)
if
(
rPolygon
.
isClosed
()
&&
!
bNoLineJoin
)
{
{
// #i101491# needed to create the correct line joins
// #i101491# needed to create the correct line joins
aPath
.
CloseFigure
(
);
Gdiplus
::
DllExports
::
GdipClosePathFigure
(
pPath
);
}
}
if
(
getAntiAliasB2DDraw
())
if
(
getAntiAliasB2DDraw
())
{
{
aGraphics
.
SetSmoothingMode
(
Gdiplus
::
SmoothingModeAntiAlias
);
Gdiplus
::
DllExports
::
GdipSetSmoothingMode
(
pGraphics
,
Gdiplus
::
SmoothingModeAntiAlias
);
}
}
else
else
{
{
aGraphics
.
SetSmoothingMode
(
Gdiplus
::
SmoothingModeNone
);
Gdiplus
::
DllExports
::
GdipSetSmoothingMode
(
pGraphics
,
Gdiplus
::
SmoothingModeNone
);
}
}
aGraphics
.
DrawPath
(
&
aTestPen
,
&
aPath
);
Gdiplus
::
DllExports
::
GdipDrawPath
(
pGraphics
,
pTestPen
,
pPath
);
Gdiplus
::
DllExports
::
GdipDeletePath
(
pPath
);
Gdiplus
::
DllExports
::
GdipDeletePen
(
pTestPen
);
Gdiplus
::
DllExports
::
GdipDeleteGraphics
(
pGraphics
);
}
}
return
true
;
return
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