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
03327cbd
Kaydet (Commit)
03327cbd
authored
Eki 10, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1242439 ALPHABITS == nAlphaShift == 8
Change-Id: Ifde395113524df03a2523115ab2234403d405455
üst
04301686
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
bmpfast.cxx
vcl/source/gdi/bmpfast.cxx
+6
-9
No files found.
vcl/source/gdi/bmpfast.cxx
Dosyayı görüntüle @
03327cbd
...
@@ -267,18 +267,15 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst,
...
@@ -267,18 +267,15 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst,
}
}
// alpha blending truecolor pixels
// alpha blending truecolor pixels
template
<
unsigned
ALPHABITS
,
sal_uLong
SRCFMT
,
sal_uLong
DSTFMT
>
template
<
sal_uLong
SRCFMT
,
sal_uLong
DSTFMT
>
inline
void
ImplBlendPixels
(
const
TrueColorPixelPtr
<
DSTFMT
>&
rDst
,
inline
void
ImplBlendPixels
(
const
TrueColorPixelPtr
<
DSTFMT
>&
rDst
,
const
TrueColorPixelPtr
<
SRCFMT
>&
rSrc
,
unsigned
nAlphaVal
)
const
TrueColorPixelPtr
<
SRCFMT
>&
rSrc
,
unsigned
nAlphaVal
)
{
{
static
const
unsigned
nAlphaShift
=
8
;
if
(
!
nAlphaVal
)
if
(
!
nAlphaVal
)
ImplConvertPixel
(
rDst
,
rSrc
);
ImplConvertPixel
(
rDst
,
rSrc
);
else
if
(
nAlphaVal
!=
~
(
~
0U
<<
ALPHABITS
)
)
else
if
(
nAlphaVal
!=
~
(
~
0U
<<
nAlphaShift
)
)
{
{
static
const
unsigned
nAlphaShift
=
(
ALPHABITS
>
8
)
?
8
:
ALPHABITS
;
if
(
ALPHABITS
>
nAlphaShift
)
nAlphaVal
>>=
ALPHABITS
-
nAlphaShift
;
int
nR
=
rDst
.
GetRed
();
int
nR
=
rDst
.
GetRed
();
int
nS
=
rSrc
.
GetRed
();
int
nS
=
rSrc
.
GetRed
();
nR
=
nS
+
(((
nR
-
nS
)
*
nAlphaVal
)
>>
nAlphaShift
);
nR
=
nS
+
(((
nR
-
nS
)
*
nAlphaVal
)
>>
nAlphaShift
);
...
@@ -297,7 +294,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst,
...
@@ -297,7 +294,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst,
}
}
}
}
template
<
unsigned
ALPHABITS
,
sal_uLong
MASKFMT
,
sal_uLong
SRCFMT
,
sal_uLong
DSTFMT
>
template
<
sal_uLong
MASKFMT
,
sal_uLong
SRCFMT
,
sal_uLong
DSTFMT
>
inline
void
ImplBlendLines
(
const
TrueColorPixelPtr
<
DSTFMT
>&
rDst
,
inline
void
ImplBlendLines
(
const
TrueColorPixelPtr
<
DSTFMT
>&
rDst
,
const
TrueColorPixelPtr
<
SRCFMT
>&
rSrc
,
const
TrueColorPixelPtr
<
MASKFMT
>&
rMsk
,
const
TrueColorPixelPtr
<
SRCFMT
>&
rSrc
,
const
TrueColorPixelPtr
<
MASKFMT
>&
rMsk
,
int
nPixelCount
)
int
nPixelCount
)
...
@@ -307,7 +304,7 @@ inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
...
@@ -307,7 +304,7 @@ inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
TrueColorPixelPtr
<
SRCFMT
>
aSrc
(
rSrc
);
TrueColorPixelPtr
<
SRCFMT
>
aSrc
(
rSrc
);
while
(
--
nPixelCount
>=
0
)
while
(
--
nPixelCount
>=
0
)
{
{
ImplBlendPixels
<
ALPHABITS
>
(
aDst
,
aSrc
,
aMsk
.
GetAlpha
()
);
ImplBlendPixels
(
aDst
,
aSrc
,
aMsk
.
GetAlpha
()
);
++
aDst
;
++
aDst
;
++
aSrc
;
++
aSrc
;
++
aMsk
;
++
aMsk
;
...
@@ -576,7 +573,7 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
...
@@ -576,7 +573,7 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
assert
(
rDstBuffer
.
mnHeight
<=
rSrcBuffer
.
mnHeight
&&
"not sure about that?"
);
assert
(
rDstBuffer
.
mnHeight
<=
rSrcBuffer
.
mnHeight
&&
"not sure about that?"
);
for
(
int
y
=
rDstBuffer
.
mnHeight
;
--
y
>=
0
;)
for
(
int
y
=
rDstBuffer
.
mnHeight
;
--
y
>=
0
;)
{
{
ImplBlendLines
<
8
>
(
aDstLine
,
rSrcLine
,
aMskLine
,
rDstBuffer
.
mnWidth
);
ImplBlendLines
(
aDstLine
,
rSrcLine
,
aMskLine
,
rDstBuffer
.
mnWidth
);
aDstLine
.
AddByteOffset
(
nDstLinestep
);
aDstLine
.
AddByteOffset
(
nDstLinestep
);
rSrcLine
.
AddByteOffset
(
nSrcLinestep
);
rSrcLine
.
AddByteOffset
(
nSrcLinestep
);
aMskLine
.
AddByteOffset
(
nMskLinestep
);
aMskLine
.
AddByteOffset
(
nMskLinestep
);
...
...
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