Commit Graph

685 Commits

Author SHA1 Message Date
Brian Osman
90263a14b5 Revert "Spruce up SkSL slide with a much nicer editor"
This reverts commit 88c5af7ecd.

Reason for revert: Various input bugs in the new editor make it somewhat unusable.

Original change's description:
> Spruce up SkSL slide with a much nicer editor
>
> Pulls in a new GitHub repo that implements a syntax-highlighting code
> editor ImGui widget.
>
> Change-Id: I968e5eb827c226259eaaad2996eeaad9de592e37
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491444
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: Ifa5bc87327785d107956201c4d866c7259006ec2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492359
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-01-07 15:56:16 +00:00
Kevin Lubick
96e4053be7 Update Bazel files
- Use latest emscripten toolchain (3.1.0)
 - Autogenerate the atoms and manually fix some of the file lists.
 - Add a known_good_builds target to bazel/Makefile to help
   check the things we expect to work with Bazel.

Change-Id: Ia5f51e7b9eb5c108386820ad59180c8f862f5a70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491438
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-01-06 18:10:57 +00:00
Brian Osman
88c5af7ecd Spruce up SkSL slide with a much nicer editor
Pulls in a new GitHub repo that implements a syntax-highlighting code
editor ImGui widget.

Change-Id: I968e5eb827c226259eaaad2996eeaad9de592e37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491444
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-01-05 20:19:49 +00:00
John Stiles
d67f1f8f50 Provide bit-casted slot values from DebugTracePlayer.
Previously, the VariableData returned from a DebugTracePlayer contained
values in an int32_t, regardless of the slot's NumberKind. We had a
helper function which could stringize the bits, but otherwise the caller
was responsible for bit-casting the value manually.

Now, the DebugTracePlayer will automatically manage bit-casting for the
caller. The value returned in the VariableData is now a double (so it
is able to store an int32, uint32, or float at full precision).

This change was inspired by the recent Typescript port. (The value in
the Typescript VariableData uses a compound `number | boolean` type, so
it is able to fully represent any slot value natively.)

Change-Id: I5eec414236f76ad0ff51b0b19974e4a0025c4d62
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489896
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-29 18:30:19 +00:00
John Stiles
81134a7a62 Add checkbox to disable Shadertoy uniform support.
Generally these are harmless, but in some cases, they get in the way.
(e.g. when trying to make a minimal debug trace)

Change-Id: I2218e68c70fdbf85c3e10df232955038e2aaed29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/488376
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-28 15:04:50 +00:00
John Stiles
87ced29082 Track line reachability on a step-by-step basis.
Since we know the entire flow of execution ahead of time, at any point
during trace playback, we can know if a line will be reached again or
not. We no longer highlight lines as reachable (or allow setting
breakpoints) if the line will not be reached again during trace
playback.

Change-Id: Iff563b13e2f6efb5d4f2ff37215f2ff4fb5945ed
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486496
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-12-22 19:33:17 +00:00
John Stiles
44a8392620 Add breakpoint support in SkSL debugger.
Line numbers were previously Text. They are now SmallButtons; clicking
them sets and clears breakpoints. The set of active breakpoints is
stored in an unordered_set of line numbers. Breakpoints are visualized
by setting the color of the SmallButton controls to red.

We now also have "Reset" (start over) and "Run to Breakpoint" buttons.

http://screen/8rtenW2vszxDgCp

Change-Id: I30a79bb09811e1d8a4e4e8535cbe62020f20f111
Bug: skia:12747
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485861
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-12-16 20:46:56 +00:00
John Stiles
eff367ac83 Highlight reached/unreached lines differently in Debugger.
This is useful to know because breakpoints can only meaningfully be set
on a line of code which is reachable. In other words, we know the
entire execution path ahead of time, so we can tell you that some
branches aren't actually taken without needing to set a breakpoint at
all.

Change-Id: I72b2cddcf92fd6f75ea12d302230bae42b7112bc
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485218
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-15 20:08:06 +00:00
John Stiles
457f1b9f41 Show the variables pane even when it is empty.
The widget layout shouldn't change when there are no variables.

