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

Unified Diff: cc/texture_layer.cc

Issue 11783094: cc: Add point-based UV coordinate on TextureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 months 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 6a981a087b824230addd7c7f25c60af14ee44eaf..629a7040f1841377604331c1ac88d4f6d224a024 100644
--- a/cc/texture_layer.cc
+++ b/cc/texture_layer.cc
@@ -37,7 +37,8 @@ TextureLayer::TextureLayer(TextureLayerClient* client, bool usesMailbox)
, m_client(client)
, m_usesMailbox(usesMailbox)
, m_flipped(true)
- , m_uvRect(0, 0, 1, 1)
+ , m_uvTopLeft(0.f, 0.f)
+ , m_uvBottomRight(1.f, 1.f)
, m_premultipliedAlpha(true)
, m_rateLimitContext(false)
, m_contextLost(false)
@@ -73,9 +74,10 @@ void TextureLayer::setFlipped(bool flipped)
setNeedsCommit();
}
-void TextureLayer::setUVRect(const gfx::RectF& rect)
+void TextureLayer::setUV(gfx::PointF topLeft, gfx::PointF bottomRight)
{
- m_uvRect = rect;
+ m_uvTopLeft = topLeft;
+ m_uvBottomRight = bottomRight;
setNeedsCommit();
}
@@ -178,7 +180,8 @@ void TextureLayer::pushPropertiesTo(LayerImpl* layer)
TextureLayerImpl* textureLayer = static_cast<TextureLayerImpl*>(layer);
textureLayer->setFlipped(m_flipped);
- textureLayer->setUVRect(m_uvRect);
+ textureLayer->setUVTopLeft(m_uvTopLeft);
+ textureLayer->setUVBottomRight(m_uvBottomRight);
textureLayer->setVertexOpacity(m_vertexOpacity);
textureLayer->setPremultipliedAlpha(m_premultipliedAlpha);
if (m_usesMailbox) {
« 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