Skip to content

Commit 4dca594

Browse files
committed
Bug 1484624 - Don't create texture sources if the compositor doesn't have a GL context. r=sotaro
UltraBlame original commit: 389ffe7befeeee61318659e3c76b4ae2b93bb446
1 parent 7171cb2 commit 4dca594

File tree

2 files changed

+115
-0
lines changed

2 files changed

+115
-0
lines changed

gfx/layers/opengl/CompositorOGL.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12217,6 +12217,18 @@ TextureFlags
1221712217
aFlags
1221812218
)
1221912219
{
12220+
if
12221+
(
12222+
!
12223+
gl
12224+
(
12225+
)
12226+
)
12227+
{
12228+
return
12229+
nullptr
12230+
;
12231+
}
1222012232
return
1222112233
MakeAndAddRef
1222212234
<
@@ -12242,6 +12254,18 @@ TextureHost
1224212254
aTexture
1224312255
)
1224412256
{
12257+
if
12258+
(
12259+
!
12260+
gl
12261+
(
12262+
)
12263+
)
12264+
{
12265+
return
12266+
nullptr
12267+
;
12268+
}
1224512269
BufferTextureHost
1224612270
*
1224712271
bufferTexture
@@ -12749,6 +12773,18 @@ DataSourceSurface
1274912773
aSurface
1275012774
)
1275112775
{
12776+
if
12777+
(
12778+
!
12779+
gl
12780+
(
12781+
)
12782+
)
12783+
{
12784+
return
12785+
nullptr
12786+
;
12787+
}
1275212788
return
1275312789
MakeAndAddRef
1275412790
<

gfx/layers/opengl/TextureHostOGL.cpp

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,15 @@ bool
20202020
aBlocking
20212021
)
20222022
{
2023+
if
2024+
(
2025+
!
2026+
gl
2027+
(
2028+
)
2029+
|
2030+
|
2031+
!
20232032
gl
20242033
(
20252034
)
@@ -2028,7 +2037,63 @@ gl
20282037
MakeCurrent
20292038
(
20302039
)
2040+
)
2041+
{
2042+
/
2043+
/
2044+
We
2045+
use
2046+
this
2047+
function
2048+
to
2049+
decide
2050+
whether
2051+
we
2052+
can
2053+
unlock
2054+
the
2055+
texture
2056+
/
2057+
/
2058+
and
2059+
clean
2060+
it
2061+
up
2062+
.
2063+
If
2064+
we
2065+
return
2066+
false
2067+
here
2068+
and
2069+
for
2070+
whatever
2071+
reason
2072+
/
2073+
/
2074+
the
2075+
context
2076+
is
2077+
absent
2078+
or
2079+
invalid
2080+
the
2081+
compositor
2082+
will
2083+
keep
2084+
a
2085+
/
2086+
/
2087+
reference
2088+
to
2089+
this
2090+
texture
2091+
forever
2092+
.
2093+
return
2094+
true
20312095
;
2096+
}
20322097
if
20332098
(
20342099
!
@@ -2104,6 +2169,15 @@ bool
21042169
aInit
21052170
)
21062171
{
2172+
if
2173+
(
2174+
!
2175+
gl
2176+
(
2177+
)
2178+
|
2179+
|
2180+
!
21072181
gl
21082182
(
21092183
)
@@ -2112,7 +2186,12 @@ gl
21122186
MakeCurrent
21132187
(
21142188
)
2189+
)
2190+
{
2191+
return
2192+
false
21152193
;
2194+
}
21162195
if
21172196
(
21182197
aInit

0 commit comments

Comments
 (0)