Change-Id: Iedb48642486944127fa800072c1f4c57a574b513
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484836
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-15 18:13:26 +00:00
John Stiles
708f28f4b1 Show the stack trace in the Debugger slide.
Right now it is non-interactible, but it's still useful for keeping
track of the flow of execution.

http://screen/4b6WMGdw6j32AGc

Change-Id: I978d9b441c15674c6cae508b123579021c2ecc46
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484076
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-14 15:56:44 +00:00
John Stiles
0745d19ae3 Hide function return values after a step.
Previously, return values like `[func].result` would stick around in the
Variables table indefinitely. This felt very counterintuitive. Now they
only appear for one step, then vanish.

Change-Id: Iedfc7d2ddf136111005b26aaefb380ffc6281d05
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483605
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-13 22:14:35 +00:00
John Stiles
49cb6d7668 Add a Variables pane to the SkSL debugger.
The currently-active stack frame is always shown. Values which were
modified during the last step action are highlighted.

http://screen/4E4BLXYJsDR5bhk

Change-Id: I521d92fa6c1eabd64aaeeb188c71f04a79f827f5
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483602
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-13 20:29:26 +00:00
John Stiles
5d3060ed94 Add support for stepping out from a function.
Stepping out is extremely similar to stepping-over, so this was mostly
working already.

Change-Id: Ib1c1ba96b45a732500e72b6da4cbfe41a1f75307
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483196
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-12-13 16:43:49 +00:00
John Stiles
a26ba3e51b Improve the debugger code view.
The raw text has been replaced with a proper table. Stepping through
code now scrolls properly to focus on the current line. The ASCII "->"
arrow has been replaced by a focus highlight. The top controls no longer
scroll away when browsing code.

http://screen/BnTa3thYzUgTTdG

Change-Id: Ieaa3a479099bbd09d9ba2cb5552befdd5307f9c5
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483156
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-12-13 16:43:23 +00:00
John Stiles
00b3fcccdf Create Debugger slide for Viewer.
This is a very rough first draft which provides the bare minimum. Shader
source is dumped to the window as static text, along with an arrow
tracking the current trace line. Two buttons allow for single-step and
step-over. There aren't yet any GUI affordances for the stack or
variables.

http://screen/44WAnxchjy8MPjM

Change-Id: Ifad4a146b54d334113b02132eec2238af4fd8580
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481681
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-13 16:28:06 +00:00
Jim Van Verth
db9f95c888 Move ShaderUtils out of Ganesh.
This will allow us to use ShaderUtils in both Ganesh and Graphite.

Change-Id: I78e34c4eb969a0d827c459d7fb945d17fdc22efa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482696
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-12-10 23:10:25 +00:00
John Stiles
1786647583 Improve debug trace generation speed by clipping the paint.
When generating a debug trace, we disable most optimizations, pessimize
the SkVM code with many additional instructions, and run the interpreter
instead of the SkVM JIT. Additionally, while under development, viewer
is generally compiled in -O0. All of these changes made it painfully
slow to generate the debug trace of a complex shader, even though we
only care about tracing a single pixel of the paint.

Now, when taking a debug trace, we clip the paint to a small 4x4 area
surrounding the trace coordinate for a single frame. This makes debug
traces run very quickly, even on a modest laptop CPU.

Change-Id: Ibcadc20a8d83a3a241e05408b8af31d61cf03d4c
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482701
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-10 20:13:00 +00:00
John Stiles
45c9eab786 Update ImGui to v1.85.
Change-Id: Ia490c514722b3d23cbf54a5905d301272e7ef161
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481856
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-12-09 15:10:31 +00:00
John Stiles
4898ac10f0 Sort GM/sample slides in Viewer.
Previously, GMs were displayed in a chaotic somewhat-alphabetical order,
and samples were displayed in a reverse somewhat-alphabetical order. Now
we actually sort them by name.

Additionally, switched to sk_make_sp to make sk_sp (in the spirit of
go/totw/126).

