Bug 1747520 - Ensure that OffscreenCanvas invalidation is in a consistent state. r=gfx-reviewers,kvark
This patch ensures that our invalidation is more consistent and less frequent. It no longer queues an invalidation for each draw call. It now combines the parameter update (e.g. width, height, opacity) with an invalidation to ensure the contents of the canvas are consistent with the advertised properties. It also ensures that if an explicit commit occurs, any pending commits are cancelled. Differential Revision: https://phabricator.services.mozilla.com/D134655
This commit is contained in:
@@ -472,10 +472,15 @@ void ClientWebGLContext::UpdateCanvasParameters() {
|
||||
|
||||
const auto& options = *mInitialOptions;
|
||||
const auto& size = DrawingBufferSize();
|
||||
mOffscreenCanvas->UpdateParameters(
|
||||
size.x, size.y, options.alpha,
|
||||
!options.alpha || options.premultipliedAlpha,
|
||||
/* aIsOriginBottomLeft */ true);
|
||||
|
||||
mozilla::dom::OffscreenCanvasDisplayData data;
|
||||
data.mOriginPos = gl::OriginPos::BottomLeft;
|
||||
data.mIsOpaque = !options.alpha;
|
||||
data.mIsAlphaPremult = !options.alpha || options.premultipliedAlpha;
|
||||
data.mSize = {size.x, size.y};
|
||||
data.mDoPaintCallbacks = false;
|
||||
|
||||
mOffscreenCanvas->UpdateDisplayData(data);
|
||||
}
|
||||
|
||||
layers::LayersBackend ClientWebGLContext::GetCompositorBackendType() const {
|
||||
|
||||
Reference in New Issue
Block a user