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
d8719aa0
Kaydet (Commit)
d8719aa0
authored
Nis 27, 2014
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
OpenGLContext: Provide all data for SystemChildWindow creation.
Change-Id: I7a0ceee6c784af8240fb908f19622d4ede1f5a6a
üst
d276ad15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
OpenGLContext.hxx
include/vcl/opengl/OpenGLContext.hxx
+2
-0
OpenGLContext.cxx
vcl/source/opengl/OpenGLContext.cxx
+89
-0
No files found.
include/vcl/opengl/OpenGLContext.hxx
Dosyayı görüntüle @
d8719aa0
...
@@ -157,6 +157,8 @@ public:
...
@@ -157,6 +157,8 @@ public:
return
mbInitialized
;
return
mbInitialized
;
}
}
static
SystemWindowData
generateWinData
(
Window
*
pParent
);
private
:
private
:
SAL_DLLPRIVATE
bool
initWindow
();
SAL_DLLPRIVATE
bool
initWindow
();
...
...
vcl/source/opengl/OpenGLContext.cxx
Dosyayı görüntüle @
d8719aa0
...
@@ -684,4 +684,93 @@ bool OpenGLContext::initWindow()
...
@@ -684,4 +684,93 @@ bool OpenGLContext::initWindow()
#endif
#endif
#if defined( WNT ) || defined( MACOSX ) || defined( IOS) || defined( ANDROID )
SystemWindowData
OpenGLContext
::
generateWinData
(
Window
*
/*pParent*/
)
{
SystemWindowData
aWinData
;
aWinData
.
nSize
=
sizeof
(
aWinData
);
return
aWinData
;
}
#elif defined( UNX )
SystemWindowData
OpenGLContext
::
generateWinData
(
Window
*
pParent
)
{
SystemWindowData
aWinData
;
aWinData
.
nSize
=
sizeof
(
aWinData
);
const
SystemEnvData
*
sysData
(
pParent
->
GetSystemData
());
Display
*
dpy
=
reinterpret_cast
<
Display
*>
(
sysData
->
pDisplay
);
if
(
!
glXQueryExtension
(
dpy
,
NULL
,
NULL
)
)
return
aWinData
;
XLIB_Window
win
=
sysData
->
aWindow
;
SAL_INFO
(
"vcl.opengl"
,
"parent window: "
<<
win
);
XWindowAttributes
xattr
;
XGetWindowAttributes
(
dpy
,
win
,
&
xattr
);
int
screen
=
XScreenNumberOfScreen
(
xattr
.
screen
);
static
int
visual_attribs
[]
=
{
GLX_RED_SIZE
,
8
,
GLX_GREEN_SIZE
,
8
,
GLX_BLUE_SIZE
,
8
,
GLX_ALPHA_SIZE
,
8
,
GLX_DEPTH_SIZE
,
24
,
GLX_X_VISUAL_TYPE
,
GLX_TRUE_COLOR
,
None
};
initOpenGLFunctionPointers
();
int
fbCount
=
0
;
GLXFBConfig
*
pFBC
=
glXChooseFBConfig
(
dpy
,
screen
,
visual_attribs
,
&
fbCount
);
if
(
!
pFBC
)
{
SAL_WARN
(
"vcl.opengl"
,
"no suitable fb format found"
);
return
aWinData
;
}
int
best_fbc
=
-
1
,
best_num_samp
=
-
1
;
for
(
int
i
=
0
;
i
<
fbCount
;
++
i
)
{
XVisualInfo
*
pVi
=
glXGetVisualFromFBConfig
(
dpy
,
pFBC
[
i
]
);
if
(
pVi
)
{
// pick the one with the most samples per pixel
int
nSampleBuf
=
0
;
int
nSamples
=
0
;
glXGetFBConfigAttrib
(
dpy
,
pFBC
[
i
],
GLX_SAMPLE_BUFFERS
,
&
nSampleBuf
);
glXGetFBConfigAttrib
(
dpy
,
pFBC
[
i
],
GLX_SAMPLES
,
&
nSamples
);
if
(
best_fbc
<
0
||
(
nSampleBuf
&&
(
nSamples
>
best_num_samp
))
)
{
best_fbc
=
i
;
best_num_samp
=
nSamples
;
}
}
XFree
(
pVi
);
}
XVisualInfo
*
vi
=
glXGetVisualFromFBConfig
(
dpy
,
pFBC
[
best_fbc
]
);
if
(
vi
)
{
SAL_INFO
(
"vcl.opengl"
,
"using VisualID "
<<
vi
->
visualid
);
aWinData
.
pVisual
=
(
void
*
)(
vi
->
visual
);
}
return
aWinData
;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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