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

Unified Diff: ui/compositor/layer.cc

Issue 11783094: cc: Add point-based UV coordinate on TextureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unittest for clipped texture quad 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
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 7c43b7b84d030900fdf7bd7c869de1b18e4cad4c..15dc5c6b83386f2f4a7c2edad6818527234d1887 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -791,12 +791,11 @@ void Layer::RecomputeDrawsContentAndUVRect() {
gfx::Size size(std::min(bounds().width(), texture_size.width()),
std::min(bounds().height(), texture_size.height()));
- gfx::RectF rect(
- 0,
- 0,
+ gfx::PointF uv_top_left(0, 0);
danakj 2013/01/15 01:48:42 nit: 0.f
Jerome 2013/01/15 17:58:12 Done.
+ gfx::PointF uv_bottom_right(
static_cast<float>(size.width())/texture_size.width(),
static_cast<float>(size.height())/texture_size.height());
- texture_layer_->setUVRect(rect);
+ texture_layer_->setUV(uv_top_left, uv_bottom_right);
cc_layer_->setBounds(ConvertSizeToPixel(this, size));
}

Powered by Google App Engine
This is Rietveld 408576698