| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/wm/core/shadow.h" | 5 #include "ui/wm/core/shadow.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkBitmap.h" | 7 #include "third_party/skia/include/core/SkBitmap.h" |
| 8 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
| 9 #include "ui/compositor/layer.h" | 9 #include "ui/compositor/layer.h" |
| 10 #include "ui/compositor/scoped_layer_animation_settings.h" | 10 #include "ui/compositor/scoped_layer_animation_settings.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 int aperture_y = std::min(aperture, layer_bounds.height() / 2); | 188 int aperture_y = std::min(aperture, layer_bounds.height() / 2); |
| 189 gfx::Rect aperture_rect(aperture_x, aperture_y, | 189 gfx::Rect aperture_rect(aperture_x, aperture_y, |
| 190 image_size_.width() - aperture_x * 2, | 190 image_size_.width() - aperture_x * 2, |
| 191 image_size_.height() - aperture_y * 2); | 191 image_size_.height() - aperture_y * 2); |
| 192 | 192 |
| 193 shadow_layer_->UpdateNinePatchLayerAperture(aperture_rect); | 193 shadow_layer_->UpdateNinePatchLayerAperture(aperture_rect); |
| 194 shadow_layer_->UpdateNinePatchLayerBorder( | 194 shadow_layer_->UpdateNinePatchLayerBorder( |
| 195 gfx::Rect(aperture_x, aperture_y, aperture_x * 2, aperture_y * 2)); | 195 gfx::Rect(aperture_x, aperture_y, aperture_x * 2, aperture_y * 2)); |
| 196 | 196 |
| 197 // The content bounds in the shadow's layer space are offsetted by | 197 // The content bounds in the shadow's layer space are offsetted by |
| 198 // |interior_inset_|. The occlusion area also has to be shrinked to | 198 // |interior_inset_|. The occlusion area also has to be shrunk to allow |
| 199 // allow rounded corners overdrawing on top of the window's content. | 199 // rounded corners overdrawing on top of the window's content. |
| 200 gfx::Rect content_bounds( | 200 gfx::Rect content_bounds(interior_inset_ + kRoundedCornerRadius, |
| 201 content_bounds_.x() + interior_inset_ + kRoundedCornerRadius, | 201 interior_inset_ + kRoundedCornerRadius, |
| 202 content_bounds_.y() + interior_inset_ + kRoundedCornerRadius, | 202 content_bounds_.width() - 2 * kRoundedCornerRadius, |
| 203 content_bounds_.width() - 2 * kRoundedCornerRadius, | 203 content_bounds_.height() - 2 * kRoundedCornerRadius); |
| 204 content_bounds_.height() - 2 * kRoundedCornerRadius); | |
| 205 shadow_layer_->UpdateNinePatchOcclusion(content_bounds); | 204 shadow_layer_->UpdateNinePatchOcclusion(content_bounds); |
| 206 } | 205 } |
| 207 | 206 |
| 208 } // namespace wm | 207 } // namespace wm |
| OLD | NEW |