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
4d841e5f
Kaydet (Commit)
4d841e5f
authored
Agu 31, 2015
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add another vcldemo OpenGL test to try to catch another Windows nasty.
Change-Id: I43e48617617e89f5aa089ef1487215c5b81c50bc
üst
16b0e217
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
4 deletions
+43
-4
vcldemo.cxx
vcl/workben/vcldemo.cxx
+43
-4
No files found.
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
4d841e5f
...
...
@@ -1660,9 +1660,9 @@ class OpenGLTests
OpenGLContext
*
mpA
;
OpenGLContext
*
mpB
;
static
OpenGLSalGraphicsImpl
*
getImpl
(
const
VclPtr
<
WorkWindow
>
&
x
Win
)
static
OpenGLSalGraphicsImpl
*
getImpl
(
const
VclPtr
<
WorkWindow
>
&
x
Out
)
{
SalGraphics
*
pGraphics
=
x
Win
->
GetGraphics
();
SalGraphics
*
pGraphics
=
x
Out
->
GetGraphics
();
return
dynamic_cast
<
OpenGLSalGraphicsImpl
*>
(
pGraphics
->
GetImpl
());
}
public
:
...
...
@@ -1683,6 +1683,7 @@ public:
mpB
=
mpImplB
->
GetOpenGLContext
();
assert
(
mpA
&&
mpB
);
assert
(
mpA
!=
mpB
);
}
~
OpenGLTests
()
{
...
...
@@ -1698,19 +1699,57 @@ public:
{
OpenGLTexture
aTexture
(
256
,
128
);
pBuffer
=
mpA
->
AcquireFramebuffer
(
aTexture
);
pBuffer
->
DetachTexture
();
// TESTME - remove this line too ...
}
assert
(
pBuffer
->
IsFree
());
assert
(
pBuffer
->
IsFree
());
(
void
)
pBuffer
;
mpB
->
makeCurrent
();
assert
(
mpA
->
mpCurrentFramebuffer
==
NULL
);
}
void
testVirtualDevice
()
{
fprintf
(
stderr
,
"test sharing OpenGLContexts with virtual-devices reference counting
\n
"
);
VclPtrInstance
<
WorkWindow
>
xTempWin
(
nullptr
,
WB_STDWORK
);
xTempWin
->
Show
();
// forcibly make this context current by rendering
xTempWin
->
DrawPixel
(
Point
(
0
,
0
),
COL_RED
);
// get some other guys to leach off this context
VclPtrInstance
<
VirtualDevice
>
xVDev
;
OpenGLContext
*
pContext
=
getImpl
(
xVDev
)
->
GetOpenGLContext
();
VclPtrInstance
<
VirtualDevice
>
xVDev2
;
OpenGLContext
*
pContext2
=
getImpl
(
xVDev
)
->
GetOpenGLContext
();
// sharing the same off-screen context.
assert
(
pContext
==
pContext2
);
assert
(
pContext
==
getImpl
(
xTempWin
)
->
GetOpenGLContext
());
assert
(
pContext
!=
mpA
&&
pContext
!=
mpB
);
(
void
)
pContext
;
(
void
)
pContext2
;
// Kill the parent we free-ride on ...
xTempWin
.
disposeAndClear
();
// This appears to continue working; fun.
Point
aPt
(
0
,
0
);
xVDev
->
DrawPixel
(
aPt
,
COL_GREEN
);
assert
(
xVDev
->
GetPixel
(
aPt
)
==
COL_GREEN
);
xVDev
.
disposeAndClear
();
// Switch context to see if we can switch back.
mxWinA
->
DrawPixel
(
aPt
,
COL_WHITE
);
// Now try switching back to this guy ...
xVDev2
->
DrawPixel
(
aPt
,
COL_BLUE
);
assert
(
xVDev2
->
GetPixel
(
aPt
)
==
COL_BLUE
);
xVDev2
.
disposeAndClear
();
}
int
execute
()
{
if
(
!
OpenGLHelper
::
isVCLOpenGLEnabled
())
return
1
;
testCurrentFramebuffer
();
testVirtualDevice
();
return
0
;
}
...
...
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