OSDN Git Service

[Magnifier - 8] SurfaceView support and invalidate revival
authorAndrei Stingaceanu <stg@google.com>
Thu, 2 Nov 2017 13:54:10 +0000 (13:54 +0000)
committerAndrei Stingaceanu <stg@google.com>
Mon, 20 Nov 2017 10:50:00 +0000 (10:50 +0000)
commit41589fa83dd06d2b2acf14107719b24fa42d8f29
treec2614063f1d590eb1f90869a09a6331e1de93f26
parent622597fbc5651cc2ddf68c94fefe79fffdde19ff
[Magnifier - 8] SurfaceView support and invalidate revival

It turns out that the auto-invalidate at a defined time,
practically polling, is not a safe way to update content
and also has more chances of producing poor quality so
temporary bring back update() and keep it hidden as the
plan is to have direct update listeners from the graphics
stack in the near future. This solution works well for
TextView, WebView and Chrome.

Added support for SurfaceView (used by Chrome).

Editor adds an onDrawListener to the TextView's tree observer
which posts to Magnifier update. This makes sure the
absolutely everytime anything changes in the view hierarchy
update() will be posted (after the actual drawing).

Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: If1b858d793c7cc338d23a850051022768a3f1e40
core/java/android/widget/Editor.java
core/java/com/android/internal/widget/Magnifier.java