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
986c0451
Kaydet (Commit)
986c0451
authored
Haz 26, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: fdo#80160 PNG with 1-bit colormap only show black and white
Change-Id: If0c9950c18e6091fafea47954a4654db436a3a44
üst
7af733d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
salgdi2.cxx
vcl/unx/generic/gdi/salgdi2.cxx
+29
-21
No files found.
vcl/unx/generic/gdi/salgdi2.cxx
Dosyayı görüntüle @
986c0451
...
@@ -440,6 +440,32 @@ void X11SalGraphics::copyArea ( long nDestX, long nDestY,
...
@@ -440,6 +440,32 @@ void X11SalGraphics::copyArea ( long nDestX, long nDestY,
copyBits
(
aPosAry
,
0
);
copyBits
(
aPosAry
,
0
);
}
}
namespace
{
void
setForeBack
(
XGCValues
&
rValues
,
const
SalColormap
&
rColMap
,
const
SalBitmap
&
rSalBitmap
)
{
rValues
.
foreground
=
rColMap
.
GetWhitePixel
();
rValues
.
background
=
rColMap
.
GetBlackPixel
();
//fdo#33455 and fdo#80160 handle 1 bit depth pngs with palette entries
//to set fore/back colors
SalBitmap
&
rBitmap
=
const_cast
<
SalBitmap
&>
(
rSalBitmap
);
if
(
const
BitmapBuffer
*
pBitmapBuffer
=
rBitmap
.
AcquireBuffer
(
true
))
{
const
BitmapPalette
&
rPalette
=
pBitmapBuffer
->
maPalette
;
if
(
rPalette
.
GetEntryCount
()
==
2
)
{
const
BitmapColor
aWhite
(
rPalette
[
rPalette
.
GetBestIndex
(
Color
(
COL_WHITE
))]);
rValues
.
foreground
=
rColMap
.
GetPixel
(
ImplColorToSal
(
aWhite
));
const
BitmapColor
aBlack
(
rPalette
[
rPalette
.
GetBestIndex
(
Color
(
COL_BLACK
))]);
rValues
.
background
=
rColMap
.
GetPixel
(
ImplColorToSal
(
aBlack
));
}
rBitmap
.
ReleaseBuffer
(
pBitmapBuffer
,
true
);
}
}
}
void
X11SalGraphics
::
drawBitmap
(
const
SalTwoRect
&
rPosAry
,
const
SalBitmap
&
rSalBitmap
)
void
X11SalGraphics
::
drawBitmap
(
const
SalTwoRect
&
rPosAry
,
const
SalBitmap
&
rSalBitmap
)
{
{
const
SalDisplay
*
pSalDisp
=
GetDisplay
();
const
SalDisplay
*
pSalDisp
=
GetDisplay
();
...
@@ -455,24 +481,7 @@ void X11SalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSa
...
@@ -455,24 +481,7 @@ void X11SalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSa
{
{
// set foreground/background values for 1Bit bitmaps
// set foreground/background values for 1Bit bitmaps
XGetGCValues
(
pXDisp
,
aGC
,
nValues
,
&
aOldVal
);
XGetGCValues
(
pXDisp
,
aGC
,
nValues
,
&
aOldVal
);
setForeBack
(
aNewVal
,
rColMap
,
rSalBitmap
);
aNewVal
.
foreground
=
rColMap
.
GetWhitePixel
();
aNewVal
.
background
=
rColMap
.
GetBlackPixel
();
//fdo#33455 handle 1 bit depth pngs with palette entries
//to set fore/back colors
if
(
const
BitmapBuffer
*
pBitmapBuffer
=
const_cast
<
SalBitmap
&>
(
rSalBitmap
).
AcquireBuffer
(
true
))
{
const
BitmapPalette
&
rPalette
=
pBitmapBuffer
->
maPalette
;
if
(
rPalette
.
GetEntryCount
()
==
2
)
{
const
BitmapColor
aBlack
(
rPalette
[
rPalette
.
GetBestIndex
(
Color
(
COL_BLACK
)
)]
);
const
BitmapColor
aWhite
(
rPalette
[
rPalette
.
GetBestIndex
(
Color
(
COL_WHITE
)
)]
);
aNewVal
.
foreground
=
rColMap
.
GetPixel
(
ImplColorToSal
(
aWhite
));
aNewVal
.
background
=
rColMap
.
GetPixel
(
ImplColorToSal
(
aBlack
));
}
}
XChangeGC
(
pXDisp
,
aGC
,
nValues
,
&
aNewVal
);
XChangeGC
(
pXDisp
,
aGC
,
nValues
,
&
aNewVal
);
}
}
...
@@ -525,13 +534,12 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect& rPosAry,
...
@@ -525,13 +534,12 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect& rPosAry,
{
{
GC
aTmpGC
;
GC
aTmpGC
;
XGCValues
aValues
;
XGCValues
aValues
;
const
SalColormap
&
rColMap
=
pSalDisp
->
GetColormap
(
m_nXScreen
);
setForeBack
(
aValues
,
pSalDisp
->
GetColormap
(
m_nXScreen
),
rSalBitmap
);
const
int
nBlack
=
rColMap
.
GetBlackPixel
(),
nWhite
=
rColMap
.
GetWhitePixel
();
const
int
nValues
=
GCFunction
|
GCForeground
|
GCBackground
;
const
int
nValues
=
GCFunction
|
GCForeground
|
GCBackground
;
SalTwoRect
aTmpRect
(
rPosAry
);
aTmpRect
.
mnDestX
=
aTmpRect
.
mnDestY
=
0
;
SalTwoRect
aTmpRect
(
rPosAry
);
aTmpRect
.
mnDestX
=
aTmpRect
.
mnDestY
=
0
;
// draw paint bitmap in pixmap #1
// draw paint bitmap in pixmap #1
aValues
.
function
=
GXcopy
,
aValues
.
foreground
=
nWhite
,
aValues
.
background
=
nBlack
;
aValues
.
function
=
GXcopy
;
aTmpGC
=
XCreateGC
(
pXDisp
,
aFG
,
nValues
,
&
aValues
);
aTmpGC
=
XCreateGC
(
pXDisp
,
aFG
,
nValues
,
&
aValues
);
static_cast
<
const
X11SalBitmap
&>
(
rSalBitmap
).
ImplDraw
(
aFG
,
m_nXScreen
,
nDepth
,
aTmpRect
,
aTmpGC
);
static_cast
<
const
X11SalBitmap
&>
(
rSalBitmap
).
ImplDraw
(
aFG
,
m_nXScreen
,
nDepth
,
aTmpRect
,
aTmpGC
);
DBG_TESTTRANS
(
aFG
);
DBG_TESTTRANS
(
aFG
);
...
...
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