Skip to content

Commit

Permalink
Bug 1507078 - Add mContinuousUpdate handling to RenderAndroidSurfaceT…
Browse files Browse the repository at this point in the history
…extureHostOGL r=nical

When mContinuousUpdate is true, UpdateTexImage() needs to be called for each rendering.

Differential Revision: https://phabricator.services.mozilla.com/D27232

--HG--
extra : moz-landing-system : lando
  • Loading branch information
sotaro committed Apr 12, 2019
1 parent 96ef73c commit 1df1c77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RenderAndroidSurfaceTextureHostOGL::RenderAndroidSurfaceTextureHostOGL(
gfx::SurfaceFormat aFormat, bool aContinuousUpdate)
: mSurfTex(aSurfTex),
mSize(aSize),
mContinuousUpdate(aContinuousUpdate),
mIsPrepared(false),
mAttachedToGLContext(false) {
MOZ_COUNT_CTOR_INHERITED(RenderAndroidSurfaceTextureHostOGL,
Expand Down Expand Up @@ -83,8 +84,12 @@ wr::WrExternalImage RenderAndroidSurfaceTextureHostOGL::Lock(
mSurfTex->GetTexName(), aRendering);
}

// Bug 1507078, Call UpdateTexImage() only when mContinuousUpdate is true
if (mSurfTex && !mSurfTex->IsSingleBuffer()) {
if (mContinuousUpdate) {
MOZ_ASSERT(!mSurfTex->IsSingleBuffer());
mSurfTex->UpdateTexImage();
} else if (!mSurfTex->IsSingleBuffer()) {
// Always calling UpdateTexImage() is not good.
// XXX Bug 1543846 will update this.
mSurfTex->UpdateTexImage();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class RenderAndroidSurfaceTextureHostOGL final : public RenderTextureHostOGL {

const mozilla::java::GeckoSurfaceTexture::GlobalRef mSurfTex;
const gfx::IntSize mSize;
// XXX const bool mContinuousUpdate;
const bool mContinuousUpdate;
// XXX const bool mIgnoreTransform;
bool mIsPrepared;
bool mAttachedToGLContext;
Expand Down

0 comments on commit 1df1c77

Please sign in to comment.