Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index be6c577f5b727c00e98b7c388d770d328b762ffb..ffcce6d19d88551d36dd66396856206212901542 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -309,12 +309,20 @@ void Layer::SetColor(SkColor color) { |
| bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { |
| if (type_ == LAYER_SOLID_COLOR || !delegate_) |
| return false; |
| - gfx::Rect invalid_rect_in_pixel = ConvertRectToPixel(this, invalid_rect); |
| - damaged_region_.op(invalid_rect_in_pixel.x(), |
| - invalid_rect_in_pixel.y(), |
| - invalid_rect_in_pixel.right(), |
| - invalid_rect_in_pixel.bottom(), |
| - SkRegion::kUnion_Op); |
| + if (web_layer_is_accelerated_) { |
|
oshima
2012/05/09 21:11:58
DCHECK(texture_);
Please add comment + TODO
|
| + damaged_region_.op(invalid_rect.x(), |
| + invalid_rect.y(), |
| + invalid_rect.right(), |
| + invalid_rect.bottom(), |
| + SkRegion::kUnion_Op); |
| + } else { |
| + gfx::Rect invalid_rect_in_pixel = ConvertRectToPixel(this, invalid_rect); |
| + damaged_region_.op(invalid_rect_in_pixel.x(), |
| + invalid_rect_in_pixel.y(), |
| + invalid_rect_in_pixel.right(), |
| + invalid_rect_in_pixel.bottom(), |
| + SkRegion::kUnion_Op); |
| + } |
| ScheduleDraw(); |
| return true; |
| } |
| @@ -556,6 +564,10 @@ void Layer::RecomputeTransform() { |
| 0, 0, 1); |
| transform.ConcatTransform(transform_); |
| transform.ConcatTranslate(bounds_.x(), bounds_.y()); |
| + |
| + if (texture_) |
| + transform.ConcatScale(device_scale_factor_, device_scale_factor_); |
| + |
| transform.ConcatTransform(scale_translate); |
| web_layer_.setTransform(transform.matrix()); |
| } else { |