Change-Id: I94abd52d6f0ba65b6e23108f9f6aeed1c7ddf08f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481678
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-12-08 22:52:58 +00:00
John Stiles
97119e5b3c Add "Write Debug Trace/Dump" buttons to SkSL slide in Viewer.
Click these buttons to trace execution of the current SkSL program.
This demonstrates end-to-end debug trace functionality in
SkRuntimeEffect.

Change-Id: I684099e337d1d275e444eb33dfa3a9e99343bb17
Bug: skia:12708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481336
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-08 16:17:26 +00:00
Florin Malita
800aa13913 [viewer] Add color histogram
Change-Id: Ib3a4041a40de5925ebf98b325122acb3261a9d92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479436
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-12-03 15:49:14 +00:00
Kevin Lubick
6ba9f702ba [bazel] Try adding cc_binary rules that use generated rules
To make the atomic rules a bit easier to work with, in many
of the folders, this adds in cc_library rules to group
together the sources from that folder (and subfolders
where prudent). We only needs sources because those atoms
should have their headers as deps.

One issue that was pointed out is that there is currently
no way to restrict the inclusion of certain packages,
a la, `gn check`. For example, there is no mechanism from
stopping a dev from adding
#include "modules/canvaskit/WasmCommon.h"
to something in //src/core (except circular dependencies).
We can probably address that using Bazel's visibility
rules as needed:
https://docs.bazel.build/versions/main/visibility.html
https://docs.bazel.build/versions/main/be/functions.html#package_group

It is recommended to look at this CL patchset by patchset.
PS1: Update gazelle command to generate rules in more folders.
PS2: A few changes to make generation work better.
PS3: The result of running make generate in //bazel
PS4: Adding the rules to build sksllex, the simplest binary I
     could find in the Skia repo.
PS5: Adding the rules to build skdiff, a more complex binary.
     I tried a few approaches, but ended up gravitating back
     towards the layout where we have each folder/package
     group up the sources. I imagine at some point, we'll have
     skdiff depend on skia_core or something, which will
     have things like //src/core, //src/codecs, //src/pathops
     all bundled together.
PS7: Added in the groupings of sources, similar to what we had
     earlier. I liked these for readability. These helped fix
     up the //:skia_core build, and by extension, the CanvasKit
     build.

Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 18:18:53 +00:00
Brian Osman
a583a0fdcc In SkRuntimeEffect, replace ConstIterable with SkSpan
Change-Id: Ibeea56ebd5dce53af1252ca3ecf6cc6f010bd461
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469902
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-11-10 21:09:58 +00:00
Brian Osman
a45c93c505 Add a color-spin control to Viewer
This cycles the primaries, just like SkColorSpace::makeColorSpin.
Helpful for debugging more exotic color space issues.

Change-Id: I3434c7a9f24642f13be0ac3513599a15247d1f6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469360
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-11-09 21:15:04 +00:00
Brian Osman
f8b3e0c50e Add disassembly to skvm debug panel
Change-Id: Ic110ea129cf902d8d1a87c6133e71a1fdeb366f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468376
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-11-05 17:09:44 +00:00
Brian Osman
88117ab843 Improve the skvm debug panel
Use SkVMBlitter::DebugName for the string. This is easier to read, and
has some actually useful information about the blitter.

Added magenta highlight of the hovered element, similar to the GPU.

Change-Id: Ic9b5a0f61e092c8aa555f375d5d2f2de22cc45fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467977
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-11-04 21:02:21 +00:00
Brian Osman
fa6e45f261 Add an SkVM panel to viewer's debug UI
Caveats:
  - You want to run viewer with `--skvm` to see much/anything
  - The cache is LRU, and doesn't get flushed automatically. Hitting
    'Clear' will flush it, so it will pick up only the blitters used
    on the current slide. (Otherwise they accumulate as you navigate).
  - No way to determine which blitter is for which primitive, yet.
    I'd like to do the GPU-style magenta highlight, but that may be
    tricky, because we need to preserve the semantics of the original
    blitter (including destination color type, most importantly).

