Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index 71daa33f74c9af71352b6bd8f0ed44a8292b9412..96f5ec0a65961e34853d2ab6bc83fbc4ce376be0 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -751,10 +751,17 @@ void Layer::RecomputeDrawsContentAndUVRect() { |
| DCHECK(texture_); |
| gfx::Size texture_size; |
| - if (scale_content_) |
| + if (scale_content_) { |
| texture_size = texture_->size(); |
| - else |
| - texture_size = ConvertSizeToDIP(this, texture_->size()); |
| + } else { |
| + // Scale the texture's size but the layer's scale factor can be different |
| + // from the one of the texture in some cases. Thus estimate the scale |
| + // factor from the size of the texture and the layer. |
| + // TODO(mukai): add tests. |
| + float scale_factor = |
| + static_cast<float>(bounds().width()) / texture_->size().width(); |
|
piman
2012/09/19 23:08:48
This will entirely defeat the purpose of computing
Jun Mukai
2012/09/20 22:00:31
Thanks for comments. Then I introduced another fi
|
| + texture_size = texture_->size().Scale(scale_factor); |
| + } |
| gfx::Size size(std::min(bounds().width(), texture_size.width()), |
| std::min(bounds().height(), texture_size.height())); |