skia2/tools
Brian Osman 42bb6acf56 Simplify some Viewer code, and fix a few bugs
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>
2017-06-05 15:21:43 +00:00
..
copyright Script to automatically update copyright notices in C/C++ source code. 2011-07-28 14:29:58 +00:00
debugger Remove RenderTarget pointer from GrRenderTargetOpList::RecordedOp 2017-05-17 14:19:40 +00:00
fiddle [fiddle] Report GL driver info. 2017-06-01 18:03:45 +00:00
flags Add flag to avoid stencil buffers in Skia 2017-05-09 17:41:25 +00:00
gpu Enable chromecast gpu perf 2017-05-24 20:30:05 +00:00
lua Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
skdiff Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag"" 2017-04-28 15:49:04 +00:00
skiaserve deprecate odd variants of SkCanvas::readPixels 2017-04-17 15:22:42 +00:00
skp RecreateSKPs: Fix another .join() issue 2016-10-17 08:09:34 -07:00
skpbench deprecate odd variants of SkCanvas::readPixels 2017-04-17 15:22:42 +00:00
svg Fix Seal_of_Mississippi URL and update version of SVG asset. 2016-09-16 08:26:35 -07:00
timer SkTime::GetNSecs() 2015-10-23 07:02:06 -07:00
viewer Simplify some Viewer code, and fix a few bugs 2017-06-05 15:21:43 +00:00
__init__.py Add bench_pictures config 2012-12-12 20:13:26 +00:00
add_codereview_message.py Whitespace fixes for Python tools 2014-06-25 08:40:58 -07:00
AndroidSkDebugToStdOut.cpp Change how SkDebugf is sent to stdout on Android. 2014-12-10 10:23:06 -08:00
BigPathBench.inc Factor out VisualBench timing code into a helper class 2015-10-05 07:23:30 -07:00
build_command_buffer.py Improvements to build_command_buffer.py 2016-11-04 10:54:54 -07:00
BUILD_simulator.py Fix Google3 fonts. Use fontconfig rather than custom_directory_factory. Add Google3 font caching. 2015-12-01 11:12:05 -08:00
check-headers-self-sufficient header cleanup 2017-05-05 14:06:08 +00:00
chrome_fuzz.cpp Fix SkFILEStream. 2017-03-10 19:58:46 +00:00
colorspaceinfo.cpp colorspaceinfo tool: Add flag to indicate that the input is an icc profile 2017-05-02 13:22:20 +00:00
compare_codereview.py Further tweak compare_codereview.py. 2014-03-25 18:02:17 +00:00
CrashHandler.cpp SkLeanWindows.h: #include "Windows.h" fewer places 2016-06-07 17:21:10 -07:00
CrashHandler.h rewrite ambiguous comment 2015-02-10 07:47:31 -08:00
create_flutter_test_images.cpp Add tool to create test images with interesting color profiles 2017-05-17 18:15:20 +00:00
create_test_font.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
doxygen_footer.txt Fix update-doxygen, which fails when skia-autogen is reset 2012-09-26 16:09:43 +00:00
dump_record.cpp Revert "Revert "Reland: Remove SkLights include from SkCanvas.h"" 2017-05-03 19:17:11 +00:00
DumpRecord.cpp update deferred 2016-10-05 19:25:35 +00:00
DumpRecord.h Factor out DumpRecord method from dump_record tool for later use 2014-05-15 16:10:37 +00:00
embed_resources.py Add option to embed font data into executable. 2015-03-30 12:53:48 -07:00
find_run_binary.py Create a common utility for finding and running binaries in out/ 2014-02-07 18:41:49 +00:00
fix_pythonpath.py Use new common tools in Python scripts 2014-06-25 11:13:27 -04:00
gcov_shim add a way to get code coverage 2013-09-13 19:32:43 +00:00
generate_fir_coeff.py Fix metrics on Windows. 2013-07-27 20:37:56 +00:00
generate_vk_interface.sh Add vulkan files into skia repo. This is an incomplete backend with only partial functionality at this time. 2016-02-22 09:56:40 -05:00
get_current_monitor_profile.cpp Monitor profile tool, now with Windows support, too! 2016-07-12 15:06:25 -07:00
get_images_from_skps.cpp Support passing single SKP to get_images_from_skps 2017-06-05 14:51:33 +00:00
git-sync-deps tools/git-sync-deps: less verbose when fetch is needed 2017-02-13 19:53:27 +00:00
gpuveto.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
gyp GN 2016-06-23 10:29:30 -07:00
imgblur.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
imgslice.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
install_dependencies.sh Add some required packages to tools/install_dependencies.sh 2016-09-02 05:21:40 -07:00
ios_utils.h iOS: cd into Documents folder at startup 2017-02-06 15:06:45 +00:00
ios_utils.m iOS: cd into Documents folder at startup 2017-02-06 15:06:45 +00:00
iOSShell.cpp Make SkGraphics::Term a no-op, stop calling it. 2015-09-09 07:35:42 -07:00
iOSShell.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
jsondiff.py tools: Remove reference to svndiff. 2014-10-24 17:21:41 -02:00
LsanSuppressions.cpp Build LSAN suppressions into the test binaries. 2016-09-01 07:06:54 -07:00
merge_static_libs.py Build Skia as a static library 2012-10-10 19:45:51 +00:00
milestone.py SkPDF: milestone in metadata, also SkMilestone.h 2016-03-29 09:09:29 -07:00
mirror-dev.sh Land Ben's 32-bit symlink script. 2015-02-03 10:43:28 -05:00
misc_utils.py Whitespace fixes for Python tools 2014-06-25 08:40:58 -07:00
monobench.cpp Add sRGB support to monobench. 2017-05-15 20:24:26 +00:00
ok_dsts.cpp ok, add sRGB support 2017-05-03 01:40:35 +00:00
ok_srcs.cpp Revert "Revert "Reland: Remove SkLights include from SkCanvas.h"" 2017-05-03 19:17:11 +00:00
ok_test.cpp ok, most features can be vias 2017-03-31 03:03:18 +00:00
ok_vias.cpp ok, fix typo: struct -> static 2017-05-09 22:42:05 +00:00
ok.cpp Revert "Revert "Reland: Remove SkLights include from SkCanvas.h"" 2017-05-03 19:17:11 +00:00
ok.h ok, most features can be vias 2017-03-31 03:03:18 +00:00
OverwriteLine.h ios fixes 2014-07-11 12:14:51 -07:00
parse_llvm_coverage.py Walk through files in parse_llvm_coverage.py instead of using 'git ls-files' 2016-04-18 04:18:56 -07:00
pathops_sorter.htm add nonsquare scale to pathops sorter tool 2017-06-02 19:30:07 +00:00
pathops_visualizer.htm keep integral rectangle intersections integral 2017-04-18 16:40:48 +00:00
picture_utils.cpp Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag"" 2017-04-28 15:49:04 +00:00
picture_utils.h Move DM png code to picture_utils, for use by other tools. 2016-04-19 09:18:11 -07:00
pinspect.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
ProcStats.cpp Fix getMaxResidentSetSizeMB() on iOS. 2017-02-06 17:06:11 +00:00
ProcStats.h DM+nanobench: print both current and max RSS. 2015-04-30 07:11:22 -07:00
public_headers_warnings_check.cpp GN: add public headers warnings check. 2016-11-16 19:27:29 +00:00
random_parse_path.cpp Add unit test to feed valid SVG sequences to make sure that 2016-02-09 10:30:22 -08:00
random_parse_path.h Add unit test to feed valid SVG sequences to make sure that 2016-02-09 10:30:22 -08:00
reformat-json.py add reformat-json.py script 2013-07-19 15:45:22 +00:00
Registry.h move SkTRegister.h into tools 2017-01-11 19:53:36 +00:00
Resources.cpp Add new SkImageGenerator::getPixels() API, deprecate the old 2017-05-12 16:48:17 +00:00
Resources.h helper to convert CGImage -> SkImage 2016-12-21 17:38:18 +00:00
retrieve_from_googlesource.py Fix submit_try 2014-06-05 07:32:15 -07:00
sanitize_source_files.py Clean up more references to GYP. 2017-02-06 17:55:35 +00:00
sk_tool_utils_flags.h Add standard fonts to all GMs. 2014-07-31 08:58:44 -04:00
sk_tool_utils_font.cpp tools: s/SkAutoTUnref/sk_sp/ 2016-11-03 21:00:34 +00:00
sk_tool_utils.cpp make SkColorFilter::onAppendStages() pure 2017-06-01 14:55:10 +00:00
sk_tool_utils.h Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag"" 2017-04-28 15:49:04 +00:00
skhello.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
SkJSONCPP.h Move SkJSONCPP.h to tools. It tool-only. 2016-07-26 12:41:27 -07:00
skp_parser.cpp Revert[2] "Change SkCanvas to *not* inherit from SkRefCnt" 2016-11-13 18:31:13 +00:00
skpinfo.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
skpmaker.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
SkShaper_harfbuzz.cpp SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h 2017-01-11 18:55:34 +00:00
SkShaper_primitive.cpp SkPDF: SkShaper_primitive uses new textblob API 2016-09-10 07:01:53 -07:00
SkShaper.h SkShaper: optionally disable harfbuzz 2016-08-03 10:43:55 -07:00
Stats.h Consolidate SK_CRASH and sk_throw into SK_ABORT 2016-01-29 08:51:04 -08:00
test_all.py skimage, die die die 2014-12-15 12:47:52 -08:00
test_font_data_chars.cpp Add standard fonts to all GMs. 2014-07-31 08:58:44 -04:00
test_font_data.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
test_font_index.inc Rename textual includes as *.inc. 2016-07-27 11:12:12 -07:00
test_font_monospace.inc Rename textual includes as *.inc. 2016-07-27 11:12:12 -07:00
test_font_sans_serif.inc Rename textual includes as *.inc. 2016-07-27 11:12:12 -07:00
test_font_serif.inc Rename textual includes as *.inc. 2016-07-27 11:12:12 -07:00
test_gpuveto.py Remove dashing from gpu veto 2014-06-18 07:34:39 -07:00
test_pdfs.py Add an SKP to PDF rendered. test_pdfs.py will be hooked up in buildbot testing later. 2012-10-10 15:20:34 +00:00
ThermalManager.cpp Is it just me or is this logging just noise? 2016-09-16 11:50:13 -07:00
ThermalManager.h Move SkTArray to include/private. 2016-02-17 13:13:44 -08:00
UrlDataManager.cpp Create image cache for use by json canvas 2016-02-08 07:08:21 -08:00
UrlDataManager.h Use sse4.2 CRC32 instructions to hash when available. 2016-08-08 09:06:28 -07:00
using_skia_and_harfbuzz.cpp SkTextBlob: Begin implementing Extended TextBlob API 2016-08-30 11:58:33 -07:00
valgrind.supp Update Valgrind match-leak-kinds for keep-alive thread. 2017-02-21 14:01:19 +00:00
whitelist_typefaces.cpp Make iOS main() functions normal. 2017-02-06 18:02:41 +00:00
win_dbghelp.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
win_dbghelp.h Collect minidump and print callstack if an app chrashes. 2013-03-08 18:00:16 +00:00
win_lcid.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
xsan.blacklist GN: add sanitize arg 2016-09-08 08:39:34 -07:00