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
b85d24e4
Kaydet (Commit)
b85d24e4
authored
Eyl 16, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
opengl: support reading back 1-bit masks from texture
Change-Id: Ibe8d9140f7a54016f2cd684198856ac27d880aa3
üst
0165da09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
12 deletions
+46
-12
salbmp.cxx
vcl/opengl/salbmp.cxx
+46
-12
No files found.
vcl/opengl/salbmp.cxx
Dosyayı görüntüle @
b85d24e4
...
@@ -469,8 +469,6 @@ GLuint OpenGLSalBitmap::CreateTexture()
...
@@ -469,8 +469,6 @@ GLuint OpenGLSalBitmap::CreateTexture()
bool
OpenGLSalBitmap
::
ReadTexture
()
bool
OpenGLSalBitmap
::
ReadTexture
()
{
{
sal_uInt8
*
pData
=
maUserBuffer
.
get
();
sal_uInt8
*
pData
=
maUserBuffer
.
get
();
GLenum
nFormat
=
GL_RGBA
;
GLenum
nType
=
GL_UNSIGNED_BYTE
;
SAL_INFO
(
"vcl.opengl"
,
"::ReadTexture "
<<
mnWidth
<<
"x"
<<
mnHeight
);
SAL_INFO
(
"vcl.opengl"
,
"::ReadTexture "
<<
mnWidth
<<
"x"
<<
mnHeight
);
...
@@ -479,8 +477,8 @@ bool OpenGLSalBitmap::ReadTexture()
...
@@ -479,8 +477,8 @@ bool OpenGLSalBitmap::ReadTexture()
if
(
mnBits
==
8
||
mnBits
==
16
||
mnBits
==
24
||
mnBits
==
32
)
if
(
mnBits
==
8
||
mnBits
==
16
||
mnBits
==
24
||
mnBits
==
32
)
{
{
// no conversion needed for truecolor
GLenum
nFormat
=
GL_RGBA
;
pData
=
maUserBuffer
.
get
()
;
GLenum
nType
=
GL_UNSIGNED_BYTE
;
switch
(
mnBits
)
switch
(
mnBits
)
{
{
...
@@ -497,18 +495,54 @@ bool OpenGLSalBitmap::ReadTexture()
...
@@ -497,18 +495,54 @@ bool OpenGLSalBitmap::ReadTexture()
nType
=
GL_UNSIGNED_BYTE
;
nType
=
GL_UNSIGNED_BYTE
;
break
;
break
;
}
}
makeCurrent
();
maTexture
.
Read
(
nFormat
,
nType
,
pData
);
mnBufWidth
=
mnWidth
;
mnBufHeight
=
mnHeight
;
return
true
;
}
}
else
else
if
(
mnBits
==
1
)
{
{
// convert buffers from 24-bit RGB to 1-bit Mask
return
false
;
std
::
vector
<
sal_uInt8
>
aBuffer
(
mnWidth
*
mnHeight
*
3
);
makeCurrent
();
sal_uInt8
*
pBuffer
=
aBuffer
.
data
();
maTexture
.
Read
(
GL_RGB
,
GL_UNSIGNED_BYTE
,
pBuffer
);
int
nShift
=
7
;
size_t
nIndex
=
0
;
sal_uInt8
*
pCurrent
=
pBuffer
;
for
(
size_t
i
=
0
;
i
<
aBuffer
.
size
();
i
+=
3
)
{
sal_uInt8
nR
=
*
pCurrent
++
;
sal_uInt8
nG
=
*
pCurrent
++
;
sal_uInt8
nB
=
*
pCurrent
++
;
if
(
nR
>
0
&&
nG
>
0
&&
nB
>
0
)
{
pData
[
nIndex
]
|=
(
1
<<
nShift
);
}
nShift
--
;
if
(
nShift
<
0
)
{
nShift
=
7
;
nIndex
++
;
pData
[
nIndex
]
=
0
;
}
}
mnBufWidth
=
mnWidth
;
mnBufHeight
=
mnHeight
;
return
true
;
}
}
makeCurrent
();
SAL_WARN
(
"vcl.opengl"
,
"::ReadTexture - tx:"
<<
maTexture
.
Id
()
<<
" @ "
maTexture
.
Read
(
nFormat
,
nType
,
pData
);
<<
mnWidth
<<
"x"
<<
mnHeight
<<
"- unimplemented bit depth: "
mnBufWidth
=
mnWidth
;
<<
mnBits
)
;
mnBufHeight
=
mnHeight
;
return
false
;
return
true
;
}
}
sal_uInt16
OpenGLSalBitmap
::
GetBitCount
()
const
sal_uInt16
OpenGLSalBitmap
::
GetBitCount
()
const
...
...
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