From c27a24f77960c3f5008ecf8d5c3564cabd7e5db3 Mon Sep 17 00:00:00 2001 From: wuggy Date: Fri, 18 Sep 2026 12:22:33 -0700 Subject: [PATCH] CWebRenger pt3 --- gfx/layers/opengl/CompositorOGL.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index c455eb7bba..931bd3f688 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -1002,6 +1002,34 @@ CompositorOGL::DrawQuad(const Rect& aRect, PROFILER_LABEL("CompositorOGL", "DrawQuad", js::ProfileEntry::Category::GRAPHICS); + // Give the C WebRender scene first refusal for the primitive types it can + // represent. Layer hosts use the same entry points directly, but this + // covers compositor callers that submit through the generic DrawQuad path. + if (gfxPrefs::WebRenderEnabled() && aEffectChain.mPrimaryEffect && + aTransform.Is2D() && + !aEffectChain.mSecondaryEffects[EffectTypes::MASK] && + !aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE] && + !aEffectChain.mSecondaryEffects[EffectTypes::COLOR_MATRIX]) { + if (aEffectChain.mPrimaryEffect->mType == EffectTypes::SOLID_COLOR) { + EffectSolidColor* effect = + static_cast(aEffectChain.mPrimaryEffect.get()); + if (DrawWebRenderRect(aRect, effect->mColor, aOpacity, aTransform, + aClipRect)) { + return; + } + } else if (aEffectChain.mPrimaryEffect->mType == EffectTypes::RGB || + aEffectChain.mPrimaryEffect->mType == EffectTypes::RENDER_TARGET) { + TexturedEffect* effect = + static_cast(aEffectChain.mPrimaryEffect.get()); + if (effect->mTexture && + DrawWebRenderImage(effect->mTexture, aRect, effect->mTextureCoords, + aOpacity, aTransform, aClipRect, + effect->mPremultiplied)) { + return; + } + } + } + DrawGeometry(aRect, aClipRect, aEffectChain, aOpacity, aTransform, aVisibleRect); }