Change-Id: I2df763fdb697d87471ca0816a3b7087ffb4fc4e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467783
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-11-04 16:49:53 +00:00
Chris Dalton
aa0600136c Extract ToolUtils::sniff_paths
Makes the path sniffing code from BisectSlide reusable.

Change-Id: I21c1e752590359c557c35804e5d5044d8041a308
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460637
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-19 17:39:11 +00:00
Kevin Lubick
8f4e560871 Use CommonFlags namespace for other flags/functions
This consolidates tools/flags/CommonFlagsFontMgr.h into
tools/flags/CommonFlags.h and adds all those common
flags into the CommonFlags namespace.

I also cleaned up a few unused includes in DM.cpp

Change-Id: I1d1bf6598dfb87619b6abbb9faa1e24631f76fb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-10-14 14:34:21 +00:00
Kevin Lubick
237dd2d94d Move --nativeFonts to CommonFlags file
Also noticed while trying to build GMs in WASM with
Bazel.

Change-Id: I33d467a0da0893c1a5e376f4fd1a6096dad48af3
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459198
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-10-14 12:57:29 +00:00
Jim Van Verth
7bb0ff05ce [graphite] Add support to Mac Viewer.
Adds a type enum to WindowContext to determine which kind of
GPU context (GrDirectContext or skgpu::Context) we're using.

Bug: skia:12466
Change-Id: I288878740392a43cd9e82c925fbe2c372d140dc5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454699
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-09-30 21:38:25 +00:00
Brian Osman
cbfa34a58c Convert internal SkSL to use .eval()
Also update RELEASE_NOTES to describe new syntax.

Change-Id: I2666551b98f80b61ae3a48c92a9e306cdc7242b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 15:54:54 +00:00
Robert Phillips
2af13c135b Reland "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 44b7568c8a.

Reason for revert: Google 3 CL has landed

Original change's description:
> Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
>
> This reverts commit 30a6b101f4.
>
> Reason for revert: Maybe blocking G3 roll?
>
> Original change's description:
> > Fix compilation w/ "skia_enable_svg = false" (take 2)
> >
> > Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Idf73d864108067ee1c34e88ee4e5236847abd582
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444501
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 17:54:08 +00:00
Robert Phillips
44b7568c8a Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 30a6b101f4.

Reason for revert: Maybe blocking G3 roll?

Original change's description:
> Fix compilation w/ "skia_enable_svg = false" (take 2)
>
> Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 22:31:00 +00:00
Robert Phillips
30a6b101f4 Fix compilation w/ "skia_enable_svg = false" (take 2)
Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:28:25 +00:00
Robert Phillips
24d622d6f9 Move the GrTessellationPathRenderer into the skgpu::v1 namespace
Bug: skia:11837
Change-Id: Ic445e99adbe2d2ada64f98f9f516c198a247ef09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440876
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-25 17:16:28 +00:00
Brian Osman
293497e77f Convert internal sample() calls to shade/filter/blend
Bug: skia:12302
Change-Id: I8cf958acf9214d0de903a4097647afd74f2a659e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441541
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 21:03:44 +00:00
Robert Phillips
e453fa063d Move some v1-only gpu/tessellate files to gpu/ops
This CL just moves the files and renames them. It doesn't move them into the skgpu::v1 namespace.

Bug: skia:11837
Change-Id: Iab322d0dc5b5d1cfd32436785081539dc85c18d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440776
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-08-19 19:56:46 +00:00
Robert Phillips
43e70f1913 Move 2 path renderers to skgpu::v1 namespace
Bug: skia:11837
Change-Id: I71c8e5b7221e0eb84400e0ddc1a8126d820d24bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440538
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-08-19 16:16:23 +00:00
Robert Phillips
832f3fbcae Move GrTessellationPathFlags to their own header (GrTessTypes.h)
Having this enum on GrTessellationPathRenderer forced it to be over-#included and was blocking making GrTessellationPathRenderer.h v1-only.

Bug: skia:11837
Change-Id: I80660ed659946d7aa555057c9f4fd1136b44cca0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440536
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-19 14:47:45 +00:00
John Stiles
488654b839 Fix cases of variable shadowing in /tools/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

