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
e3771338
Kaydet (Commit)
e3771338
authored
Agu 19, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#92019 Use texture atlas for 16, 24, 32, 48, 64 px width images
Change-Id: Ie95c36fe3705e2645a59cac117d99d7b85388ce1
üst
167bc621
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
salbmp.cxx
vcl/opengl/salbmp.cxx
+36
-1
No files found.
vcl/opengl/salbmp.cxx
Dosyayı görüntüle @
e3771338
...
@@ -31,11 +31,20 @@
...
@@ -31,11 +31,20 @@
#include "opengl/program.hxx"
#include "opengl/program.hxx"
#include "opengl/salbmp.hxx"
#include "opengl/salbmp.hxx"
#include "opengl/FixedTextureAtlas.hxx"
namespace
{
static
bool
isValidBitCount
(
sal_uInt16
nBitCount
)
static
bool
isValidBitCount
(
sal_uInt16
nBitCount
)
{
{
return
(
nBitCount
==
1
)
||
(
nBitCount
==
4
)
||
(
nBitCount
==
8
)
||
(
nBitCount
==
16
)
||
(
nBitCount
==
24
)
||
(
nBitCount
==
32
);
return
(
nBitCount
==
1
)
||
(
nBitCount
==
4
)
||
(
nBitCount
==
8
)
||
(
nBitCount
==
16
)
||
(
nBitCount
==
24
)
||
(
nBitCount
==
32
);
}
}
static
std
::
vector
<
std
::
unique_ptr
<
FixedTextureAtlasManager
>>
sTextureAtlases
;
}
OpenGLSalBitmap
::
OpenGLSalBitmap
()
OpenGLSalBitmap
::
OpenGLSalBitmap
()
:
mpContext
(
NULL
)
:
mpContext
(
NULL
)
,
mbDirtyTexture
(
true
)
,
mbDirtyTexture
(
true
)
...
@@ -314,6 +323,31 @@ ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const BitmapPalet
...
@@ -314,6 +323,31 @@ ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const BitmapPalet
return
0
;
return
0
;
}
}
void
lclInstantiateTexture
(
OpenGLTexture
&
rTexture
,
const
int
nWidth
,
const
int
nHeight
,
const
GLenum
nFormat
,
const
GLenum
nType
,
sal_uInt8
*
pData
)
{
if
(
nWidth
==
nHeight
)
{
if
(
sTextureAtlases
.
empty
())
{
sTextureAtlases
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
FixedTextureAtlasManager
>
(
new
FixedTextureAtlasManager
(
8
,
8
,
16
))));
sTextureAtlases
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
FixedTextureAtlasManager
>
(
new
FixedTextureAtlasManager
(
8
,
8
,
24
))));
sTextureAtlases
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
FixedTextureAtlasManager
>
(
new
FixedTextureAtlasManager
(
8
,
8
,
32
))));
sTextureAtlases
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
FixedTextureAtlasManager
>
(
new
FixedTextureAtlasManager
(
8
,
8
,
48
))));
sTextureAtlases
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
FixedTextureAtlasManager
>
(
new
FixedTextureAtlasManager
(
8
,
8
,
64
))));
}
for
(
size_t
i
=
0
;
i
<
sTextureAtlases
.
size
();
i
++
)
{
if
(
nWidth
==
sTextureAtlases
[
i
]
->
GetSubtextureSize
())
{
rTexture
=
sTextureAtlases
[
i
]
->
InsertBuffer
(
nWidth
,
nHeight
,
nFormat
,
nType
,
pData
);
return
;
}
}
}
rTexture
=
OpenGLTexture
(
nWidth
,
nHeight
,
nFormat
,
nType
,
pData
);
}
}
}
Size
OpenGLSalBitmap
::
GetSize
()
const
Size
OpenGLSalBitmap
::
GetSize
()
const
...
@@ -410,7 +444,8 @@ GLuint OpenGLSalBitmap::CreateTexture()
...
@@ -410,7 +444,8 @@ GLuint OpenGLSalBitmap::CreateTexture()
makeCurrent
();
makeCurrent
();
maTexture
=
OpenGLTexture
(
mnBufWidth
,
mnBufHeight
,
nFormat
,
nType
,
pData
);
lclInstantiateTexture
(
maTexture
,
mnBufWidth
,
mnBufHeight
,
nFormat
,
nType
,
pData
);
SAL_INFO
(
"vcl.opengl"
,
"Created texture "
<<
maTexture
.
Id
()
);
SAL_INFO
(
"vcl.opengl"
,
"Created texture "
<<
maTexture
.
Id
()
);
if
(
bAllocated
)
if
(
bAllocated
)
...
...
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