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

Unified Diff: cc/texture_layer_impl.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_impl.h ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_layer_impl.cc
diff --git a/cc/texture_layer_impl.cc b/cc/texture_layer_impl.cc
index 1e784418da91846ceb008accd04df90cff565fa0..433ce34256e7260b5bdf10b9c573d56420e729d2 100644
--- a/cc/texture_layer_impl.cc
+++ b/cc/texture_layer_impl.cc
@@ -19,6 +19,10 @@ TextureLayerImpl::TextureLayerImpl(LayerTreeImpl* treeImpl, int id)
, m_flipped(true)
, m_uvRect(0, 0, 1, 1)
{
+ m_vertexOpacity[0] = 1.0f;
+ m_vertexOpacity[1] = 1.0f;
+ m_vertexOpacity[2] = 1.0f;
+ m_vertexOpacity[3] = 1.0f;
}
TextureLayerImpl::~TextureLayerImpl()
@@ -44,7 +48,7 @@ void TextureLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQu
gfx::Rect quadRect(gfx::Point(), contentBounds());
gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect());
scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
- quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_externalTextureResource, m_premultipliedAlpha, m_uvRect, m_flipped);
+ quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_externalTextureResource, m_premultipliedAlpha, m_uvRect, m_vertexOpacity, m_flipped);
// Perform explicit clipping on a quad to avoid setting a scissor later.
if (sharedQuadState->is_clipped && quad->PerformClipping())
@@ -72,6 +76,13 @@ void TextureLayerImpl::dumpLayerProperties(std::string* str, int indent) const
LayerImpl::dumpLayerProperties(str, indent);
}
+void TextureLayerImpl::setVertexOpacity(const float vertexOpacity[4]) {
+ m_vertexOpacity[0] = vertexOpacity[0];
+ m_vertexOpacity[1] = vertexOpacity[1];
+ m_vertexOpacity[2] = vertexOpacity[2];
+ m_vertexOpacity[3] = vertexOpacity[3];
+}
+
void TextureLayerImpl::didLoseOutputSurface()
{
m_textureId = 0;
« no previous file with comments | « cc/texture_layer_impl.h ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698