(Turtle.cpp is #included from a cpp in the tools directory.)

Change-Id: I1685086ec0ceae1d51efa7daa0f46137b535ce77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438476
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-11 16:05:52 +00:00
Michael Ludwig
49914e5813 Avoid unnecessary setting of display params in Viewer
I noticed Viewer lagging significantly when interacting with certain
sliders (such as transform state). It turns out that the UI tracking
would trigger calling Window::setRequestedDisplayParams and that in
turn can trigger a full context recreation, depending on backend.

I'd recently changed GPUs in my machine and apparently its context
creation is substantially slower than my previous one. Historically
I noticed minor jank when interacting, but it was never a deal
breaker.

This splits the parameter tracking into two categories so that lighter
weight widgets can still trigger window invalidation / re-rendering,
without triggering the context creation.

Change-Id: I3eb4c15b802f8b8ea8d8eca386de5dcee22ba9ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437685
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-09 17:38:28 +00:00
Robert Phillips
294d687b69 Avoid OveridePaintFilterCanvas in Viewer when possible
Since:

https://skia-review.googlesource.com/c/skia/+/431539 (Feed all top-level GPU accessors through skgpu::BaseDevice (take 2))

The OveridePaintFilterCanvas now blocks access to the true SurfaceDrawContext that backs the top device of a GPU-backed SkCanvas. This is because the SkPaintFilterCanvas doesn't pass on SkCanvas::topDevice calls to the canvas it is wrapping so it always returns a SkNoPixelsDevice.

Given that accessing the top SDC is an incredibly specialized testing-only feature this CL keeps the feature working short-term w/o gumming up the public API.

Change-Id: I99012ba34c2800e0149251667156b412c4e8aa63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433362
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-27 15:46:02 +00:00
Chris Dalton
c3176002bc Lift the tessellation atlas into its own path renderer
Creates a new path renderer, GrAtlasPathRenderer, that handles all the
atlasing. Managing the atlas in its own path renderer gives us more
control over when atlasing happens in the chain, will allow us to more
easily use the atlas in kCoverage mode, and makes the clipping code
cleaner.

Bug: skia:12258
Change-Id: Ie0b669974936c23895c8ab794e2d97206ed140f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431896
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-23 23:02:58 +00:00
Mike Reed
c82ab0839f Stop using filterquality
Change-Id: I67d1a464618f1a54f4e3bd4e1409b1d91a90e66a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-17 03:11:32 +00:00
John Stiles
9671d0aa31 Add checkbox to Viewer to force-enable Runtime Blends.
In a perfect world, this should always render the same, just perhaps a
bit more slowly.

Change-Id: I750ad43142d4d192be4db7396989d978025179a8
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429101
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-16 21:11:28 +00:00
Chris Dalton
475c9758eb Move the DMSAA surface flag into the public API
Bug: skia:11396
Change-Id: Iad175ea9727e0b18b94a7af341c831e03da46880
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427484
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-13 19:21:00 +00:00
John Stiles
7bf799956d Reland "Add format-specifier warnings to SkDebugf."
This is a reland of e58831cd95

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:12143
Change-Id: Id3c0c21436ebd13899908d5ed5d44c42a0e23921
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421918
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 17:57:43 +00:00
Tyler Denniston
283dba5785 Revert "Add format-specifier warnings to SkDebugf."
This reverts commit e58831cd95.

Reason for revert: looks like breaking a few build bots

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I07848c1bf8992925c9498e916744d0840355a077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421917
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-25 13:33:10 +00:00
John Stiles
e58831cd95 Add format-specifier warnings to SkDebugf.
This CL fixes up many existing format-specifier violations in Skia.
Note that GCC has a warning for formatting nothing, so existing calls to
`SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
These were apparently meant to be used as a place to set a breakpoint.

Some of our clients also use SkDebug with bad format specifiers, so this
check is currently only enabled when SKIA_IMPLEMENTATION is true.

Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 11:05:59 +00:00