summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-08-30 12:36:03 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-08-30 12:36:40 +0200
commit4f504d46be3df72acba5892da090355b2189974d (patch)
tree3650276d8277244e1ba0839022e80c4db7dec949
parent1edc7328f216117a0178c78d70e43a7bfc705089 (diff)
downloadUXP-4f504d46be3df72acba5892da090355b2189974d.tar
UXP-4f504d46be3df72acba5892da090355b2189974d.tar.gz
UXP-4f504d46be3df72acba5892da090355b2189974d.tar.lz
UXP-4f504d46be3df72acba5892da090355b2189974d.tar.xz
UXP-4f504d46be3df72acba5892da090355b2189974d.zip
Revert "Bug 1388020. r=nical, a=RyanVM"
This reverts commit e7189e33f533f9b974b22c2110b522a13bc4c7f6.
-rw-r--r--gfx/gl/GLTextureImage.cpp3
-rw-r--r--gfx/gl/GLUploadHelpers.cpp31
-rw-r--r--gfx/gl/GLUploadHelpers.h2
-rw-r--r--gfx/gl/TextureImageEGL.cpp4
-rw-r--r--gfx/layers/composite/TextureHost.cpp3
-rw-r--r--gfx/layers/opengl/TextureHostOGL.cpp4
6 files changed, 6 insertions, 41 deletions
diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp
index 65678432d..c91d558af 100644
--- a/gfx/gl/GLTextureImage.cpp
+++ b/gfx/gl/GLTextureImage.cpp
@@ -149,9 +149,6 @@ BasicTextureImage::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion
&uploadSize,
needInit,
aFrom);
- if (mTextureFormat == SurfaceFormat::UNKNOWN) {
- return false;
- }
if (uploadSize > 0) {
UpdateUploadSize(uploadSize);
diff --git a/gfx/gl/GLUploadHelpers.cpp b/gfx/gl/GLUploadHelpers.cpp
index ca1c890a4..75165eedf 100644
--- a/gfx/gl/GLUploadHelpers.cpp
+++ b/gfx/gl/GLUploadHelpers.cpp
@@ -27,23 +27,6 @@ DataOffset(const IntPoint& aPoint, int32_t aStride, SurfaceFormat aFormat)
return data;
}
-static bool
-CheckUploadBounds(const IntSize& aDst, const IntSize& aSrc, const IntPoint& aOffset)
-{
- if (aOffset.x < 0 || aOffset.y < 0 ||
- aOffset.x >= aSrc.width ||
- aOffset.y >= aSrc.height) {
- MOZ_ASSERT_UNREACHABLE("Offset outside source bounds");
- return false;
- }
- if (aDst.width > (aSrc.width - aOffset.x) ||
- aDst.height > (aSrc.height - aOffset.y)) {
- MOZ_ASSERT_UNREACHABLE("Source has insufficient data");
- return false;
- }
- return true;
-}
-
static GLint GetAddressAlignment(ptrdiff_t aAddress)
{
if (!(aAddress & 0x7)) {
@@ -392,7 +375,6 @@ TexImage2DHelper(GLContext* gl,
SurfaceFormat
UploadImageDataToTexture(GLContext* gl,
unsigned char* aData,
- const gfx::IntSize& aDataSize,
int32_t aStride,
SurfaceFormat aFormat,
const nsIntRegion& aDstRegion,
@@ -516,10 +498,6 @@ UploadImageDataToTexture(GLContext* gl,
// Upload each rect in the region to the texture
for (auto iter = aDstRegion.RectIter(); !iter.Done(); iter.Next()) {
const IntRect& rect = iter.Get();
- if (!CheckUploadBounds(rect.Size(), aDataSize, rect.TopLeft())) {
- return SurfaceFormat::UNKNOWN;
- }
-
const unsigned char* rectData =
aData + DataOffset(rect.TopLeft(), aStride, aFormat);
@@ -556,17 +534,10 @@ UploadSurfaceToTexture(GLContext* gl,
int32_t stride = aSurface->Stride();
SurfaceFormat format = aSurface->GetFormat();
- gfx::IntSize size = aSurface->GetSize();
- if (!CheckUploadBounds(aSize, size, aSrcPoint)) {
- return SurfaceFormat::UNKNOWN;
- }
-
unsigned char* data = aSurface->GetData() +
DataOffset(aSrcPoint, stride, format);
- size.width -= aSrcPoint.x;
- size.height -= aSrcPoint.y;
- return UploadImageDataToTexture(gl, data, size, stride, format,
+ return UploadImageDataToTexture(gl, data, stride, format,
aDstRegion, aTexture, aSize,
aOutUploadSize, aNeedInit,
aTextureUnit, aTextureTarget);
diff --git a/gfx/gl/GLUploadHelpers.h b/gfx/gl/GLUploadHelpers.h
index f732d2b38..866d44adb 100644
--- a/gfx/gl/GLUploadHelpers.h
+++ b/gfx/gl/GLUploadHelpers.h
@@ -28,7 +28,6 @@ class GLContext;
* \param gl The GL Context to use.
* \param aData Start of image data of surface to upload.
* Corresponds to the first pixel of the texture.
- * \param aDataSize The image data's size.
* \param aStride The image data's stride.
* \param aFormat The image data's format.
* \param aDstRegion Region of the texture to upload.
@@ -47,7 +46,6 @@ class GLContext;
gfx::SurfaceFormat
UploadImageDataToTexture(GLContext* gl,
unsigned char* aData,
- const gfx::IntSize& aDataSize,
int32_t aStride,
gfx::SurfaceFormat aFormat,
const nsIntRegion& aDstRegion,
diff --git a/gfx/gl/TextureImageEGL.cpp b/gfx/gl/TextureImageEGL.cpp
index 3bb2987d1..87a547c26 100644
--- a/gfx/gl/TextureImageEGL.cpp
+++ b/gfx/gl/TextureImageEGL.cpp
@@ -119,10 +119,6 @@ TextureImageEGL::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion&
&uploadSize,
needInit,
aFrom);
- if (mTextureFormat == SurfaceFormat::UNKNOWN) {
- return false;
- }
-
if (uploadSize > 0) {
UpdateUploadSize(uploadSize);
}
diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp
index e4a2ffd86..b342f1d18 100644
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -890,7 +890,8 @@ BufferTextureHost::Upload(nsIntRegion *aRegion)
mFirstSource = mCompositor->CreateDataTextureSource(mFlags|TextureFlags::RGB_FROM_YCBCR);
mFirstSource->SetOwner(this);
}
- return mFirstSource->Update(surf, aRegion);
+ mFirstSource->Update(surf, aRegion);
+ return true;
}
RefPtr<DataTextureSource> srcY;
diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp
index ec6ba9131..02c398b51 100644
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -161,7 +161,9 @@ TextureImageTextureSourceOGL::Update(gfx::DataSourceSurface* aSurface,
}
}
- return mTexImage->UpdateFromDataSource(aSurface, aDestRegion, aSrcOffset);
+ mTexImage->UpdateFromDataSource(aSurface, aDestRegion, aSrcOffset);
+
+ return true;
}
void