Bug 952977: Convert GetTextureTransform to gfx::Matrix4x4 r=nical

This commit is contained in:
David Zbarsky 2014-01-24 17:49:02 -08:00
parent 307f35b892
commit 7cb634da66
6 changed files with 21 additions and 14 deletions

View File

@ -41,7 +41,7 @@ void ReleaseSharedHandle(GLContext* gl,
typedef struct {
GLenum mTarget;
gfx::SurfaceFormat mTextureFormat;
gfx3DMatrix mTextureTransform;
gfx::Matrix4x4 mTextureTransform;
} SharedHandleDetails;
/**

View File

@ -1215,7 +1215,8 @@ CompositorOGL::DrawQuadInternal(const Rect& aRect,
AutoBindTexture bindSource(mGLContext, source->AsSourceOGL(), LOCAL_GL_TEXTURE0);
GraphicsFilter filter = ThebesFilter(texturedEffect->mFilter);
gfx3DMatrix textureTransform = source->AsSourceOGL()->GetTextureTransform();
gfx3DMatrix textureTransform;
gfx::To3DMatrix(source->AsSourceOGL()->GetTextureTransform(), textureTransform);
#ifdef MOZ_WIDGET_ANDROID
gfxMatrix textureTransform2D;

View File

@ -378,13 +378,13 @@ SharedTextureSourceOGL::gl() const
return mCompositor ? mCompositor->gl() : nullptr;
}
gfx3DMatrix
gfx::Matrix4x4
SharedTextureSourceOGL::GetTextureTransform()
{
SharedHandleDetails handleDetails;
if (!GetSharedHandleDetails(gl(), mShareType, mSharedHandle, handleDetails)) {
NS_WARNING("Could not get shared handle details");
return gfx3DMatrix();
return gfx::Matrix4x4();
}
return handleDetails.mTextureTransform;
@ -883,7 +883,7 @@ SharedDeprecatedTextureHostOGL::Unlock()
}
gfx3DMatrix
gfx::Matrix4x4
SharedDeprecatedTextureHostOGL::GetTextureTransform()
{
SharedHandleDetails handleDetails;

View File

@ -12,12 +12,12 @@
#include "GLContextTypes.h" // for GLContext
#include "GLDefs.h" // for GLenum, LOCAL_GL_CLAMP_TO_EDGE, etc
#include "GLTextureImage.h" // for TextureImage
#include "gfx3DMatrix.h" // for gfx3DMatrix
#include "gfxTypes.h"
#include "mozilla/GfxMessageUtils.h" // for gfxContentType
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/RefPtr.h" // for RefPtr
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
#include "mozilla/gfx/Point.h" // for IntSize, IntPoint
#include "mozilla/gfx/Types.h" // for SurfaceFormat, etc
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags
@ -135,7 +135,7 @@ public:
virtual GLenum GetWrapMode() const = 0;
virtual gfx3DMatrix GetTextureTransform() { return gfx3DMatrix(); }
virtual gfx::Matrix4x4 GetTextureTransform() { return gfx::Matrix4x4(); }
virtual TextureImageDeprecatedTextureHostOGL* AsTextureImageDeprecatedTextureHost() { return nullptr; }
};
@ -258,7 +258,7 @@ public:
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
virtual gfx3DMatrix GetTextureTransform() MOZ_OVERRIDE;
virtual gfx::Matrix4x4 GetTextureTransform() MOZ_OVERRIDE;
virtual GLenum GetTextureTarget() const { return mTextureTarget; }
@ -744,7 +744,7 @@ public:
gfxContentType::COLOR;
}
virtual gfx3DMatrix GetTextureTransform() MOZ_OVERRIDE;
virtual gfx::Matrix4x4 GetTextureTransform() MOZ_OVERRIDE;
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;

View File

@ -13,6 +13,7 @@
#include "gfxImageSurface.h"
#include "AndroidBridge.h"
#include "nsThreadUtils.h"
#include "mozilla/gfx/Matrix.h"
using namespace mozilla;
@ -72,7 +73,7 @@ public:
env->CallObjectMethod(aSurfaceTexture, jSurfaceTexture_updateTexImage);
}
bool GetTransformMatrix(jobject aSurfaceTexture, gfx3DMatrix& aMatrix)
bool GetTransformMatrix(jobject aSurfaceTexture, gfx::Matrix4x4& aMatrix)
{
JNIEnv* env = GetJNIForThread();
@ -102,7 +103,7 @@ public:
aMatrix._42 = array[13];
aMatrix._43 = array[14];
aMatrix._44 = array[15];
env->ReleaseFloatArrayElements(jarray, array, 0);
return false;
@ -213,7 +214,7 @@ nsSurfaceTexture::UpdateTexImage()
}
bool
nsSurfaceTexture::GetTransformMatrix(gfx3DMatrix& aMatrix)
nsSurfaceTexture::GetTransformMatrix(gfx::Matrix4x4& aMatrix)
{
return sJNIFunctions.GetTransformMatrix(mSurfaceTexture, aMatrix);
}

View File

@ -11,11 +11,16 @@
#include <jni.h>
#include "nsIRunnable.h"
#include "gfxPlatform.h"
#include "gfx3DMatrix.h"
#include "GLDefs.h"
class gfxASurface;
namespace mozilla {
namespace gfx {
class Matrix4x4;
}
}
/**
* This class is a wrapper around Android's SurfaceTexture class.
* Usage is pretty much exactly like the Java class, so see
@ -41,7 +46,7 @@ public:
// This attaches the updated data to the TEXTURE_EXTERNAL target
void UpdateTexImage();
bool GetTransformMatrix(gfx3DMatrix& aMatrix);
bool GetTransformMatrix(mozilla::gfx::Matrix4x4& aMatrix);
int ID() { return mID; }
// The callback is guaranteed to be called on the main thread even