aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/Viewer.cpp
Commit message (Collapse)AuthorAge
* Fix startup for SampleSlideGravatar Jim Van Verth2018-01-22
| | | | | | | | | | | | When we start up Viewer with a SampleSlide as the first slide, nothing gets rendered because SampleSlide depends on the backend being initialized before setting its dimensions. This pushes the first slide's initialization after the backend creation. Change-Id: I8f83fe7b3973c40234104f1a83c0a60750694311 Reviewed-on: https://skia-review.googlesource.com/98161 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Add Chinese zoom Sample.Gravatar Jim Van Verth2018-01-22
| | | | | | | | | | Bug: skia: Change-Id: Ibe5ffee64fe9fccd6b8d86c1310a78d2d51e424e Reviewed-on: https://skia-review.googlesource.com/97065 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Fix Viewer slide load on backend change - take 2Gravatar Florin Malita2018-01-17
| | | | | | | | | | | Split the slide switching logic (including load/unload) into setCurrentSlide(), while keeping setupCurrentSlide() to deal with config only. Change-Id: I5bd2363ffd401c1b756217f845d4dbd16d6be5d6 Reviewed-on: https://skia-review.googlesource.com/94864 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Skotty -> SkottieGravatar Florin Malita2018-01-17
| | | | | | | Change-Id: If8b6516024c69b0fc256208874f6666a4e70e12c Reviewed-on: https://skia-review.googlesource.com/95241 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert "Fix Viewer slide load on backend change"Gravatar Florin Malita2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5fb009df3c87167762b33483ee82b5fe632837a9. Reason for revert: Broke first slide. Original change's description: > Fix Viewer slide load on backend change > > Currently Viewer fires unbalanced load events on backend change. > > Instead of calling setupCurrentSlide() with an invalid prevSlide and > always forcing a slide load, pass a |force| argument on backend change. > > Change-Id: I146b42331f5aa9721d4f407b81c13f4512d67d61 > Reviewed-on: https://skia-review.googlesource.com/94960 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Florin Malita <fmalita@chromium.org> TBR=brianosman@google.com,fmalita@chromium.org Change-Id: I52bbc9fb44f6ed4e04bcc549b2ec72c8600c823a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/94861 Reviewed-by: Florin Malita <fmalita@google.com> Commit-Queue: Florin Malita <fmalita@google.com>
* Fix Viewer slide load on backend changeGravatar Florin Malita2018-01-16
| | | | | | | | | | | | Currently Viewer fires unbalanced load events on backend change. Instead of calling setupCurrentSlide() with an invalid prevSlide and always forcing a slide load, pass a |force| argument on backend change. Change-Id: I146b42331f5aa9721d4f407b81c13f4512d67d61 Reviewed-on: https://skia-review.googlesource.com/94960 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* add skotty-dir slideGravatar Mike Reed2018-01-08
| | | | | | | | | | Shows a directory of skotties in a grid Bug: skia: Change-Id: I96b0700d8809c94a394cf517222123967afb20dc Reviewed-on: https://skia-review.googlesource.com/91407 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* [Viewer] Preserve gesture transformation matrix on slide/backend changeGravatar Brian Salomon2018-01-05
| | | | | | | Change-Id: I417fb9b6d6b7c95884dff6871731883fe3736437 Reviewed-on: https://skia-review.googlesource.com/91460 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Initial Lottie loader impl (Skotty)Gravatar Florin Malita2017-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coarse workflow: * Construction 1) build a Json tree 2) collect asset IDs (for preComp/image layer resolution) 3) "attach" pass - traverse the Json tree - build an SkSG dom, one fragment at a time - attach "animator" objects to the dom, for each animated prop 4) done, we can throw away the Json tree * For each animation tick 1) iterate over active animators and poke their respective dom nodes/attributes 2) revalidate the SkSG dom 3) draw the SkSG dom Note: post construction, things are super-simple - we just poke SkSG DOM attributes with interpolated values, and everything else is handled by SkSG (invalidation, revalidation, render). Change-Id: I96a02be7eb4fb4cb3831f59bf2b3908ea190c0dd Reviewed-on: https://skia-review.googlesource.com/89420 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Avoid redrawing every time the mouse movesGravatar Brian Osman2017-12-20
| | | | | | | | Bug: skia: Change-Id: Idc74e6c7e50f8d416d716ee666b37b52792c7c4b Reviewed-on: https://skia-review.googlesource.com/87789 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Move stats code to new layer (with configurable list of timers)Gravatar Brian Osman2017-12-20
| | | | | | | | Bug: skia: Change-Id: I3ca5c8c7047309983018339ec7b71b9aea5ee786 Reviewed-on: https://skia-review.googlesource.com/86921 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add a tools flag to suppress geometry shadersGravatar Chris Dalton2017-12-19
| | | | | | | | | Bug: skia: Change-Id: I38736c5d49e3b281c2d23af3908575274ff97b5c Reviewed-on: https://skia-review.googlesource.com/86282 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Remove unnecessary includes from ViewerGravatar Brian Osman2017-12-15
| | | | | | | | Bug: skia: Change-Id: I7b20db66a7eb5b549997fd4307e41937a8753921 Reviewed-on: https://skia-review.googlesource.com/86020 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Move ImGui support code to ImGuiLayerGravatar Brian Osman2017-12-11
| | | | | | | | | | | | | Viewer still has plenty of code that uses ImGui to create application specific UI, but the structural code that forwards input to ImGui, and converts per-frame ImGui rendering data to Skia draw commands is now in a single component that can be reused in any sk_app-based application. Bug: skia: Change-Id: Ic14ece659d4af8ee13b69c638bdaf7df6c24f5c0 Reviewed-on: https://skia-review.googlesource.com/82627 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* Create a Window::Layer interface to reduce sk_app glue codeGravatar Brian Osman2017-12-11
| | | | | | | | | | | | This also makes it possible to manage other parts of viewer, etc (like the stats screen, command set, even samples) as additional layers in the stack. For now, it just removes a lot of boilerplate. Bug: skia: Change-Id: Ic2f80690fc76c683b3736287dc2b738c50d38614 Reviewed-on: https://skia-review.googlesource.com/82688 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* resources: orgainize directory.Gravatar Hal Canary2017-12-08
| | | | | | | | | Should make it easier to ask just for images. Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd Reviewed-on: https://skia-review.googlesource.com/82684 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Remove instanced renderingGravatar Brian Salomon2017-12-08
| | | | | | | Change-Id: I4219b1d23a647b849ee41fe71b53e1c45edfc3f4 Reviewed-on: https://skia-review.googlesource.com/82241 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add 'Save to SKP' option to ViewerGravatar Brian Osman2017-12-01
| | | | | | | | Bug: skia: Change-Id: Iea3794ce8710c84f2529b78b21655f2bf6aaa90e Reviewed-on: https://skia-review.googlesource.com/79160 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add threaded backend to viewerGravatar Yuqian Li2017-11-22
| | | | | | | | Bug: skia: Change-Id: Ibf672921f8a05705e7262aad0b1f3f1e6fc0ef9c Reviewed-on: https://skia-review.googlesource.com/75382 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add XY to zoom windowGravatar Brian Osman2017-11-21
| | | | | | | | Bug: skia:7332 Change-Id: I3a7d5cf20c75bb288d5aa0fa9046e77a669aad64 Reviewed-on: https://skia-review.googlesource.com/74560 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove SampleApp and convert HelloWorld to sk_appGravatar Brian Osman2017-11-21
| | | | | | | | | | | | | There is still a large amount of views code that could be trimmed down, but which is used to implement samples (in viewer). Seemed simpler to remove some of this code in pieces. Bug: skia: Change-Id: Ia3415060d03c8de604a154e3dc38379b754daab6 Reviewed-on: https://skia-review.googlesource.com/72801 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Viewer: backspace jumps directly to the slide pickerGravatar Brian Osman2017-11-14
| | | | | | | | Bug: skia: Change-Id: I8107358e49ef20bf26ddf6a6dbb21efc07f167e7 Reviewed-on: https://skia-review.googlesource.com/71460 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Improve zoom window in ViewerGravatar Brian Osman2017-11-13
| | | | | | | | | | | | | | Made a more general mechanism for getting a canvas callback during GUI rendering, clipped to a region. Use that to implement the zoom window. The new version has better zoom control (I think), avoids bugs with clamped image drawing stretching off-canvas, adds a highlight of the pixel under the cursor, and also prints the RGBA values of that pixel. Bug: skia: Change-Id: I2c4da581648e7923c2a6fb28846dfdb52bdd3029 Reviewed-on: https://skia-review.googlesource.com/70723 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Move ms meter from the title bar to the displayGravatar Jim Van Verth2017-11-09
| | | | | | | Change-Id: I95dbb681a930f06103ecf1d8b213bb9c0915d2d6 Reviewed-on: https://skia-review.googlesource.com/69660 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Allow changing the transfer function in xform canvas modeGravatar Brian Osman2017-11-09
| | | | | | | | | | | Used this to test out some theories for different color correction approaches. Bug: skia: Change-Id: I072130733eaea736c9aa129af74887b028f035b4 Reviewed-on: https://skia-review.googlesource.com/69221 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Use ListBox for slide picker in ViewerGravatar Brian Osman2017-11-08
| | | | | | | | | | | | Interaction is much nicer (the bulleted list of text had dead space between entries, so mouse clicks could go unnoticed). This version also keeps the currently active slide highlighted in the list, which is nice. Bug: skia: Change-Id: I609d90f3b1ff99765f0a7f1ca43e02a0a534dc4d Reviewed-on: https://skia-review.googlesource.com/68780 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* In Viewer, use a GL window for Raster modeGravatar Brian Osman2017-11-08
| | | | | | | | | | | | | | The GUI uses drawVertices, in a way that doesn't currently work with the raster backend. Even if it worked, drawVertices is fairly slow in raster mode, but extremely fast on GPU. This makes the GUI always usable. The tradeoff is profiling raster will be less accurate. Bug: skia: Change-Id: I69df777fc5be79f5bdd8d4505f6419bfa758c97e Reviewed-on: https://skia-review.googlesource.com/68541 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add ms display to Viewer.Gravatar Jim Van Verth2017-11-03
| | | | | | | Change-Id: I6303209d3ff597611ac1a5f558294c6d6fcba670 Reviewed-on: https://skia-review.googlesource.com/67766 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Add sample mouse support to ViewerGravatar Jim Van Verth2017-11-02
| | | | | | | | Bug: skia:6830 Change-Id: I1a6bb781465a29cec4946462e234d63c48693454 Reviewed-on: https://skia-review.googlesource.com/66543 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Add a tooling flag for path mask cachingGravatar Chris Dalton2017-10-13
| | | | | | | | | | | Adds the flag and a disables caching on the CCPR bots. Bug: skia: Change-Id: Icb85e77f89634dda1d419dacac5b8a93340723f0 Reviewed-on: https://skia-review.googlesource.com/59740 Reviewed-by: Eric Boren <borenet@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Move several GrContextOptions fields behind GR_TEST_UTILSGravatar Brian Osman2017-08-30
| | | | | | | | Bug: skia: Change-Id: I35bc08ad72fb94d8e47fe342d314c4496b954226 Reviewed-on: https://skia-review.googlesource.com/40881 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Threaded generation of software pathsGravatar Brian Osman2017-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Re-land of: https://skia-review.googlesource.com/36560 All information needed by the thread is captured by the prepare callback object, the lambda captures a pointer to that, and does the mask render. Once it's done, it signals the semaphore (also owned by the callback). The callback defers the semaphore wait even longer (into the ASAP upload), so the odds of waiting for the thread are REALLY low. Also did a bunch of cleanup along the way, and put in some trace markers so we can monitor how well this is working. Traces of a GM that includes GPU and SW path rendering (path-reverse): Original: https://screenshot.googleplex.com/f5BG3901tQg.png Threaded, with wait in the callback (notice pre flush callback blocking): https://screenshot.googleplex.com/htOSZFE2s04.png Current version, with wait deferred to ASAP upload function: https://screenshot.googleplex.com/GHjD0U3C34q.png Bug: skia: Change-Id: Idb92f385590749f41328a9aec65b2a93f4775079 Reviewed-on: https://skia-review.googlesource.com/40775 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Always include the default path renderer in the chainGravatar Brian Osman2017-08-29
| | | | | | | | | | | | | This (plus SW) ensures that we can always draw any path. Changed the path renderer command line flags so that 'default' means everything but CCPR, and 'All' really means 'every path renderer'. Bug: skia: Change-Id: I2801d1c50ab939f23efb4600e0f90e6add2891b7 Reviewed-on: https://skia-review.googlesource.com/40221 Reviewed-by: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Threaded generation of software paths"Gravatar Brian Salomon2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 76323bc0615044a5921afef0e19a350f3d04ffe0. Reason for revert: Breaking NUC bots in threaded gm comparison: https://chromium-swarm.appspot.com/task?id=382e589753187f10&refresh=10 Original change's description: > Threaded generation of software paths > > All information needed by the thread is captured by the prepare > callback object, the lambda captures a pointer to that, and does the > mask render. Once it's done, it signals the semaphore (also owned by the > callback). The callback defers the semaphore wait even longer (into the > ASAP upload), so the odds of waiting for the thread are REALLY low. > > Also did a bunch of cleanup along the way, and put in some trace markers > so we can monitor how well this is working. > > Traces of a GM that includes GPU and SW path rendering (path-reverse): > > Original: > https://screenshot.googleplex.com/f5BG3901tQg.png > Threaded, with wait in the callback (notice pre flush callback blocking): > https://screenshot.googleplex.com/htOSZFE2s04.png > Current version, with wait deferred to ASAP upload function: > https://screenshot.googleplex.com/GHjD0U3C34q.png > > Bug: skia: > Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790 > Reviewed-on: https://skia-review.googlesource.com/36560 > Commit-Queue: Brian Osman <brianosman@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com Change-Id: Icac0918a3771859f671b69ae07ae0fedd3ebb3db No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/38560 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Threaded generation of software pathsGravatar Brian Osman2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | All information needed by the thread is captured by the prepare callback object, the lambda captures a pointer to that, and does the mask render. Once it's done, it signals the semaphore (also owned by the callback). The callback defers the semaphore wait even longer (into the ASAP upload), so the odds of waiting for the thread are REALLY low. Also did a bunch of cleanup along the way, and put in some trace markers so we can monitor how well this is working. Traces of a GM that includes GPU and SW path rendering (path-reverse): Original: https://screenshot.googleplex.com/f5BG3901tQg.png Threaded, with wait in the callback (notice pre flush callback blocking): https://screenshot.googleplex.com/htOSZFE2s04.png Current version, with wait deferred to ASAP upload function: https://screenshot.googleplex.com/GHjD0U3C34q.png Bug: skia: Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790 Reviewed-on: https://skia-review.googlesource.com/36560 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Add ANGLE support to Viewer on WindowsGravatar Brian Salomon2017-08-17
| | | | | | | Change-Id: I97a844b2f289d2518f60a64f94d60551c4530dd4 Reviewed-on: https://skia-review.googlesource.com/35742 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Add AAA and DAA toggles to viewerGravatar Yuqian Li2017-08-07
| | | | | | | | Bug: skia: Change-Id: I0ee397d2b2c81a25918cb28be426cf5162da772f Reviewed-on: https://skia-review.googlesource.com/30561 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* clang on windows supportGravatar Mike Klein2017-07-31
| | | | | | | | | | | | | | | | | 1) Run python bin/fetch-clang-win 2) Set clang_win = "../bin/clang_win" 3) ??? 4) Profit Most changes here are to pass the right -mfoo flags to Clang to enable advanced instruction sets, or fixed warning-as-errors. BUG=skia:2679 Change-Id: Ieed145d35c209131c7c16fdd3ee11a3de4a1a921 Reviewed-on: https://skia-review.googlesource.com/28740 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix viewer state that has empty state/optionGravatar Yuqian Li2017-07-26
| | | | | | | | | | | | | If the value or option is empty (as was for kInstancedRenderingStateName), our Android Java application will throw exception and skip the remaining state objects. That would result in missing "Softkeys" and "FPS" for Raster backend in Android Viewer app. Bug: skia: Change-Id: I6f600bbb94509ca5389eac2d681304a00427ecdb Reviewed-on: https://skia-review.googlesource.com/26527 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Faster, thread-safe implementationGravatar Brian Osman2017-07-24
| | | | | | | | | Bug: skia: Change-Id: I401c5a9885c348aa424ab07b094acecddb209490 Reviewed-on: https://skia-review.googlesource.com/25860 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* First stab at JSON event tracerGravatar Brian Osman2017-07-20
| | | | | | | | | | | | | | | | | | | | Not yet thread safe (so it forces threading off). Builds JSON on the fly, so overhead is certainly bad. Plan to fix all of that, but this at least "works". There is now one tracing flag: 'trace'. - 'debugf' installs the SkDebugf tracer. - 'atrace' installs the Android ATrace tracer. - Any other value is interpreted as a filename, and produces a JSON file for chrome://tracing. All three modes work in DM, nanobench, and Viewer. Bug: skia: Change-Id: I3fbc22382b99418a508c670be2770195c0a1c364 Reviewed-on: https://skia-review.googlesource.com/24781 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Coverage counting path rendererGravatar Chris Dalton2017-07-14
| | | | | | | | | | | | | | | Initial implementation of a GPU path renderer that draws antialiased paths by counting coverage in an offscreen buffer. Initially disabled until it has had time to soak. Bug: skia: Change-Id: I003d8cfdf8dc62641581b5ea2dc4f0aa00108df6 Reviewed-on: https://skia-review.googlesource.com/21541 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* On Windows, always re-create window for GL or VulkanGravatar Brian Osman2017-07-12
| | | | | | | | | | | | On at least one machine, I've seen SetPixelFormat fail after Vulkan was used to render to a window, preventing us from creating a GL context. This is ham-fisted, but solves the problem. Bug: skia: Change-Id: I76d0cb26e181304846aa06109c1af768f8363a18 Reviewed-on: https://skia-review.googlesource.com/22740 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Hack to fix MSAA GL -> Vk transition on Windows ViewerGravatar Brian Osman2017-06-23
| | | | | | | | Bug: skia: Change-Id: I49417789ab43734a1cbb4010281482970579971d Reviewed-on: https://skia-review.googlesource.com/20505 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Touch input support for WindowsGravatar Brian Osman2017-06-07
| | | | | | | | | | | | | | | | | | | Had to add some logic to avoid touch and mouse cross-talk, because (at least on my laptop), the touch screen generates both kinds of events. This seems really useful [1] for the many [2] Skia developers with touch-enabled Windows devices. ---------- 1: No, not really. 2: N = 1? Bug: skia: Change-Id: Ib888bf4198f2cc0a29a31581ec4b64d3d9008c33 Reviewed-on: https://skia-review.googlesource.com/18920 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* 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>
* Fix resource and skp paths in Android viewerGravatar Brian Salomon2017-05-26
| | | | | | | | | Docs-Preview: https://skia.org/?cl=18037 Change-Id: If92e561c6c24de1f51f81477d89b927e10308f13 Reviewed-on: https://skia-review.googlesource.com/18037 Reviewed-by: Derek Sollenberger <djsollen@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Modify SkEventTracer::SetInstance to fail rather than assert if a tracer has ↵Gravatar Brian Salomon2017-05-12
| | | | | | | | | | | | already been installed. Chromium usually calls SetInstance once per process. However, when run in single process more renderer threads will try to set the instance after the browser process already has done so. This allows them to fail gracefully without asserting. Bug: skia:6603 Change-Id: Ic8a35422d787335aa67eefc07d0658f0fbe73db4 Reviewed-on: https://skia-review.googlesource.com/16664 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Add ShadowUtils sample.Gravatar Jim Van Verth2017-05-04
| | | | | | | | | Also enables mouse support in Viewer. Change-Id: Iaed08d42a64f591f0cd9b24684b3aee43404ed94 Reviewed-on: https://skia-review.googlesource.com/15313 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Add wireframe mode to Viewer.Gravatar Jim Van Verth2017-05-02
| | | | | | | Change-Id: I0ff11088465a4702acf9841a791d76f286ddbaf1 Reviewed-on: https://skia-review.googlesource.com/15147 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Osman <brianosman@google.com>