summaryrefslogtreecommitdiffstats
path: root/cc/texture_layer.cc
diff options
context:
space:
mode:
authorjscholler@chromium.org <jscholler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-15 20:17:18 +0000
committerjscholler@chromium.org <jscholler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-15 20:17:18 +0000
commit4c91aec43f77577557acd1cf5f9964239e7e54da (patch)
tree48580e9b10a3251a96c2628f7fbe44a7dbf56b02 /cc/texture_layer.cc
parentc5f8c9afdc05877f24bfdf050f49b4301b9ee6b3 (diff)
downloadchromium_src-4c91aec43f77577557acd1cf5f9964239e7e54da.zip
chromium_src-4c91aec43f77577557acd1cf5f9964239e7e54da.tar.gz
chromium_src-4c91aec43f77577557acd1cf5f9964239e7e54da.tar.bz2
Adding support for per vertex opacity on textured layer
BUG=165509 Review URL: https://chromiumcodereview.appspot.com/11570027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/texture_layer.cc')
-rw-r--r--cc/texture_layer.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/cc/texture_layer.cc b/cc/texture_layer.cc
index 127062c..36c4220 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();