mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out 4 changesets (bug 1395497) for Linux failures in test_conformance__textures__misc__texture-npot-video.html
Backed out changeset c99dadd2df7d (bug 1395497) Backed out changeset 4e3dd1e01908 (bug 1395497) Backed out changeset c9fbcd8bd4cb (bug 1395497) Backed out changeset a8503893cc85 (bug 1395497) MozReview-Commit-ID: C324dGFTpLb
This commit is contained in:
parent
e56423e0fe
commit
838e056c79
@ -702,10 +702,10 @@ TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* fun
|
||||
break;
|
||||
}
|
||||
|
||||
const gfx::IntSize dstSize(mWidth, mHeight);
|
||||
const gfx::IntSize destSize(mWidth, mHeight);
|
||||
const auto dstOrigin = (webgl->mPixelStore_FlipY ? gl::OriginPos::TopLeft
|
||||
: gl::OriginPos::BottomLeft);
|
||||
if (!gl->BlitHelper()->BlitImageToFramebuffer(mImage, dstSize, dstOrigin)) {
|
||||
if (!gl->BlitHelper()->BlitImageToFramebuffer(mImage, destSize, dstOrigin)) {
|
||||
fallbackReason = "likely bug: failed to blit";
|
||||
break;
|
||||
}
|
||||
|
@ -8,17 +8,35 @@ namespace mozilla {
|
||||
namespace gl {
|
||||
|
||||
void
|
||||
AndroidSurfaceTexture::GetTransformMatrix(java::sdk::SurfaceTexture::Param surfaceTexture,
|
||||
gfx::Matrix4x4* outMatrix)
|
||||
AndroidSurfaceTexture::GetTransformMatrix(java::sdk::SurfaceTexture::LocalRef aSurfaceTexture,
|
||||
gfx::Matrix4x4& aMatrix)
|
||||
{
|
||||
JNIEnv* const env = jni::GetEnvForThread();
|
||||
|
||||
auto jarray = jni::FloatArray::LocalRef::Adopt(env, env->NewFloatArray(16));
|
||||
surfaceTexture->GetTransformMatrix(jarray);
|
||||
aSurfaceTexture->GetTransformMatrix(jarray);
|
||||
|
||||
jfloat* array = env->GetFloatArrayElements(jarray.Get(), nullptr);
|
||||
|
||||
memcpy(&(outMatrix->_11), array, sizeof(float)*16);
|
||||
aMatrix._11 = array[0];
|
||||
aMatrix._12 = array[1];
|
||||
aMatrix._13 = array[2];
|
||||
aMatrix._14 = array[3];
|
||||
|
||||
aMatrix._21 = array[4];
|
||||
aMatrix._22 = array[5];
|
||||
aMatrix._23 = array[6];
|
||||
aMatrix._24 = array[7];
|
||||
|
||||
aMatrix._31 = array[8];
|
||||
aMatrix._32 = array[9];
|
||||
aMatrix._33 = array[10];
|
||||
aMatrix._34 = array[11];
|
||||
|
||||
aMatrix._41 = array[12];
|
||||
aMatrix._42 = array[13];
|
||||
aMatrix._43 = array[14];
|
||||
aMatrix._44 = array[15];
|
||||
|
||||
env->ReleaseFloatArrayElements(jarray.Get(), array, 0);
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ namespace gl {
|
||||
|
||||
class AndroidSurfaceTexture {
|
||||
public:
|
||||
static void GetTransformMatrix(java::sdk::SurfaceTexture::Param surfaceTexture,
|
||||
mozilla::gfx::Matrix4x4* outMatrix);
|
||||
static void GetTransformMatrix(java::sdk::SurfaceTexture::LocalRef aSurfaceTexture,
|
||||
mozilla::gfx::Matrix4x4& aMatrix);
|
||||
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "GPUVideoImage.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "GeneratedJNIWrappers.h"
|
||||
#include "AndroidSurfaceTexture.h"
|
||||
#include "GLImages.h"
|
||||
#include "GLLibraryEGL.h"
|
||||
@ -57,11 +56,7 @@ const char* const kFragHeader_Tex2DRect = "\
|
||||
const char* const kFragHeader_TexExt = "\
|
||||
#extension GL_OES_EGL_image_external : require \n\
|
||||
#define SAMPLER samplerExternalOES \n\
|
||||
#if __VERSION__ >= 130 \n\
|
||||
#define TEXTURE texture \n\
|
||||
#else \n\
|
||||
#define TEXTURE texture2D \n\
|
||||
#endif \n\
|
||||
#define TEXTURE texture2D \n\
|
||||
";
|
||||
|
||||
const char* const kFragBody_RGBA = "\
|
||||
@ -121,83 +116,6 @@ const char* const kFragBody_PlanarYUV = "\
|
||||
} \n\
|
||||
";
|
||||
|
||||
// --
|
||||
|
||||
template<uint8_t N>
|
||||
/*static*/ Mat<N>
|
||||
Mat<N>::Zero()
|
||||
{
|
||||
Mat<N> ret;
|
||||
for (auto& x : ret.m) {
|
||||
x = 0.0f;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<uint8_t N>
|
||||
/*static*/ Mat<N>
|
||||
Mat<N>::I()
|
||||
{
|
||||
auto ret = Mat<N>::Zero();
|
||||
for (uint8_t i = 0; i < N; i++) {
|
||||
ret.at(i,i) = 1.0f;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<uint8_t N>
|
||||
Mat<N>
|
||||
Mat<N>::operator*(const Mat<N>& r) const
|
||||
{
|
||||
Mat<N> ret;
|
||||
for (uint8_t x = 0; x < N; x++) {
|
||||
for (uint8_t y = 0; y < N; y++) {
|
||||
float sum = 0.0f;
|
||||
for (uint8_t i = 0; i < N; i++) {
|
||||
sum += at(i,y) * r.at(x,i);
|
||||
}
|
||||
ret.at(x,y) = sum;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Mat3
|
||||
SubRectMat3(const float x, const float y, const float w, const float h)
|
||||
{
|
||||
auto ret = Mat3::Zero();
|
||||
ret.at(0,0) = w;
|
||||
ret.at(1,1) = h;
|
||||
ret.at(2,0) = x;
|
||||
ret.at(2,1) = y;
|
||||
ret.at(2,2) = 1.0f;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Mat3
|
||||
SubRectMat3(const gfx::IntRect& subrect, const gfx::IntSize& size)
|
||||
{
|
||||
return SubRectMat3(subrect.x / size.width,
|
||||
subrect.y / size.height,
|
||||
subrect.width / size.width,
|
||||
subrect.height / size.height);
|
||||
}
|
||||
|
||||
Mat3
|
||||
SubRectMat3(const gfx::IntRect& bigSubrect, const gfx::IntSize& smallSize,
|
||||
const gfx::IntSize& divisors)
|
||||
{
|
||||
const float x = float(bigSubrect.x) / divisors.width;
|
||||
const float y = float(bigSubrect.y) / divisors.height;
|
||||
const float w = float(bigSubrect.width) / divisors.width;
|
||||
const float h = float(bigSubrect.height) / divisors.height;
|
||||
return SubRectMat3(x / smallSize.width,
|
||||
y / smallSize.height,
|
||||
w / smallSize.width,
|
||||
h / smallSize.height);
|
||||
}
|
||||
|
||||
|
||||
// --
|
||||
|
||||
ScopedSaveMultiTex::ScopedSaveMultiTex(GLContext* const gl, const uint8_t texCount,
|
||||
@ -348,7 +266,6 @@ public:
|
||||
mGL.fColorMask(true, true, true, true);
|
||||
|
||||
mGL.fGetIntegerv(LOCAL_GL_VIEWPORT, viewport);
|
||||
MOZ_ASSERT(destSize.width && destSize.height);
|
||||
mGL.fViewport(0, 0, destSize.width, destSize.height);
|
||||
}
|
||||
|
||||
@ -377,15 +294,19 @@ public:
|
||||
DrawBlitProg::DrawBlitProg(const GLBlitHelper* const parent, const GLuint prog)
|
||||
: mParent(*parent)
|
||||
, mProg(prog)
|
||||
, mLoc_uDestMatrix(mParent.mGL->fGetUniformLocation(mProg, "uDestMatrix"))
|
||||
, mLoc_uTexMatrix0(mParent.mGL->fGetUniformLocation(mProg, "uTexMatrix0"))
|
||||
, mLoc_uTexMatrix1(mParent.mGL->fGetUniformLocation(mProg, "uTexMatrix1"))
|
||||
, mLoc_u1ForYFlip(mParent.mGL->fGetUniformLocation(mProg, "u1ForYFlip"))
|
||||
, mLoc_uSrcRect(mParent.mGL->fGetUniformLocation(mProg, "uSrcRect"))
|
||||
, mLoc_uTexSize0(mParent.mGL->fGetUniformLocation(mProg, "uTexSize0"))
|
||||
, mLoc_uTexSize1(mParent.mGL->fGetUniformLocation(mProg, "uTexSize1"))
|
||||
, mLoc_uDivisors(mParent.mGL->fGetUniformLocation(mProg, "uDivisors"))
|
||||
, mLoc_uColorMatrix(mParent.mGL->fGetUniformLocation(mProg, "uColorMatrix"))
|
||||
{
|
||||
MOZ_ASSERT(mLoc_uDestMatrix != -1);
|
||||
MOZ_ASSERT(mLoc_uTexMatrix0 != -1);
|
||||
MOZ_ASSERT(mLoc_u1ForYFlip != -1);
|
||||
MOZ_ASSERT(mLoc_uSrcRect != -1);
|
||||
MOZ_ASSERT(mLoc_uTexSize0 != -1);
|
||||
if (mLoc_uColorMatrix != -1) {
|
||||
MOZ_ASSERT(mLoc_uTexMatrix1 != -1);
|
||||
MOZ_ASSERT(mLoc_uTexSize1 != -1);
|
||||
MOZ_ASSERT(mLoc_uDivisors != -1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,31 +329,16 @@ DrawBlitProg::Draw(const BaseArgs& args, const YUVArgs* const argsYUV) const
|
||||
|
||||
// --
|
||||
|
||||
Mat3 destMatrix;
|
||||
if (args.destRect) {
|
||||
const auto& destRect = args.destRect.value();
|
||||
destMatrix = SubRectMat3(destRect.x / args.destSize.width,
|
||||
destRect.y / args.destSize.height,
|
||||
destRect.width / args.destSize.width,
|
||||
destRect.height / args.destSize.height);
|
||||
} else {
|
||||
destMatrix = Mat3::I();
|
||||
}
|
||||
|
||||
if (args.yFlip) {
|
||||
// Apply the y-flip matrix before the destMatrix.
|
||||
// That is, flip y=[0-1] to y=[1-0] before we restrict to the destRect.
|
||||
destMatrix.at(2,1) += destMatrix.at(1,1);
|
||||
destMatrix.at(1,1) *= -1.0f;
|
||||
}
|
||||
|
||||
gl->fUniformMatrix3fv(mLoc_uDestMatrix, 1, false, destMatrix.m);
|
||||
gl->fUniformMatrix3fv(mLoc_uTexMatrix0, 1, false, args.texMatrix0.m);
|
||||
gl->fUniform1f(mLoc_u1ForYFlip, args.yFlip ? 1 : 0);
|
||||
gl->fUniform4f(mLoc_uSrcRect,
|
||||
args.srcRect.x, args.srcRect.y,
|
||||
args.srcRect.width, args.srcRect.height);
|
||||
gl->fUniform2f(mLoc_uTexSize0, args.texSize0.width, args.texSize0.height);
|
||||
|
||||
MOZ_ASSERT(bool(argsYUV) == (mLoc_uColorMatrix != -1));
|
||||
if (argsYUV) {
|
||||
gl->fUniformMatrix3fv(mLoc_uTexMatrix1, 1, false, argsYUV->texMatrix1.m);
|
||||
|
||||
gl->fUniform2f(mLoc_uTexSize1, argsYUV->texSize1.width, argsYUV->texSize1.height);
|
||||
gl->fUniform2f(mLoc_uDivisors, argsYUV->divisors.width, argsYUV->divisors.height);
|
||||
const auto& colorMatrix = gfxUtils::YuvToRgbMatrix4x4ColumnMajor(argsYUV->colorSpace);
|
||||
gl->fUniformMatrix4fv(mLoc_uColorMatrix, 1, false, colorMatrix);
|
||||
}
|
||||
@ -534,24 +440,31 @@ GLBlitHelper::GLBlitHelper(GLContext* const gl)
|
||||
#define VARYING varying \n\
|
||||
#endif \n\
|
||||
\n\
|
||||
ATTRIBUTE vec2 aVert; // [0.0-1.0] \n\
|
||||
ATTRIBUTE vec2 aVert; \n\
|
||||
\n\
|
||||
uniform mat3 uDestMatrix; \n\
|
||||
uniform mat3 uTexMatrix0; \n\
|
||||
uniform mat3 uTexMatrix1; \n\
|
||||
uniform float u1ForYFlip; \n\
|
||||
uniform vec4 uSrcRect; \n\
|
||||
uniform vec2 uTexSize0; \n\
|
||||
uniform vec2 uTexSize1; \n\
|
||||
uniform vec2 uDivisors; \n\
|
||||
\n\
|
||||
VARYING vec2 vTexCoord0; \n\
|
||||
VARYING vec2 vTexCoord1; \n\
|
||||
\n\
|
||||
void main(void) \n\
|
||||
{ \n\
|
||||
vec2 destPos = (uDestMatrix * vec3(aVert, 1.0)).xy; \n\
|
||||
gl_Position = vec4(destPos * 2.0 - 1.0, 0.0, 1.0); \n\
|
||||
vec2 vertPos = aVert * 2.0 - 1.0; \n\
|
||||
gl_Position = vec4(vertPos, 0.0, 1.0); \n\
|
||||
\n\
|
||||
vTexCoord0 = (uTexMatrix0 * vec3(aVert, 1.0)).xy; \n\
|
||||
vTexCoord1 = (uTexMatrix1 * vec3(aVert, 1.0)).xy; \n\
|
||||
vec2 texCoord = aVert; \n\
|
||||
texCoord.y = abs(u1ForYFlip - texCoord.y); \n\
|
||||
texCoord = texCoord * uSrcRect.zw + uSrcRect.xy; \n\
|
||||
\n\
|
||||
vTexCoord0 = texCoord / uTexSize0; \n\
|
||||
vTexCoord1 = texCoord / (uTexSize1 * uDivisors); \n\
|
||||
} \n\
|
||||
";
|
||||
|
||||
const char* const parts[] = {
|
||||
mDrawBlitProg_VersionLine.get(),
|
||||
kVertSource
|
||||
@ -665,13 +578,13 @@ GLBlitHelper::CreateDrawBlitProg(const DrawBlitProg::Key& key) const
|
||||
mGL->fGetShaderiv(vs, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&vsLogLen);
|
||||
const UniquePtr<char[]> vsLog(new char[vsLogLen+1]);
|
||||
mGL->fGetShaderInfoLog(vs, vsLogLen, nullptr, vsLog.get());
|
||||
vsLog[vsLogLen] = 0;
|
||||
progLog[progLogLen] = 0;
|
||||
|
||||
GLuint fsLogLen = 0;
|
||||
mGL->fGetShaderiv(fs, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&fsLogLen);
|
||||
const UniquePtr<char[]> fsLog(new char[fsLogLen+1]);
|
||||
mGL->fGetShaderInfoLog(fs, fsLogLen, nullptr, fsLog.get());
|
||||
fsLog[fsLogLen] = 0;
|
||||
progLog[progLogLen] = 0;
|
||||
|
||||
gfxCriticalError() << "DrawBlitProg link failed:\n"
|
||||
<< "progLog: " << progLog.get() << "\n"
|
||||
@ -683,9 +596,9 @@ GLBlitHelper::CreateDrawBlitProg(const DrawBlitProg::Key& key) const
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool
|
||||
GLBlitHelper::BlitImageToFramebuffer(layers::Image* const srcImage,
|
||||
GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage,
|
||||
const gfx::IntSize& destSize,
|
||||
const OriginPos destOrigin)
|
||||
OriginPos destOrigin)
|
||||
{
|
||||
switch (srcImage->GetFormat()) {
|
||||
case ImageFormat::PLANAR_YCBCR:
|
||||
@ -705,7 +618,8 @@ GLBlitHelper::BlitImageToFramebuffer(layers::Image* const srcImage,
|
||||
return BlitImage(static_cast<layers::GPUVideoImage*>(srcImage), destSize,
|
||||
destOrigin);
|
||||
case ImageFormat::D3D11_YCBCR_IMAGE:
|
||||
return BlitImage((layers::D3D11YCbCrImage*)srcImage, destSize, destOrigin);
|
||||
return BlitImage((layers::D3D11YCbCrImage*)srcImage, destSize,
|
||||
destOrigin);
|
||||
case ImageFormat::D3D9_RGB32_TEXTURE:
|
||||
return false; // todo
|
||||
#endif
|
||||
@ -720,71 +634,14 @@ GLBlitHelper::BlitImageToFramebuffer(layers::Image* const srcImage,
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
bool
|
||||
GLBlitHelper::BlitImage(layers::SurfaceTextureImage* srcImage, const gfx::IntSize& destSize,
|
||||
const OriginPos destOrigin) const
|
||||
GLBlitHelper::BlitImage(layers::SurfaceTextureImage* srcImage, const gfx::IntSize&,
|
||||
const OriginPos) const
|
||||
{
|
||||
AndroidSurfaceTextureHandle handle = srcImage->GetHandle();
|
||||
const auto& surfaceTexture = java::GeckoSurfaceTexture::Lookup(handle);
|
||||
|
||||
if (!surfaceTexture) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0);
|
||||
|
||||
if (!surfaceTexture->IsAttachedToGLContext((int64_t)mGL)) {
|
||||
GLuint tex;
|
||||
mGL->MakeCurrent();
|
||||
mGL->fGenTextures(1, &tex);
|
||||
|
||||
if (NS_FAILED(surfaceTexture->AttachToGLContext((int64_t)mGL, tex))) {
|
||||
mGL->fDeleteTextures(1, &tex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const ScopedBindTexture savedTex(mGL, surfaceTexture->GetTexName(), LOCAL_GL_TEXTURE_EXTERNAL);
|
||||
surfaceTexture->UpdateTexImage();
|
||||
|
||||
gfx::Matrix4x4 transform4;
|
||||
AndroidSurfaceTexture::GetTransformMatrix(java::sdk::SurfaceTexture::Ref::From(surfaceTexture),
|
||||
&transform4);
|
||||
Mat3 transform3;
|
||||
transform3.at(0,0) = transform4._11;
|
||||
transform3.at(0,1) = transform4._12;
|
||||
transform3.at(0,2) = transform4._14;
|
||||
transform3.at(1,0) = transform4._21;
|
||||
transform3.at(1,1) = transform4._22;
|
||||
transform3.at(1,2) = transform4._24;
|
||||
transform3.at(2,0) = transform4._41;
|
||||
transform3.at(2,1) = transform4._42;
|
||||
transform3.at(2,2) = transform4._44;
|
||||
|
||||
// We don't do w-divison, so if these aren't what we expect, we're probably doing
|
||||
// something wrong.
|
||||
MOZ_ASSERT(transform3.at(0,2) == 0);
|
||||
MOZ_ASSERT(transform3.at(1,2) == 0);
|
||||
MOZ_ASSERT(transform3.at(2,2) == 1);
|
||||
|
||||
// FIXME
|
||||
const auto& srcOrigin = srcImage->GetOriginPos();
|
||||
|
||||
// I honestly have no idea why this logic is flipped, but changing the
|
||||
// source origin would mean we'd have to flip it in the compositor
|
||||
// which makes just as little sense as this.
|
||||
const bool yFlip = (srcOrigin == destOrigin);
|
||||
|
||||
const auto& prog = GetDrawBlitProg({kFragHeader_TexExt, kFragBody_RGBA});
|
||||
MOZ_RELEASE_ASSERT(prog);
|
||||
|
||||
// There is no padding on these images, so we can use the GetTransformMatrix directly.
|
||||
const DrawBlitProg::BaseArgs baseArgs = { transform3, yFlip, destSize, Nothing() };
|
||||
prog->Draw(baseArgs, nullptr);
|
||||
|
||||
if (surfaceTexture->IsSingleBuffer()) {
|
||||
surfaceTexture->ReleaseTexImage();
|
||||
}
|
||||
|
||||
return true;
|
||||
(void)srcOrigin;
|
||||
gfxCriticalError() << "BlitImage(SurfaceTextureImage) not implemented.";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -917,18 +774,14 @@ GLBlitHelper::BlitImage(layers::PlanarYCbCrImage* const yuvImage,
|
||||
|
||||
// --
|
||||
|
||||
const auto& clipRect = yuvData->GetPictureRect();
|
||||
const auto srcOrigin = OriginPos::BottomLeft;
|
||||
const bool yFlip = (destOrigin != srcOrigin);
|
||||
const auto& clipRect = yuvData->GetPictureRect();
|
||||
const auto& colorSpace = yuvData->mYUVColorSpace;
|
||||
|
||||
const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, yTexSize };
|
||||
const DrawBlitProg::YUVArgs yuvArgs = { uvTexSize, divisors, colorSpace };
|
||||
|
||||
const DrawBlitProg::BaseArgs baseArgs = {
|
||||
SubRectMat3(clipRect, yTexSize),
|
||||
yFlip, destSize, Nothing()
|
||||
};
|
||||
const DrawBlitProg::YUVArgs yuvArgs = {
|
||||
SubRectMat3(clipRect, uvTexSize, divisors),
|
||||
yuvData->mYUVColorSpace
|
||||
};
|
||||
prog->Draw(baseArgs, &yuvArgs);
|
||||
return true;
|
||||
}
|
||||
@ -949,14 +802,13 @@ GLBlitHelper::BlitImage(layers::MacIOSurfaceImage* const srcImage,
|
||||
const auto cglContext = glCGL->GetCGLContext();
|
||||
|
||||
const auto& srcOrigin = OriginPos::BottomLeft;
|
||||
const bool yFlip = destOrigin != srcOrigin;
|
||||
const gfx::IntRect clipRect({0, 0}, srcImage->GetSize());
|
||||
const gfx::IntSize texRectNormFactor(1, 1);
|
||||
|
||||
DrawBlitProg::BaseArgs baseArgs;
|
||||
baseArgs.yFlip = (destOrigin != srcOrigin);
|
||||
baseArgs.destSize = destSize;
|
||||
|
||||
DrawBlitProg::YUVArgs yuvArgs;
|
||||
yuvArgs.colorSpace = YUVColorSpace::BT601;
|
||||
|
||||
const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect,
|
||||
texRectNormFactor };
|
||||
DrawBlitProg::YUVArgs yuvArgs = { texRectNormFactor, {2,2}, YUVColorSpace::BT601 };
|
||||
const DrawBlitProg::YUVArgs* pYuvArgs = nullptr;
|
||||
|
||||
auto planes = iosurf->GetPlaneCount();
|
||||
@ -1066,11 +918,6 @@ GLBlitHelper::BlitImage(layers::MacIOSurfaceImage* const srcImage,
|
||||
gfxCriticalError() << errStr.get() << " (iosurf format: " << formatStr << ")";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p == 0) {
|
||||
baseArgs.texMatrix0 = SubRectMat3(0, 0, width, height);
|
||||
yuvArgs.texMatrix1 = SubRectMat3(0, 0, width / 2.0, height / 2.0);
|
||||
}
|
||||
}
|
||||
|
||||
const auto& prog = GetDrawBlitProg({fragHeader, fragBody});
|
||||
@ -1090,29 +937,31 @@ GLBlitHelper::DrawBlitTextureToFramebuffer(const GLuint srcTex,
|
||||
const gfx::IntSize& destSize,
|
||||
const GLenum srcTarget) const
|
||||
{
|
||||
const char* fragHeader;
|
||||
Mat3 texMatrix0;
|
||||
const gfx::IntRect clipRect(0, 0, srcSize.width, srcSize.height);
|
||||
|
||||
DrawBlitProg::Key key;
|
||||
gfx::IntSize texSizeDivisor;
|
||||
switch (srcTarget) {
|
||||
case LOCAL_GL_TEXTURE_2D:
|
||||
fragHeader = kFragHeader_Tex2D;
|
||||
texMatrix0 = Mat3::I();
|
||||
key = {kFragHeader_Tex2D, kFragBody_RGBA};
|
||||
texSizeDivisor = srcSize;
|
||||
break;
|
||||
case LOCAL_GL_TEXTURE_RECTANGLE_ARB:
|
||||
fragHeader = kFragHeader_Tex2DRect;
|
||||
texMatrix0 = SubRectMat3(0, 0, srcSize.width, srcSize.height);
|
||||
key = {kFragHeader_Tex2DRect, kFragBody_RGBA};
|
||||
texSizeDivisor = gfx::IntSize(1, 1);
|
||||
break;
|
||||
default:
|
||||
gfxCriticalError() << "Unexpected srcTarget: " << srcTarget;
|
||||
return;
|
||||
}
|
||||
const auto& prog = GetDrawBlitProg({ fragHeader, kFragBody_RGBA});
|
||||
const auto& prog = GetDrawBlitProg(key);
|
||||
MOZ_ASSERT(prog);
|
||||
|
||||
const ScopedSaveMultiTex saveTex(mGL, 1, srcTarget);
|
||||
mGL->fBindTexture(srcTarget, srcTex);
|
||||
|
||||
const bool yFlip = false;
|
||||
const DrawBlitProg::BaseArgs baseArgs = { texMatrix0, yFlip, destSize, Nothing() };
|
||||
const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, texSizeDivisor };
|
||||
prog->Draw(baseArgs);
|
||||
}
|
||||
|
||||
|
@ -41,40 +41,21 @@ bool
|
||||
GuessDivisors(const gfx::IntSize& ySize, const gfx::IntSize& uvSize,
|
||||
gfx::IntSize* const out_divisors);
|
||||
|
||||
template<uint8_t N>
|
||||
struct Mat
|
||||
{
|
||||
float m[N*N]; // column-major, for GL
|
||||
|
||||
float& at(const uint8_t x, const uint8_t y) {
|
||||
return m[N*x+y];
|
||||
}
|
||||
|
||||
static Mat<N> Zero();
|
||||
static Mat<N> I();
|
||||
|
||||
Mat<N> operator*(const Mat<N>& r) const;
|
||||
};
|
||||
typedef Mat<3> Mat3;
|
||||
|
||||
Mat3 SubRectMat3(float x, float y, float w, float h);
|
||||
Mat3 SubRectMat3(const gfx::IntRect& subrect, const gfx::IntSize& size);
|
||||
Mat3 SubRectMat3(const gfx::IntRect& bigSubrect, const gfx::IntSize& smallSize,
|
||||
const gfx::IntSize& divisors);
|
||||
|
||||
class DrawBlitProg final
|
||||
{
|
||||
const GLBlitHelper& mParent;
|
||||
const GLuint mProg;
|
||||
const GLint mLoc_uDestMatrix;
|
||||
const GLint mLoc_uTexMatrix0;
|
||||
const GLint mLoc_uTexMatrix1;
|
||||
const GLint mLoc_u1ForYFlip;
|
||||
const GLint mLoc_uSrcRect;
|
||||
const GLint mLoc_uTexSize0;
|
||||
const GLint mLoc_uTexSize1;
|
||||
const GLint mLoc_uDivisors;
|
||||
const GLint mLoc_uColorMatrix;
|
||||
|
||||
public:
|
||||
struct Key final {
|
||||
const char* const fragHeader;
|
||||
const char* const fragBody;
|
||||
const char* fragHeader;
|
||||
const char* fragBody;
|
||||
|
||||
bool operator <(const Key& x) const {
|
||||
if (fragHeader != x.fragHeader)
|
||||
@ -87,13 +68,14 @@ public:
|
||||
~DrawBlitProg();
|
||||
|
||||
struct BaseArgs final {
|
||||
Mat3 texMatrix0;
|
||||
gfx::IntSize destSize;
|
||||
bool yFlip;
|
||||
gfx::IntSize destSize; // Always needed for (at least) setting the viewport.
|
||||
Maybe<gfx::IntRect> destRect;
|
||||
gfx::IntRect srcRect;
|
||||
gfx::IntSize texSize0;
|
||||
};
|
||||
struct YUVArgs final {
|
||||
Mat3 texMatrix1;
|
||||
gfx::IntSize texSize1;
|
||||
gfx::IntSize divisors;
|
||||
YUVColorSpace colorSpace;
|
||||
};
|
||||
|
||||
@ -199,8 +181,8 @@ private:
|
||||
bool BlitAngleYCbCr(const WindowsHandle (&handleList)[3],
|
||||
const gfx::IntRect& clipRect,
|
||||
const gfx::IntSize& ySize, const gfx::IntSize& uvSize,
|
||||
const YUVColorSpace colorSpace, const gfx::IntSize& destSize,
|
||||
OriginPos destOrigin) const;
|
||||
const YUVColorSpace colorSpace,
|
||||
const gfx::IntSize& destSize, OriginPos destOrigin) const;
|
||||
|
||||
bool BlitAnglePlanes(uint8_t numPlanes, const RefPtr<ID3D11Texture2D>* texD3DList,
|
||||
const DrawBlitProg* prog, const DrawBlitProg::BaseArgs& baseArgs,
|
||||
|
@ -20,7 +20,8 @@ namespace mozilla {
|
||||
namespace gl {
|
||||
|
||||
static EGLStreamKHR
|
||||
StreamFromD3DTexture(ID3D11Texture2D* const texD3D, const EGLAttrib* const postAttribs)
|
||||
StreamFromD3DTexture(ID3D11Texture2D* const texD3D,
|
||||
const EGLAttrib* const postAttribs)
|
||||
{
|
||||
auto& egl = sEGLLibrary;
|
||||
if (!egl.IsExtensionSupported(GLLibraryEGL::NV_stream_consumer_gltexture_yuv) ||
|
||||
@ -243,8 +244,7 @@ GLBlitHelper::BlitImage(layers::D3D11YCbCrImage* const srcImage,
|
||||
|
||||
bool
|
||||
GLBlitHelper::BlitDescriptor(const layers::SurfaceDescriptorD3D10& desc,
|
||||
const gfx::IntSize& destSize,
|
||||
const OriginPos destOrigin) const
|
||||
const gfx::IntSize& destSize, OriginPos destOrigin) const
|
||||
{
|
||||
const auto& d3d = GetD3D11();
|
||||
if (!d3d)
|
||||
@ -295,14 +295,8 @@ GLBlitHelper::BlitDescriptor(const layers::SurfaceDescriptorD3D10& desc,
|
||||
ySize.height / divisors.height);
|
||||
|
||||
const bool yFlip = destOrigin != srcOrigin;
|
||||
const DrawBlitProg::BaseArgs baseArgs = {
|
||||
SubRectMat3(clipRect, ySize),
|
||||
yFlip, destSize, Nothing()
|
||||
};
|
||||
const DrawBlitProg::YUVArgs yuvArgs = {
|
||||
SubRectMat3(clipRect, uvSize, divisors),
|
||||
colorSpace
|
||||
};
|
||||
const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, ySize };
|
||||
const DrawBlitProg::YUVArgs yuvArgs = { uvSize, divisors, colorSpace };
|
||||
|
||||
const auto& prog = GetDrawBlitProg({kFragHeader_TexExt, kFragBody_NV12});
|
||||
MOZ_RELEASE_ASSERT(prog);
|
||||
@ -316,8 +310,8 @@ bool
|
||||
GLBlitHelper::BlitAngleYCbCr(const WindowsHandle (&handleList)[3],
|
||||
const gfx::IntRect& clipRect,
|
||||
const gfx::IntSize& ySize, const gfx::IntSize& uvSize,
|
||||
const YUVColorSpace colorSpace, const gfx::IntSize& destSize,
|
||||
const OriginPos destOrigin) const
|
||||
const YUVColorSpace colorSpace,
|
||||
const gfx::IntSize& destSize, OriginPos destOrigin) const
|
||||
{
|
||||
const auto& d3d = GetD3D11();
|
||||
if (!d3d)
|
||||
@ -337,14 +331,8 @@ GLBlitHelper::BlitAngleYCbCr(const WindowsHandle (&handleList)[3],
|
||||
const BindAnglePlanes bindPlanes(this, 3, texList);
|
||||
|
||||
const bool yFlip = destOrigin != srcOrigin;
|
||||
const DrawBlitProg::BaseArgs baseArgs = {
|
||||
SubRectMat3(clipRect, ySize),
|
||||
yFlip, destSize, Nothing()
|
||||
};
|
||||
const DrawBlitProg::YUVArgs yuvArgs = {
|
||||
SubRectMat3(clipRect, uvSize, divisors),
|
||||
colorSpace
|
||||
};
|
||||
const DrawBlitProg::BaseArgs baseArgs = { destSize, yFlip, clipRect, ySize };
|
||||
const DrawBlitProg::YUVArgs yuvArgs = { uvSize, divisors, colorSpace };
|
||||
|
||||
const auto& prog = GetDrawBlitProg({kFragHeader_TexExt, kFragBody_PlanarYUV});
|
||||
MOZ_RELEASE_ASSERT(prog);
|
||||
|
@ -395,7 +395,7 @@ SurfaceTextureSource::GetTextureTransform()
|
||||
gfx::Matrix4x4 ret;
|
||||
|
||||
const auto& surf = java::sdk::SurfaceTexture::LocalRef(java::sdk::SurfaceTexture::Ref::From(mSurfTex));
|
||||
AndroidSurfaceTexture::GetTransformMatrix(surf, &ret);
|
||||
AndroidSurfaceTexture::GetTransformMatrix(surf, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -486,14 +486,6 @@ SurfaceTextureHost::Lock()
|
||||
mSize);
|
||||
}
|
||||
|
||||
if (!mSurfTex->IsAttachedToGLContext((int64_t)gl)) {
|
||||
GLuint texName;
|
||||
gl->fGenTextures(1, &texName);
|
||||
if (NS_FAILED(mSurfTex->AttachToGLContext((int64_t)gl, texName))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,10 @@
|
||||
#include "nsDeque.h" // for nsDeque
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "GeneratedJNINatives.h"
|
||||
#endif
|
||||
|
||||
static const unsigned int TEXTURE_POOL_SIZE = 10;
|
||||
static const unsigned int TEXTURE_REFILL_THRESHOLD = TEXTURE_POOL_SIZE / 2;
|
||||
|
||||
@ -36,6 +40,19 @@ static PoolState sPoolState = PoolState::NOT_INITIALIZE;
|
||||
|
||||
static bool sHasPendingFillTask = false;
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
|
||||
class GeckoSurfaceTextureSupport final
|
||||
: public java::GeckoSurfaceTexture::Natives<GeckoSurfaceTextureSupport>
|
||||
{
|
||||
public:
|
||||
static int32_t NativeAcquireTexture() {
|
||||
return TexturePoolOGL::AcquireTexture();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MOZ_WIDGET_ANDROID
|
||||
|
||||
void TexturePoolOGL::MaybeFillTextures()
|
||||
{
|
||||
if (sTextures->GetSize() < TEXTURE_REFILL_THRESHOLD &&
|
||||
@ -153,6 +170,11 @@ void TexturePoolOGL::Init()
|
||||
sMonitor = new Monitor("TexturePoolOGL.sMonitor");
|
||||
sTextures = new nsDeque();
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
if (jni::IsAvailable()) {
|
||||
GeckoSurfaceTextureSupport::Init();
|
||||
}
|
||||
#endif
|
||||
sPoolState = PoolState::INITIALIZED;
|
||||
}
|
||||
|
||||
|
@ -21,30 +21,28 @@ public final class GeckoSurfaceTexture extends SurfaceTexture {
|
||||
|
||||
private int mHandle;
|
||||
private boolean mIsSingleBuffer;
|
||||
|
||||
private long mAttachedContext;
|
||||
private int mTexName;
|
||||
|
||||
private GeckoSurfaceTexture.Callbacks mListener;
|
||||
private AtomicInteger mUseCount;
|
||||
|
||||
private GeckoSurfaceTexture(int handle) {
|
||||
super(0);
|
||||
init(handle, false);
|
||||
@WrapForJNI(dispatchTo = "current")
|
||||
private static native int nativeAcquireTexture();
|
||||
|
||||
private GeckoSurfaceTexture(int handle, int texName) {
|
||||
super(texName);
|
||||
init(handle, texName, false);
|
||||
}
|
||||
|
||||
private GeckoSurfaceTexture(int handle, boolean singleBufferMode) {
|
||||
super(0, singleBufferMode);
|
||||
init(handle, singleBufferMode);
|
||||
private GeckoSurfaceTexture(int handle, int texName, boolean singleBufferMode) {
|
||||
super(texName, singleBufferMode);
|
||||
init(handle, texName, singleBufferMode);
|
||||
}
|
||||
|
||||
private void init(int handle, boolean singleBufferMode) {
|
||||
private void init(int handle, int texName, boolean singleBufferMode) {
|
||||
mHandle = handle;
|
||||
mIsSingleBuffer = singleBufferMode;
|
||||
mTexName = texName;
|
||||
mUseCount = new AtomicInteger(1);
|
||||
|
||||
// Start off detached
|
||||
detachFromGLContext();
|
||||
}
|
||||
|
||||
@WrapForJNI
|
||||
@ -57,31 +55,6 @@ public final class GeckoSurfaceTexture extends SurfaceTexture {
|
||||
return mTexName;
|
||||
}
|
||||
|
||||
@WrapForJNI(exceptionMode = "nsresult")
|
||||
public void attachToGLContext(long context, int texName) {
|
||||
if (context == mAttachedContext && texName == mTexName) {
|
||||
return;
|
||||
}
|
||||
|
||||
attachToGLContext(texName);
|
||||
|
||||
mAttachedContext = context;
|
||||
mTexName = texName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@WrapForJNI(exceptionMode = "nsresult")
|
||||
public void detachFromGLContext() {
|
||||
super.detachFromGLContext();
|
||||
|
||||
mAttachedContext = mTexName = 0;
|
||||
}
|
||||
|
||||
@WrapForJNI
|
||||
public boolean isAttachedToGLContext(long context) {
|
||||
return mAttachedContext == context;
|
||||
}
|
||||
|
||||
@WrapForJNI
|
||||
public boolean isSingleBuffer() {
|
||||
return mIsSingleBuffer;
|
||||
@ -157,12 +130,13 @@ public final class GeckoSurfaceTexture extends SurfaceTexture {
|
||||
}
|
||||
|
||||
int handle = sNextHandle++;
|
||||
int texName = nativeAcquireTexture();
|
||||
|
||||
final GeckoSurfaceTexture gst;
|
||||
if (isSingleBufferSupported()) {
|
||||
gst = new GeckoSurfaceTexture(handle, singleBufferMode);
|
||||
gst = new GeckoSurfaceTexture(handle, texName, singleBufferMode);
|
||||
} else {
|
||||
gst = new GeckoSurfaceTexture(handle);
|
||||
gst = new GeckoSurfaceTexture(handle, texName);
|
||||
}
|
||||
|
||||
synchronized (sSurfaceTextures) {
|
||||
|
@ -353,6 +353,21 @@ const JNINativeMethod SurfaceTextureListener::Natives<Impl>::methods[] = {
|
||||
::template Wrap<&Impl::OnFrameAvailable>)
|
||||
};
|
||||
|
||||
template<class Impl>
|
||||
class GeckoSurfaceTexture::Natives : public mozilla::jni::NativeImpl<GeckoSurfaceTexture, Impl>
|
||||
{
|
||||
public:
|
||||
static const JNINativeMethod methods[1];
|
||||
};
|
||||
|
||||
template<class Impl>
|
||||
const JNINativeMethod GeckoSurfaceTexture::Natives<Impl>::methods[] = {
|
||||
|
||||
mozilla::jni::MakeNativeMethod<GeckoSurfaceTexture::NativeAcquireTexture_t>(
|
||||
mozilla::jni::NativeStub<GeckoSurfaceTexture::NativeAcquireTexture_t, Impl>
|
||||
::template Wrap<&Impl::NativeAcquireTexture>)
|
||||
};
|
||||
|
||||
template<class Impl>
|
||||
class LayerView::Compositor::Natives : public mozilla::jni::NativeImpl<Compositor, Impl>
|
||||
{
|
||||
|
@ -1120,16 +1120,6 @@ auto GeckoSurface::SetAvailable(bool a0) const -> void
|
||||
const char GeckoSurfaceTexture::name[] =
|
||||
"org/mozilla/gecko/gfx/GeckoSurfaceTexture";
|
||||
|
||||
constexpr char GeckoSurfaceTexture::AttachToGLContext_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::AttachToGLContext_t::signature[];
|
||||
|
||||
auto GeckoSurfaceTexture::AttachToGLContext(int64_t a0, int32_t a1) const -> nsresult
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
mozilla::jni::Method<AttachToGLContext_t>::Call(GeckoSurfaceTexture::mCtx, &rv, a0, a1);
|
||||
return rv;
|
||||
}
|
||||
|
||||
constexpr char GeckoSurfaceTexture::DecrementUse_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::DecrementUse_t::signature[];
|
||||
|
||||
@ -1138,16 +1128,6 @@ auto GeckoSurfaceTexture::DecrementUse() const -> void
|
||||
return mozilla::jni::Method<DecrementUse_t>::Call(GeckoSurfaceTexture::mCtx, nullptr);
|
||||
}
|
||||
|
||||
constexpr char GeckoSurfaceTexture::DetachFromGLContext_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::DetachFromGLContext_t::signature[];
|
||||
|
||||
auto GeckoSurfaceTexture::DetachFromGLContext() const -> nsresult
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
mozilla::jni::Method<DetachFromGLContext_t>::Call(GeckoSurfaceTexture::mCtx, &rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
constexpr char GeckoSurfaceTexture::GetHandle_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::GetHandle_t::signature[];
|
||||
|
||||
@ -1172,14 +1152,6 @@ auto GeckoSurfaceTexture::IncrementUse() const -> void
|
||||
return mozilla::jni::Method<IncrementUse_t>::Call(GeckoSurfaceTexture::mCtx, nullptr);
|
||||
}
|
||||
|
||||
constexpr char GeckoSurfaceTexture::IsAttachedToGLContext_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::IsAttachedToGLContext_t::signature[];
|
||||
|
||||
auto GeckoSurfaceTexture::IsAttachedToGLContext(int64_t a0) const -> bool
|
||||
{
|
||||
return mozilla::jni::Method<IsAttachedToGLContext_t>::Call(GeckoSurfaceTexture::mCtx, nullptr, a0);
|
||||
}
|
||||
|
||||
constexpr char GeckoSurfaceTexture::IsSingleBuffer_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::IsSingleBuffer_t::signature[];
|
||||
|
||||
@ -1204,6 +1176,9 @@ auto GeckoSurfaceTexture::Lookup(int32_t a0) -> GeckoSurfaceTexture::LocalRef
|
||||
return mozilla::jni::Method<Lookup_t>::Call(GeckoSurfaceTexture::Context(), nullptr, a0);
|
||||
}
|
||||
|
||||
constexpr char GeckoSurfaceTexture::NativeAcquireTexture_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::NativeAcquireTexture_t::signature[];
|
||||
|
||||
constexpr char GeckoSurfaceTexture::ReleaseTexImage_t::name[];
|
||||
constexpr char GeckoSurfaceTexture::ReleaseTexImage_t::signature[];
|
||||
|
||||
|
@ -3460,27 +3460,6 @@ public:
|
||||
|
||||
explicit GeckoSurfaceTexture(const Context& ctx) : ObjectBase<GeckoSurfaceTexture>(ctx) {}
|
||||
|
||||
struct AttachToGLContext_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
int64_t,
|
||||
int32_t> Args;
|
||||
static constexpr char name[] = "attachToGLContext";
|
||||
static constexpr char signature[] =
|
||||
"(JI)V";
|
||||
static const bool isStatic = false;
|
||||
static const mozilla::jni::ExceptionMode exceptionMode =
|
||||
mozilla::jni::ExceptionMode::NSRESULT;
|
||||
static const mozilla::jni::CallingThread callingThread =
|
||||
mozilla::jni::CallingThread::ANY;
|
||||
static const mozilla::jni::DispatchTarget dispatchTarget =
|
||||
mozilla::jni::DispatchTarget::CURRENT;
|
||||
};
|
||||
|
||||
auto AttachToGLContext(int64_t, int32_t) const -> nsresult;
|
||||
|
||||
struct DecrementUse_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef void ReturnType;
|
||||
@ -3500,25 +3479,6 @@ public:
|
||||
|
||||
auto DecrementUse() const -> void;
|
||||
|
||||
struct DetachFromGLContext_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<> Args;
|
||||
static constexpr char name[] = "detachFromGLContext";
|
||||
static constexpr char signature[] =
|
||||
"()V";
|
||||
static const bool isStatic = false;
|
||||
static const mozilla::jni::ExceptionMode exceptionMode =
|
||||
mozilla::jni::ExceptionMode::NSRESULT;
|
||||
static const mozilla::jni::CallingThread callingThread =
|
||||
mozilla::jni::CallingThread::ANY;
|
||||
static const mozilla::jni::DispatchTarget dispatchTarget =
|
||||
mozilla::jni::DispatchTarget::CURRENT;
|
||||
};
|
||||
|
||||
auto DetachFromGLContext() const -> nsresult;
|
||||
|
||||
struct GetHandle_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef int32_t ReturnType;
|
||||
@ -3576,26 +3536,6 @@ public:
|
||||
|
||||
auto IncrementUse() const -> void;
|
||||
|
||||
struct IsAttachedToGLContext_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef bool ReturnType;
|
||||
typedef bool SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
int64_t> Args;
|
||||
static constexpr char name[] = "isAttachedToGLContext";
|
||||
static constexpr char signature[] =
|
||||
"(J)Z";
|
||||
static const bool isStatic = false;
|
||||
static const mozilla::jni::ExceptionMode exceptionMode =
|
||||
mozilla::jni::ExceptionMode::ABORT;
|
||||
static const mozilla::jni::CallingThread callingThread =
|
||||
mozilla::jni::CallingThread::ANY;
|
||||
static const mozilla::jni::DispatchTarget dispatchTarget =
|
||||
mozilla::jni::DispatchTarget::CURRENT;
|
||||
};
|
||||
|
||||
auto IsAttachedToGLContext(int64_t) const -> bool;
|
||||
|
||||
struct IsSingleBuffer_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef bool ReturnType;
|
||||
@ -3654,6 +3594,23 @@ public:
|
||||
|
||||
static auto Lookup(int32_t) -> GeckoSurfaceTexture::LocalRef;
|
||||
|
||||
struct NativeAcquireTexture_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef int32_t ReturnType;
|
||||
typedef int32_t SetterType;
|
||||
typedef mozilla::jni::Args<> Args;
|
||||
static constexpr char name[] = "nativeAcquireTexture";
|
||||
static constexpr char signature[] =
|
||||
"()I";
|
||||
static const bool isStatic = true;
|
||||
static const mozilla::jni::ExceptionMode exceptionMode =
|
||||
mozilla::jni::ExceptionMode::ABORT;
|
||||
static const mozilla::jni::CallingThread callingThread =
|
||||
mozilla::jni::CallingThread::ANY;
|
||||
static const mozilla::jni::DispatchTarget dispatchTarget =
|
||||
mozilla::jni::DispatchTarget::CURRENT;
|
||||
};
|
||||
|
||||
struct ReleaseTexImage_t {
|
||||
typedef GeckoSurfaceTexture Owner;
|
||||
typedef void ReturnType;
|
||||
@ -3695,6 +3652,7 @@ public:
|
||||
static const mozilla::jni::CallingThread callingThread =
|
||||
mozilla::jni::CallingThread::ANY;
|
||||
|
||||
template<class Impl> class Natives;
|
||||
};
|
||||
|
||||
class LayerView : public mozilla::jni::ObjectBase<LayerView>
|
||||
|
Loading…
Reference in New Issue
Block a user