Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2179)

Unified Diff: cc/texture_layer.cc

Issue 11570027: Adding support for per vertex opacity on textured layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/texture_layer.h ('k') | cc/texture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_layer.cc
diff --git a/cc/texture_layer.cc b/cc/texture_layer.cc
index 127062c32423495868a8ed478f50c27240af25fb..36c4220371d6f5653a7dedae16ed17b414504f96 100644
--- a/cc/texture_layer.cc
+++ b/cc/texture_layer.cc
@@ -28,6 +28,10 @@ TextureLayer::TextureLayer(TextureLayerClient* client)
, m_textureId(0)
, m_contentCommitted(false)
{
+ m_vertexOpacity[0] = 1.0f;
+ m_vertexOpacity[1] = 1.0f;
+ m_vertexOpacity[2] = 1.0f;
+ m_vertexOpacity[3] = 1.0f;
}
TextureLayer::~TextureLayer()
@@ -57,6 +61,21 @@ void TextureLayer::setUVRect(const gfx::RectF& rect)
setNeedsCommit();
}
+void TextureLayer::setVertexOpacity(float bottomLeft,
+ float topLeft,
+ float topRight,
+ float bottomRight) {
+ // Indexing according to the quad vertex generation:
+ // 1--2
+ // | |
+ // 0--3
+ m_vertexOpacity[0] = bottomLeft;
+ m_vertexOpacity[1] = topLeft;
+ m_vertexOpacity[2] = topRight;
+ m_vertexOpacity[3] = bottomRight;
+ setNeedsCommit();
+}
+
void TextureLayer::setPremultipliedAlpha(bool premultipliedAlpha)
{
m_premultipliedAlpha = premultipliedAlpha;
@@ -126,6 +145,7 @@ void TextureLayer::pushPropertiesTo(LayerImpl* layer)
TextureLayerImpl* textureLayer = static_cast<TextureLayerImpl*>(layer);
textureLayer->setFlipped(m_flipped);
textureLayer->setUVRect(m_uvRect);
+ textureLayer->setVertexOpacity(m_vertexOpacity);
textureLayer->setPremultipliedAlpha(m_premultipliedAlpha);
textureLayer->setTextureId(m_textureId);
m_contentCommitted = drawsContent();
« no previous file with comments | « cc/texture_layer.h ('k') | cc/texture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698