Index: ui/android/view_android.cc |
diff --git a/ui/android/view_android.cc b/ui/android/view_android.cc |
index 15e51a0042ca48b6eb5c29d0bbbc6cafdb9541a3..9b5a2bf3de3ea8ec754af1210c85da9d4e16ddf6 100644 |
--- a/ui/android/view_android.cc |
+++ b/ui/android/view_android.cc |
@@ -123,6 +123,7 @@ void ViewAndroid::AddChild(ViewAndroid* child) { |
if (child->parent_) |
child->RemoveFromParent(); |
child->parent_ = this; |
+ child->OnPhysicalBackingSizeChanged(physical_size_); |
} |
// static |
@@ -227,6 +228,12 @@ cc::Layer* ViewAndroid::GetLayer() const { |
void ViewAndroid::SetLayer(scoped_refptr<cc::Layer> layer) { |
layer_ = layer; |
+ UpdateLayerBounds(); |
+} |
+ |
+void ViewAndroid::UpdateLayerBounds() { |
Khushal
2017/05/04 00:01:22
I think the caller should update the size *if* the
Jinsuk Kim
2017/05/08 07:40:44
Sorry I don't get the suggestion made here. Would
Khushal
2017/05/08 17:55:37
Sorry, my point was that VA shouldn't need to do t
Jinsuk Kim
2017/05/10 06:05:27
Removed |UpdateLayerBounds()|
|
+ if (layer_) |
+ layer_->SetBounds(physical_size_); |
} |
void ViewAndroid::SetLayout(ViewAndroid::LayoutParams params) { |
@@ -279,6 +286,20 @@ int ViewAndroid::GetSystemWindowInsetBottom() { |
return Java_ViewAndroidDelegate_getSystemWindowInsetBottom(env, delegate); |
} |
+void ViewAndroid::OnPhysicalBackingSizeChanged(const gfx::Size& size) { |
Khushal
2017/05/04 00:01:22
Something still needs to poke RWHVA to send the up
Jinsuk Kim
2017/05/08 07:40:44
It was present in the earlier patches but removed
|
+ if (physical_size_ == size) |
+ return; |
+ physical_size_ = size; |
+ UpdateLayerBounds(); |
+ |
+ for (auto* child : children_) |
+ child->OnPhysicalBackingSizeChanged(size); |
+} |
+ |
+gfx::Size ViewAndroid::GetPhysicalBackingSize() { |
+ return physical_size_; |
+} |
+ |
bool ViewAndroid::OnTouchEvent(const MotionEventAndroid& event, |
bool for_touch_handle) { |
return HitTest( |