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
2241e250
Kaydet (Commit)
2241e250
authored
Nis 13, 2014
tarafından
Chris Sherlock
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rearrange position of gradient functions in outdev4.cxx
Change-Id: I4f70af90568f7641e57d94f27cc138abd190d1b9
üst
13fec19b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
134 additions
and
134 deletions
+134
-134
outdev4.cxx
vcl/source/gdi/outdev/outdev4.cxx
+134
-134
No files found.
vcl/source/gdi/outdev/outdev4.cxx
Dosyayı görüntüle @
2241e250
...
...
@@ -128,6 +128,140 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
delete
pPolyPoly
;
}
void
OutputDevice
::
DrawGradient
(
const
Rectangle
&
rRect
,
const
Gradient
&
rGradient
)
{
// Convert rectangle to a PolyPolygon by first converting to a Polygon
Polygon
aPolygon
(
rRect
);
PolyPolygon
aPolyPoly
(
aPolygon
);
DrawGradient
(
aPolyPoly
,
rGradient
);
}
void
OutputDevice
::
DrawGradient
(
const
PolyPolygon
&
rPolyPoly
,
const
Gradient
&
rGradient
)
{
if
(
mnDrawMode
&
DRAWMODE_NOGRADIENT
)
return
;
// nothing to draw!
if
(
mbInitClipRegion
)
ImplInitClipRegion
();
if
(
mbOutputClipped
)
return
;
if
(
rPolyPoly
.
Count
()
&&
rPolyPoly
[
0
].
GetSize
()
)
{
if
(
mnDrawMode
&
(
DRAWMODE_BLACKGRADIENT
|
DRAWMODE_WHITEGRADIENT
|
DRAWMODE_SETTINGSGRADIENT
)
)
{
Color
aColor
=
GetSingleColorGradientFill
();
Push
(
PUSH_LINECOLOR
|
PUSH_FILLCOLOR
);
SetLineColor
(
aColor
);
SetFillColor
(
aColor
);
DrawPolyPolygon
(
rPolyPoly
);
Pop
();
return
;
}
Gradient
aGradient
(
rGradient
);
if
(
mnDrawMode
&
(
DRAWMODE_GRAYGRADIENT
|
DRAWMODE_GHOSTEDGRADIENT
)
)
{
SetGrayscaleColors
(
aGradient
);
}
if
(
mpMetaFile
)
{
const
Rectangle
aBoundRect
(
rPolyPoly
.
GetBoundRect
()
);
if
(
rPolyPoly
.
IsRect
()
)
{
mpMetaFile
->
AddAction
(
new
MetaGradientAction
(
aBoundRect
,
aGradient
)
);
}
else
{
mpMetaFile
->
AddAction
(
new
MetaCommentAction
(
"XGRAD_SEQ_BEGIN"
)
);
mpMetaFile
->
AddAction
(
new
MetaGradientExAction
(
rPolyPoly
,
rGradient
)
);
Push
(
PUSH_CLIPREGION
);
IntersectClipRegion
(
Region
(
rPolyPoly
));
DrawGradient
(
aBoundRect
,
rGradient
);
Pop
();
mpMetaFile
->
AddAction
(
new
MetaCommentAction
(
"XGRAD_SEQ_END"
)
);
}
}
if
(
!
IsDeviceOutputNecessary
()
||
ImplIsRecordLayout
()
)
return
;
// Clip and then draw the gradient
if
(
!
Rectangle
(
PixelToLogic
(
Point
()
),
GetOutputSize
()
).
IsEmpty
()
)
{
const
Rectangle
aBoundRect
(
rPolyPoly
.
GetBoundRect
()
);
// convert rectangle to pixels
Rectangle
aRect
(
ImplLogicToDevicePixel
(
aBoundRect
)
);
aRect
.
Justify
();
// do nothing if the rectangle is empty
if
(
!
aRect
.
IsEmpty
()
)
{
if
(
!
mpGraphics
&&
!
ImplGetGraphics
()
)
return
;
// secure clip region
Push
(
PUSH_CLIPREGION
);
IntersectClipRegion
(
aBoundRect
);
if
(
mbInitClipRegion
)
ImplInitClipRegion
();
if
(
!
mbOutputClipped
)
{
PolyPolygon
aClipPolyPoly
(
ImplLogicToDevicePixel
(
rPolyPoly
)
);
// draw gradients without border
if
(
mbLineColor
||
mbInitLineColor
)
{
mpGraphics
->
SetLineColor
();
mbInitLineColor
=
true
;
}
mbInitFillColor
=
true
;
// calculate step count if necessary
if
(
!
aGradient
.
GetSteps
()
)
aGradient
.
SetSteps
(
GRADIENT_DEFAULT_STEPCOUNT
);
if
(
rPolyPoly
.
IsRect
()
)
{
// because we draw with no border line, we have to expand gradient
// rect to avoid missing lines on the right and bottom edge
aRect
.
Left
()
--
;
aRect
.
Top
()
--
;
aRect
.
Right
()
++
;
aRect
.
Bottom
()
++
;
}
// if the clipping polypolygon is a rectangle, then it's the same size as the bounding of the
// polypolygon, so pass in a NULL for the clipping parameter
if
(
aGradient
.
GetStyle
()
==
GradientStyle_LINEAR
||
rGradient
.
GetStyle
()
==
GradientStyle_AXIAL
)
ImplDrawLinearGradient
(
aRect
,
aGradient
,
false
,
aClipPolyPoly
.
IsRect
()
?
NULL
:
&
aClipPolyPoly
);
else
ImplDrawComplexGradient
(
aRect
,
aGradient
,
false
,
aClipPolyPoly
.
IsRect
()
?
NULL
:
&
aClipPolyPoly
);
}
Pop
();
}
}
}
if
(
mpAlphaVDev
)
mpAlphaVDev
->
DrawPolyPolygon
(
rPolyPoly
);
}
inline
sal_uInt8
ImplGetGradientColorValue
(
long
nValue
)
{
if
(
nValue
<
0
)
...
...
@@ -603,140 +737,6 @@ void OutputDevice::SetGrayscaleColors( Gradient &rGradient )
rGradient
.
SetEndColor
(
aEndCol
);
}
void
OutputDevice
::
DrawGradient
(
const
Rectangle
&
rRect
,
const
Gradient
&
rGradient
)
{
// Convert rectangle to a PolyPolygon by first converting to a Polygon
Polygon
aPolygon
(
rRect
);
PolyPolygon
aPolyPoly
(
aPolygon
);
DrawGradient
(
aPolyPoly
,
rGradient
);
}
void
OutputDevice
::
DrawGradient
(
const
PolyPolygon
&
rPolyPoly
,
const
Gradient
&
rGradient
)
{
if
(
mnDrawMode
&
DRAWMODE_NOGRADIENT
)
return
;
// nothing to draw!
if
(
mbInitClipRegion
)
ImplInitClipRegion
();
if
(
mbOutputClipped
)
return
;
if
(
rPolyPoly
.
Count
()
&&
rPolyPoly
[
0
].
GetSize
()
)
{
if
(
mnDrawMode
&
(
DRAWMODE_BLACKGRADIENT
|
DRAWMODE_WHITEGRADIENT
|
DRAWMODE_SETTINGSGRADIENT
)
)
{
Color
aColor
=
GetSingleColorGradientFill
();
Push
(
PUSH_LINECOLOR
|
PUSH_FILLCOLOR
);
SetLineColor
(
aColor
);
SetFillColor
(
aColor
);
DrawPolyPolygon
(
rPolyPoly
);
Pop
();
return
;
}
Gradient
aGradient
(
rGradient
);
if
(
mnDrawMode
&
(
DRAWMODE_GRAYGRADIENT
|
DRAWMODE_GHOSTEDGRADIENT
)
)
{
SetGrayscaleColors
(
aGradient
);
}
if
(
mpMetaFile
)
{
const
Rectangle
aBoundRect
(
rPolyPoly
.
GetBoundRect
()
);
if
(
rPolyPoly
.
IsRect
()
)
{
mpMetaFile
->
AddAction
(
new
MetaGradientAction
(
aBoundRect
,
aGradient
)
);
}
else
{
mpMetaFile
->
AddAction
(
new
MetaCommentAction
(
"XGRAD_SEQ_BEGIN"
)
);
mpMetaFile
->
AddAction
(
new
MetaGradientExAction
(
rPolyPoly
,
rGradient
)
);
Push
(
PUSH_CLIPREGION
);
IntersectClipRegion
(
Region
(
rPolyPoly
));
DrawGradient
(
aBoundRect
,
rGradient
);
Pop
();
mpMetaFile
->
AddAction
(
new
MetaCommentAction
(
"XGRAD_SEQ_END"
)
);
}
}
if
(
!
IsDeviceOutputNecessary
()
||
ImplIsRecordLayout
()
)
return
;
// Clip and then draw the gradient
if
(
!
Rectangle
(
PixelToLogic
(
Point
()
),
GetOutputSize
()
).
IsEmpty
()
)
{
const
Rectangle
aBoundRect
(
rPolyPoly
.
GetBoundRect
()
);
// convert rectangle to pixels
Rectangle
aRect
(
ImplLogicToDevicePixel
(
aBoundRect
)
);
aRect
.
Justify
();
// do nothing if the rectangle is empty
if
(
!
aRect
.
IsEmpty
()
)
{
if
(
!
mpGraphics
&&
!
ImplGetGraphics
()
)
return
;
// secure clip region
Push
(
PUSH_CLIPREGION
);
IntersectClipRegion
(
aBoundRect
);
if
(
mbInitClipRegion
)
ImplInitClipRegion
();
if
(
!
mbOutputClipped
)
{
PolyPolygon
aClipPolyPoly
(
ImplLogicToDevicePixel
(
rPolyPoly
)
);
// draw gradients without border
if
(
mbLineColor
||
mbInitLineColor
)
{
mpGraphics
->
SetLineColor
();
mbInitLineColor
=
true
;
}
mbInitFillColor
=
true
;
// calculate step count if necessary
if
(
!
aGradient
.
GetSteps
()
)
aGradient
.
SetSteps
(
GRADIENT_DEFAULT_STEPCOUNT
);
if
(
rPolyPoly
.
IsRect
()
)
{
// because we draw with no border line, we have to expand gradient
// rect to avoid missing lines on the right and bottom edge
aRect
.
Left
()
--
;
aRect
.
Top
()
--
;
aRect
.
Right
()
++
;
aRect
.
Bottom
()
++
;
}
// if the clipping polypolygon is a rectangle, then it's the same size as the bounding of the
// polypolygon, so pass in a NULL for the clipping parameter
if
(
aGradient
.
GetStyle
()
==
GradientStyle_LINEAR
||
rGradient
.
GetStyle
()
==
GradientStyle_AXIAL
)
ImplDrawLinearGradient
(
aRect
,
aGradient
,
false
,
aClipPolyPoly
.
IsRect
()
?
NULL
:
&
aClipPolyPoly
);
else
ImplDrawComplexGradient
(
aRect
,
aGradient
,
false
,
aClipPolyPoly
.
IsRect
()
?
NULL
:
&
aClipPolyPoly
);
}
Pop
();
}
}
}
if
(
mpAlphaVDev
)
mpAlphaVDev
->
DrawPolyPolygon
(
rPolyPoly
);
}
void
OutputDevice
::
AddGradientActions
(
const
Rectangle
&
rRect
,
const
Gradient
&
rGradient
,
GDIMetaFile
&
rMtf
)
{
...
...
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