Commit f9d6298b authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Reduce excessive calls of OnTouchableBoundsChanged().

A bounds in pixel and a bounds in DIP are compared.
It causes InputMethodSurface call OnTouchableBoundsChanged() always.

Bug: 1042549
Change-Id: I1cd0fafd8e754aced022acd2f3f7aa61c6ce7fc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2043337
Auto-Submit: Yuichiro Hanada <yhanada@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740511}
parent d53a87e9
...@@ -70,10 +70,10 @@ void InputMethodSurface::OnSurfaceCommit() { ...@@ -70,10 +70,10 @@ void InputMethodSurface::OnSurfaceCommit() {
manager_->AddSurface(this); manager_->AddSurface(this);
} }
gfx::Rect new_bounds = root_surface()->hit_test_region().bounds(); const gfx::Rect new_bounds = gfx::ConvertRectToDIP(
default_device_scale_factor_, root_surface()->hit_test_region().bounds());
if (input_method_bounds_ != new_bounds) { if (input_method_bounds_ != new_bounds) {
input_method_bounds_ = input_method_bounds_ = new_bounds;
gfx::ConvertRectToDIP(default_device_scale_factor_, new_bounds);
manager_->OnTouchableBoundsChanged(this); manager_->OnTouchableBoundsChanged(this);
GetViewAccessibility().OverrideBounds(gfx::RectF(input_method_bounds_)); GetViewAccessibility().OverrideBounds(gfx::RectF(input_method_bounds_));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment