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
4fee13c3
Kaydet (Commit)
4fee13c3
authored
Kas 25, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtk3: of course we have a different 1 bit mask format as well
Change-Id: I02763bc1dfeec4a04f40fa0246cdc93eab6d6d33
üst
528417fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
svpgdi.cxx
vcl/headless/svpgdi.cxx
+26
-7
No files found.
vcl/headless/svpgdi.cxx
Dosyayı görüntüle @
4fee13c3
...
...
@@ -134,6 +134,17 @@ bool SvpSalGraphics::blendAlphaBitmap( const SalTwoRect&, const SalBitmap&, cons
return
false
;
}
namespace
{
unsigned
char
reverseAndInvert
(
unsigned
char
b
)
{
b
=
(
b
&
0xF0
)
>>
4
|
(
b
&
0x0F
)
<<
4
;
b
=
(
b
&
0xCC
)
>>
2
|
(
b
&
0x33
)
<<
2
;
b
=
(
b
&
0xAA
)
>>
1
|
(
b
&
0x55
)
<<
1
;
return
~
b
;
}
}
bool
SvpSalGraphics
::
drawAlphaBitmap
(
const
SalTwoRect
&
rTR
,
const
SalBitmap
&
rSourceBitmap
,
const
SalBitmap
&
rAlphaBitmap
)
{
bool
bRet
=
false
;
...
...
@@ -201,13 +212,10 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS
memcpy
(
pAlphaBits
,
pSrcBits
,
nImageSize
);
// TODO: make upper layers use standard alpha
long
*
pLDst
=
reinterpret_cast
<
long
*>
(
pAlphaBits
);
for
(
int
i
=
nImageSize
/
sizeof
(
long
);
--
i
>=
0
;
++
pLDst
)
sal_uInt32
*
pLDst
=
reinterpret_cast
<
sal_uInt32
*>
(
pAlphaBits
);
for
(
int
i
=
nImageSize
/
sizeof
(
sal_uInt32
);
--
i
>=
0
;
++
pLDst
)
*
pLDst
=
~*
pLDst
;
char
*
pCDst
=
reinterpret_cast
<
char
*>
(
pLDst
);
for
(
int
i
=
nImageSize
&
(
sizeof
(
long
)
-
1
);
--
i
>=
0
;
++
pCDst
)
*
pCDst
=
~*
pCDst
;
assert
(
reinterpret_cast
<
unsigned
char
*>
(
pLDst
)
==
pAlphaBits
+
nImageSize
);
mask
=
cairo_image_surface_create_for_data
(
pAlphaBits
,
CAIRO_FORMAT_A8
,
...
...
@@ -216,7 +224,18 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS
}
else
{
mask
=
cairo_image_surface_create_for_data
(
data
.
get
(),
// the alpha values need to be inverted *and* reordered for Cairo
// so big stupid copy and reverse + invert here
const
int
nImageSize
=
size
.
getY
()
*
nStride
;
const
unsigned
char
*
pSrcBits
=
data
.
get
();
pAlphaBits
=
new
unsigned
char
[
nImageSize
];
memcpy
(
pAlphaBits
,
pSrcBits
,
nImageSize
);
unsigned
char
*
pDst
=
pAlphaBits
;
for
(
int
i
=
nImageSize
;
--
i
>=
0
;
++
pDst
)
*
pDst
=
reverseAndInvert
(
*
pDst
);
mask
=
cairo_image_surface_create_for_data
(
pAlphaBits
,
CAIRO_FORMAT_A1
,
size
.
getX
(),
size
.
getY
(),
nStride
);
...
...
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