Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: ui/android/view_android.cc

Issue 2842693005: Store physical backing size in ViewAndroid (Closed)
Patch Set: no client Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« android_webview/native/aw_contents.h ('K') | « ui/android/view_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« android_webview/native/aw_contents.h ('K') | « ui/android/view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698