Bug 1284324 - Implement Canvas Layer mirrors r=bas

- When a canvas layer is set to mirror, it copies the
  texture from the canvas rather than changing the
  texture factory with Morph().
- This is useful when a canvas content will be sent to
  multiple devices simultaneously, such as a VR HMD
  and a 2d monitor mirror.
- This is used by the WebVR 1.0 API, in Bug 1250244

MozReview-Commit-ID: JfMSockO2uz
This commit is contained in:
kearwood
2016-07-04 13:11:07 -07:00
parent 5117963506
commit b5b6726ccc
12 changed files with 43 additions and 11 deletions

View File

@@ -411,6 +411,11 @@ CanvasClientSharedSurface::UpdateRenderer(gfx::IntSize aSize, Renderer& aRendere
gfxCriticalError() << "Invalid canvas front buffer";
return;
}
} else if (layer && layer->mIsMirror) {
mShSurfClient = CloneSurface(gl->Screen()->Front()->Surf(), layer->mFactory.get());
if (!mShSurfClient) {
return;
}
} else {
mShSurfClient = gl->Screen()->Front();
if (mShSurfClient && mShSurfClient->GetAllocator() &&