diff options
author | bungeman <bungeman@google.com> | 2016-03-03 13:32:38 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-03 13:32:38 -0800 |
commit | ce56026db55d8585c2f920a6107a25b40fd5160a (patch) | |
tree | f5bda60bf1087f261054ae7d29843ca26f2b85cc /src/views/unix | |
parent | d812fb458807245daa812adb7af0733cf5b54d96 (diff) |
Force tiles in SampleApp to integer boundaries.
The current behavior is to create tiles from the rounded ideal tile size,
tell the tile that it's upper left pixel is at the ideal location, and
then draw those tiles at the ideal locations. As a result, the tiles are
be out of phase with each other internally and then actually drawn at
the rounded pixel location instead of the ideal location.
The new behavior is to always round up to get the tile size, make the
tile translation an integer offset, and then draw at the exact pixel.
This also modifies SampleApp to use the numeric keypad to provide an
extra manual 1/32 pixel translation for fine grained movement.
BUG=skia:5020
Review URL: https://codereview.chromium.org/1763833002
Diffstat (limited to 'src/views/unix')
-rw-r--r-- | src/views/unix/XkeysToSkKeys.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/views/unix/XkeysToSkKeys.h b/src/views/unix/XkeysToSkKeys.h index 30eb97d396..9cc9885db8 100644 --- a/src/views/unix/XkeysToSkKeys.h +++ b/src/views/unix/XkeysToSkKeys.h @@ -31,6 +31,35 @@ SkKey XKeyToSkKey(KeySym keysym) { return kDown_SkKey; case XK_Up: return kUp_SkKey; + case XK_KP_0: + case XK_KP_Insert: + return k0_SkKey; + case XK_KP_1: + case XK_KP_End: + return k1_SkKey; + case XK_KP_2: + case XK_KP_Down: + return k2_SkKey; + case XK_KP_3: + case XK_KP_Page_Down: + return k3_SkKey; + case XK_KP_4: + case XK_KP_Left: + return k4_SkKey; + case XK_KP_5: + return k5_SkKey; + case XK_KP_6: + case XK_KP_Right: + return k6_SkKey; + case XK_KP_7: + case XK_KP_Home: + return k7_SkKey; + case XK_KP_8: + case XK_KP_Up: + return k8_SkKey; + case XK_KP_9: + case XK_KP_Page_Up: + return k9_SkKey; default: return kNONE_SkKey; } |