diff options
author | Jocelyn Turcotte <jturcotte@woboq.com> | 2015-09-07 17:35:39 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-05-10 16:41:30 +0200 |
commit | c8ed3204c773878c36472b9c7dfa28abc46ea215 (patch) | |
tree | e505278d1984f248a5565b73100b7f7e1e9e28a6 | |
parent | b7067508afca6d83b5d3c2851dfe6c526dde48ec (diff) | |
download | qtwebengine-chromium-c8ed3204c773878c36472b9c7dfa28abc46ea215.tar.gz |
<chromium> Don't trigger quad blending for opacity
Due to the way that the scene graph uses textures separately from
quad opacity to trigger blending, we have to call
DrawQuad::ShouldDrawWithBlending to know if our textures should
have an alpha channel or not.
This might trigger
Q_ASSERT(texture->hasAlphaChannel() || !quadNeedsBlending)
in ResourceHolder::initTexture is a Resource is initialized
without blending but is then reused during an opacity animation
where the quad would request blending but that
QSGTexture::hasAlphaChannel returns false.
Fix the assert by making sure that we set quadNeedsBlending
only when the quad's resource itself needs blending. The opacity
will trigger blending itself anyway through the parent QSGOpacityNode
that we set in buildLayerChain.
Change-Id: I8394f6b9711746d9f102f45752240072d7146867
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
-rw-r--r-- | chromium/cc/quads/draw_quad.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chromium/cc/quads/draw_quad.h b/chromium/cc/quads/draw_quad.h index 4b6ae59b363..8b7fc3d389a 100644 --- a/chromium/cc/quads/draw_quad.h +++ b/chromium/cc/quads/draw_quad.h @@ -80,7 +80,12 @@ class CC_EXPORT DrawQuad { bool IsDebugQuad() const { return material == DEBUG_BORDER; } bool ShouldDrawWithBlending() const { - if (needs_blending || shared_quad_state->opacity < 1.0f) + if (needs_blending +#if !defined(TOOLKIT_QT) +// Qt handles this case through QSGOpacityNodes + || shared_quad_state->opacity < 1.0f +#endif + ) return true; if (visible_rect.IsEmpty()) return false; |