Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index 700ed69d5641d8b9d1792482b1fdb65e0c6f9f54..552c90e8cc882323904e1a18e7018160e6b9bb3d 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -620,8 +620,11 @@ void Layer::SetShowSolidColorContent() { |
| RecomputeDrawsContentAndUVRect(); |
| } |
| -void Layer::UpdateNinePatchLayerBitmap(const SkBitmap& bitmap) { |
| +void Layer::UpdateNinePatchLayerImage(const gfx::ImageSkia& image) { |
| DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); |
| + nine_patch_layer_image_ = image; |
| + SkBitmap bitmap = nine_patch_layer_image_.GetRepresentation( |
| + device_scale_factor_).sk_bitmap(); |
| SkBitmap bitmap_copy; |
| if (bitmap.isImmutable()) { |
| bitmap_copy = bitmap; |
| @@ -635,7 +638,9 @@ void Layer::UpdateNinePatchLayerBitmap(const SkBitmap& bitmap) { |
| void Layer::UpdateNinePatchLayerAperture(const gfx::Rect& aperture) { |
| DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); |
| - nine_patch_layer_->SetAperture(aperture); |
| + nine_patch_layer_aperture_ = aperture; |
|
danakj
2015/03/17 17:59:40
can you add "in_dip" to this variable name?
hshi1
2015/03/17 18:24:48
Done.
|
| + gfx::Rect aperture_in_pixel = ConvertRectToPixel(this, aperture); |
| + nine_patch_layer_->SetAperture(aperture_in_pixel); |
| } |
| void Layer::UpdateNinePatchLayerBorder(const gfx::Rect& border) { |
| @@ -716,6 +721,10 @@ void Layer::OnDeviceScaleFactorChanged(float device_scale_factor) { |
| children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); |
| if (layer_mask_) |
| layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); |
| + if (nine_patch_layer_) { |
| + UpdateNinePatchLayerImage(nine_patch_layer_image_); |
|
danakj
2015/03/17 17:59:40
Can you move these up by RecomputeDrwasContentAndU
hshi1
2015/03/17 18:24:48
Done.
|
| + UpdateNinePatchLayerAperture(nine_patch_layer_aperture_); |
| + } |
| } |
| void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { |