Bug 1332268 - Update EffectComponentAlpha texture coordinates when rendering split layers r=mattwoodrow

MozReview-Commit-ID: HFgikDMPB7F

--HG--
extra : rebase_source : 884ea1083f8def68e8c5c199929f2c0cc04a3148
This commit is contained in:
Miko Mynttinen 2017-01-19 21:16:30 +01:00
parent 007f4afe98
commit 690db7a2ca
5 changed files with 65 additions and 6 deletions

View File

@ -339,13 +339,10 @@ Compositor::DrawPolygon(const gfx::Polygon& aPolygon,
// Since the texture was created for non-split geometry, we need to
// update the texture coordinates to account for the split.
const EffectTypes type = aEffectChain.mPrimaryEffect->mType;
if (type == EffectTypes::RGB || type == EffectTypes::YCBCR ||
type == EffectTypes::NV12 || type == EffectTypes::RENDER_TARGET) {
TexturedEffect* texturedEffect =
static_cast<TexturedEffect*>(aEffectChain.mPrimaryEffect.get());
TexturedEffect* texturedEffect =
aEffectChain.mPrimaryEffect->AsTexturedEffect();
if (texturedEffect) {
UpdateTextureCoordinates(texturedTriangle, aRect, intersection,
texturedEffect->mTextureCoords);
}

View File

@ -38,6 +38,8 @@ namespace layers {
* to the compositor by the compositable host as a parameter to DrawQuad.
*/
struct TexturedEffect;
struct Effect
{
NS_INLINE_DECL_REFCOUNTING(Effect)
@ -46,6 +48,7 @@ struct Effect
EffectTypes mType;
virtual TexturedEffect* AsTexturedEffect() { return nullptr; }
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) = 0;
protected:
@ -66,6 +69,7 @@ struct TexturedEffect : public Effect
, mSamplingFilter(aSamplingFilter)
{}
virtual TexturedEffect* AsTexturedEffect() { return this; }
virtual const char* Name() = 0;
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>red box</title>
<style>
#wrapper {
}
#shape {
background-color: red;
width: 200px;
height: 200px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="shape">foo</div>
</div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>red box</title>
<style>
#wrapper {
perspective: 0px;
}
#shape {
background-color: red;
width: 200px;
height: 200px;
transform: rotateX(0deg);
}
</style>
</head>
<body>
<div id="wrapper">
<div id="shape">foo</div>
</div>
</body>
</html>

View File

@ -84,3 +84,4 @@ fuzzy(1,10000) == opacity-preserve3d-4.html opacity-preserve3d-4-ref.html
fails-if(winWidget&&layersGPUAccelerated) == split-intersect1.html split-intersect1-ref.html # Bug 1323791: implement DirectX compositor polygon support
fuzzy(255,150) fails-if(winWidget&&layersGPUAccelerated) == split-intersect2.html split-intersect2-ref.html # Bug 1323791
fuzzy(255,100) fails-if(winWidget&&layersGPUAccelerated) == split-non-ortho1.html split-non-ortho1-ref.html # Bug 1323791
fuzzy-if(winWidget,150,120) == component-alpha-1.html component-alpha-1-ref.html