aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/sk_app/android/surface_glue_android.cpp
Commit message (Collapse)AuthorAge
* Simplify some Viewer code, and fix a few bugsGravatar Brian Osman2017-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The content rect was always identical to the window rect, so most of the related code did nothing. The translation limit code is always useful (to avoid dragging the slide way off-screen with the mouse), so always include it. The auto-scaling to fit the screen is also still useful, but just base it on the window rect. The zoom code has four state variables, only used two of them, and one was a trivially derived computation. Fold most of that work into computeMatrix. (The translation was always zero -- we never changed the zoom center.) Include fDefaultMatrix in the matrix from computeMatrix, rather than needing to apply it specially to the canvas. Don't apply the inverse default matrix to touch or mouse points. The absolute positions of those touch points is not important, but because that matrix includes scale (and sometimes very large or very small scale), it just had the effect of greatly amplifying or damping the drag speed. Without it, the slide always pans at the speed of the touch/mouse drag -- which seems more desirable. The use of the inverse default matrix was a clever trick, but it caused the translation (applied to the global mtx) to be scaled, so the slide was always pinned incorrectly. Instead, supply the unmodified window rect and the default matrix, so the trans limit code can do the obvious correct thing: xform the slide bounds completely, then limit the translation that will be applied after that. Slides are now correctly pinned to screen edge regardless of how much zoom is present in the default matrix. Note: There are still several bugs related to all of this code, but given the web of xform state, it's hard to unravel. The touch gesture still doesn't know about viewer's zoom, so that's ignored when doing the pinning. Beyond that, it doesn't even know about window resize - it only configures the translation limit when setting up a slide. I had a fix for all of this (doing the translation limiting in computeMatrix), but then the touch gesture doesn't know about it, and can accumulate drag motion that needs to be un-dragged to get back on-screen, even though the slide is never really translated that far. SkTouchGesture is in include. No one uses it except viewer: TBR=bsalomon@google.com Bug: skia: Change-Id: I460cc07c3de6d36e63826f57d359faf1facf5ab3 Reviewed-on: https://skia-review.googlesource.com/18524 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add support for Atrace and hook into SkEventTracer framework.Gravatar Greg Daniel2016-10-14
| | | | | | | | | | | | | | | This change is a different version of: https://skia-review.googlesource.com/c/3269/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3345 Change-Id: I49d4f2987740d3ad1307f6aba3add0d63a46b22d Reviewed-on: https://skia-review.googlesource.com/3345 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Do not spam the debugging informationGravatar liyuqian2016-08-25
| | | | | | | | | | | Currently, whenever there's a frame being rendered, we log such an invalidation event. This is very spammy for animations or frame rates test. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2276303003 Review-Url: https://codereview.chromium.org/2276303003
* Fix touch event parameter orderGravatar liyuqian2016-08-22
| | | | | | | | | | | The issue is so obvious... However, all newer Android devices (e.g., Nexus 6P, 5X, 9) are immune to this bug. So I didn't notice this until I tested Viewer app on Nexus 7 yesterday... BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254223002 Review-Url: https://codereview.chromium.org/2254223002
* More accurate render time and continuous freshGravatar liyuqian2016-07-06
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2129613002 Review-Url: https://codereview.chromium.org/2129613002
* Support resize in Android Viewer AppGravatar liyuqian2016-06-09
| | | | | | | | | | | Previously, we took out resize because Vulkan didn't support it in Android. Now Android nyc-dev builds >= 2937079 and nyc-release builds >= NRD66 supports it so we add it back. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2050613003 Review-Url: https://codereview.chromium.org/2050613003
* Provide filter when there are many optionsGravatar liyuqian2016-06-08
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2047233003 Review-Url: https://codereview.chromium.org/2047233003
* Allow animation in Android viewerGravatar liyuqian2016-06-06
| | | | | | | | | To do that, we let ALooper_pollAll return immediately rather than wait indefinitely. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2031383002 Review-Url: https://codereview.chromium.org/2031383002
* Now we can use drawer to view the state information of the native app, and ↵Gravatar liyuqian2016-05-27
| | | | | | | | | | | set its state using the spinner. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004633002 Committed: https://skia.googlesource.com/skia/+/4e4e30823fba0047b93a56bfcf05c04ca57e82ec Review-Url: https://codereview.chromium.org/2004633002
* Revert of Add drawer with state information (patchset #8 id:140001 of ↵Gravatar kjlubick2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2004633002/ ) Reason for revert: Broke Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan. See https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan/builds/134/steps/compile_skia%20on%20Ubuntu/logs/stdio. Original issue's description: > Now we can use drawer to view the state information of the native app, and set its state using the spinner. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004633002 > > Committed: https://skia.googlesource.com/skia/+/4e4e30823fba0047b93a56bfcf05c04ca57e82ec TBR=djsollen@google.com,jvanverth@google.com,liyuqian@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2016343002
* Now we can use drawer to view the state information of the native app, and ↵Gravatar liyuqian2016-05-26
| | | | | | | | | set its state using the spinner. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004633002 Review-Url: https://codereview.chromium.org/2004633002
* Move inval dedup to Window for wider usages.Gravatar liyuqian2016-05-23
| | | | | | | | | | | It turns out that the inval dedup is not just useful for Android. Hence we move it up to the Window level so more OSes such as Linux, Windows can also use it. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2001153002 Review-Url: https://codereview.chromium.org/2001153002
* Save comparisons for release.Gravatar liyuqian2016-05-20
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1997003003 Review-Url: https://codereview.chromium.org/1997003003
* Use SkASSERTResult to avoid unused local variablesGravatar liyuqian2016-05-20
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2003653002 Review-Url: https://codereview.chromium.org/2003653002
* Implement touch controlGravatar liyuqian2016-05-17
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1982643004 Review-Url: https://codereview.chromium.org/1982643004
* Change Android activity title from JNI callGravatar liyuqian2016-05-13
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978843002 Review-Url: https://codereview.chromium.org/1978843002
* Use swipe gesture to switch between slides on AndroidGravatar liyuqian2016-05-12
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1965013007 Review-Url: https://codereview.chromium.org/1965013007
* Initial commit of our new Android app to demo Skia.Gravatar liyuqian2016-05-09
Currently, there's only a simple Activity with a title bar and a surface view that connects with Skia viewer native application. Before integrating user action events, I want to make sure that the design and implementation so far are good. Note that the old NativeApplication-based Activity (ViewerActivity) is still there for reference and test purposes. It will be removed eventually. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952323004 Review-Url: https://codereview.chromium.org/1952323004