summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLTexture.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-07-19 19:08:25 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-07-19 19:08:25 +0200
commit3f9e299b6ee9ec68eb41694703b939dab35e43a3 (patch)
tree7b903719c55703366c6c5068286e813e55af1d6d /dom/canvas/WebGLTexture.cpp
parentb0a8ed215774469e1d5476d670bb9e2ccbd23ed8 (diff)
downloadUXP-3f9e299b6ee9ec68eb41694703b939dab35e43a3.tar
UXP-3f9e299b6ee9ec68eb41694703b939dab35e43a3.tar.gz
UXP-3f9e299b6ee9ec68eb41694703b939dab35e43a3.tar.lz
UXP-3f9e299b6ee9ec68eb41694703b939dab35e43a3.tar.xz
UXP-3f9e299b6ee9ec68eb41694703b939dab35e43a3.zip
Truncate Buffer/Texture on GL_OOM.
Diffstat (limited to 'dom/canvas/WebGLTexture.cpp')
-rw-r--r--dom/canvas/WebGLTexture.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/dom/canvas/WebGLTexture.cpp b/dom/canvas/WebGLTexture.cpp
index 767ff610a..65bb71153 100644
--- a/dom/canvas/WebGLTexture.cpp
+++ b/dom/canvas/WebGLTexture.cpp
@@ -51,8 +51,6 @@ WebGLTexture::ImageInfo::Clear()
WebGLTexture::ImageInfo&
WebGLTexture::ImageInfo::operator =(const ImageInfo& a)
{
- MOZ_ASSERT(a.IsDefined());
-
Mutable(mFormat) = a.mFormat;
Mutable(mWidth) = a.mWidth;
Mutable(mHeight) = a.mHeight;
@@ -1216,6 +1214,12 @@ WebGLTexture::TexParameter(TexTarget texTarget, GLenum pname, const FloatOrInt&
mContext->gl->fTexParameterf(texTarget.get(), pname, clamped.f);
}
+void WebGLTexture::Truncate() {
+ for (auto& cur : mImageInfoArr) {
+ SetImageInfo(&cur, ImageInfo());
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLTexture)