Not only is this a best practice, it will make generating
BAZEL.build files easier.
Change-Id: Ib77c7dac6167235ec1b73a93bfd3a9c44b42ca83
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474756
Reviewed-by: Ben Wagner <bungeman@google.com>
All of the draw variants except drawIndexed support all base arguments
as part of the draw call that is recorded. Updated drawIndexed to use
the "instance" version and draw 1 instance if the baseVertex is not 0.
Previously, if we bound the buffer at a non-zero offset, but then
passed in 0 for the base vertex/instance relative to that, it would
reset the vertex offset to 0. This also cuts down on the number of
commands recorded since draws will only correspond to one command.
Bug: skia:12466
Change-Id: I3eb95b02d33f2d1e9b36991a8b824012383bc192
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474058
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Bug: skia:b/197500792
Change-Id: I0005469352cd44cf4c66aea11de98a0247afd747
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474397
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This change will make unifying code easier in future CLs.
Change-Id: I981b99ba4da6762702adfcb26165c1d3065339f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474896
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I750bf3103504e3ed12c93e3071950785128f7db5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474838
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12524
Change-Id: I2fb523495cfa72591a14b4ef03d32e3aad06fcf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474396
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:12524
Change-Id: Iac60a99331fefe9e997b61c4b2b329e39b95ae6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470197
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12524
Change-Id: I2664c8ea707a40724bcf916e907fe28d1fa276d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474357
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:12524
Change-Id: I31ddee40fed6e57caafe7a51fdd90459bd29cd6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474356
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12524
Change-Id: I99ade4b9f4fd442d9ddaa51651faf47321c06a5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474296
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is redundant information now that we have SkVMSlotInfo.
Change-Id: Ia05b1eaa722023e719042c83255708aa9debed61
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473777
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
* Remove 3 iPad Pro 9.7"s killed in the March 2020 Skolo flood.
* Add skia-iphone-8-03, which was mysteriously missing.
Change-Id: Idf3bbc553958a1327b0909183f85ab43dced3429
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474020
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Erik Rose <erikrose@google.com>
This adds new validation rules that we were breaking.
Binding and DescriptorSet can't be applied to push constants, nor to
struct members.
Bug: skia:12670
Bug: chromium:1270328
Change-Id: I332f77717b08d9945c8e5b79c5bf649a8f5f2043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474056
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
If a FreeType font has glyphs which may need the current color this is
non-changing information, so calculate it once at and cache it. This
information is needed on evert time a scaler context rec is created and
adding the overhead of looking through the font data (especially the
extra indirections from a ttc) can take a bit of time.
Bug: b/206120675
Change-Id: I92f2083a6bbd673fc148347c4e04ed81a441c3ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474059
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Previously, while BindBufferInfo had the right offset for binding the
buffers, the writer would always overwrite the contents at the
beginning. Never encountered it because the CommandBufferTest made its
VertexWriters directly, and DrawPass isn't end-to-end yet.
Bug: skia:12466
Change-Id: Ib874006d80a7286fcc3710cd38b3c6141ff928ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Update the check for situations using the direct glyph drawing
method. Mostly renaming.
Change-Id: I9e2ad8b669e9868b5fffd4864fb4551fec11f19c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474038
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:12559
Change-Id: I76b225c9ca81264a15869324007d774d210053b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473416
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Bug: b/205516620
Internally, Skia does not have full GL support for protected backend
textures. But there are some clients who know that they need to create
one so that they can render a protected buffer into it. Plumb in support
for clients calling GrDirectContext::createBackendTexture.
GrGLDefines.h:
- Add macros for querying whether a context is protected
GrGLCaps:
- Check whether the GL_EXT_protected_textures extension is present and
the context supports protected.
GrGLGpu:
- Remove failure cases for GrProtected::kYes. Instead, pass the value
down to createTexture where we then set the parameter in GL.
Change-Id: I465442fc4b19ed32a65079a168124a067bcd66a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472802
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Change-Id: Idcedaf97d9036fc892bbfc4fa7be468dd7a11db9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473660
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Previously, we would avoid emitting redundant trace_vars by checking to
see if the slot is being assigned to the exact same Var.ID. However,
this had the potential to eliminate useful trace_vars:
- At the start of execution, slots all contain 0. Code which explicitly
assigned a zero into a slot would not be shown in a trace. (So things
like `color = half4(0,1,0,1)` would only emit traces for color.ga.)
- A function call's parameter slots are reused every time it is called,
so calling a function twice would only emit traces for the parameters
that aren't the same Val.ID as the previous call.
- A VarDeclaration inside a loop reuses its slot each time through the
loop, even though conceptually it's a "new" variable.
We now track a slot's "written-to" status. At the start of execution,
no slots have been "written-to". These slots will always emit a
trace_var opcode (fixing the first issue). Also, issuing a function
call or declaring a variable will reset the "written-to" status of the
associated slots (fixing the second and third issues).
When the debugger is not in use, the written-to field is unused.
Change-Id: I482a86cb6e90d0f85dd2a161e984f212782a7b4d
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473776
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12662
Change-Id: Ic18220668a4f87e7340a53b3f191887a7a016a04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473141
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: 1265199
Change-Id: I217d75377c33940cdbabba278ee1ac06e94e177f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469899
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
We now canonicalize commutative operations by ordering their value IDs.
The lower-numbered value ID is always placed first into a commutative
instruction. In other words, this instruction:
bit_and result, v7, v5
Would be silently converted to this:
bit_and result, v5, v7
This will allow these two logically-equivalent instructions to be
deduplicated:
bit_and result, v7, v5
bit_and result, v5, v7
Of course, deduplicating these ops can unlock additional free CSE/DCE.
The affected instructions are listed in http://review.skia.org/473238
Change-Id: Ib9beb79d6b72d7903184aaa9a53e8e5a02ae126d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473239
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Make the code more consistent with:
* drawMatrix - CTM from canvas
* drawOrigin - x, y from drawTextBlob
* positionMatrix drawMatrix adjusted by drawOrigin
Change-Id: Ia22baa2d229f041b77dc6cde063e25f185b8b64a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473237
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This is a reland of 688cb15faa
Original change's description:
> Remove layer-coverage-tracking experiment
>
> This effectively reverts reviews.skia.org/122000
>
> Bug: skia:10987
> Change-Id: I989241110f17c0e3c2a896aea4bc2bc4cc8c910f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472801
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:10987
Change-Id: I16493df8bd7942261d14c01747d0fdc91bbe5467
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473143
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This will hopefully let us pre-package certain binaries (e.g. DM,
fuzz) with more sensible defaults and not make the developer
type out all the settings.
For CanvasKit, which specifies its own build flags, I think I'll
need to make another transition setup, which would go in something
like modules/canvaskit/ck_binary_with_flags.bzl or something.
Some sausage-case-names were converted to snake_case_names as per
go/build-style#target-naming
The example this is based off is worth a look through before
diving into this:
https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts
Change-Id: Ia919d47f4d1aa25cf294af7918e36d38838c179e
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472688
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Bug: skia:12657
Change-Id: I432dc004ac2c8a1f9b0fd0874b8690dcb7e16dbf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473146
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
To pick up canary.go task driver change in buildbot repo
Updated with:
$ go get go.skia.org/infra@74751ee0f1
$ go mod download
$ make -C infra/bots train
Bug: skia:12657
Change-Id: I3f42dd6a8041d2c84903e736e76029c198c811f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473144
Reviewed-by: Eric Boren <borenet@google.com>
This verifies that compiled SkSL code generates a reasonable trace.
Change-Id: Ia81a694460eaac261dfb9287b64f0afec013f76c
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473145
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This provides a callback mechanism for the interpreter when a trace
opcode is encountered. The callbacks are only invoked when the trace
mask is enabled.
Change-Id: I55db22e18106ae09e4ab0a503533d830282c772c
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473139
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Exceptionally large control points might require us to chop the path
very deeply. This CL converts the recursive chopping to loop with a
stack of control points on the heap, in order to avoid the risk of
stack overflow. It also adds a bail condition to avoid getting stuck
in endless recursion due to fp32 precision issues.
Bug: chromium:1266446
Change-Id: I005be4bc29de51d3c89f04b5d6c553a921a92aa3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473197
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Since we outset the viewport by stroke width for pre-chopping,
astronomically wide strokes can result in an astronomical viewport
size, and therefore an exponential explosion chops and memory usage.
It is also simply inefficient to tessellate these strokes due to the
number of radial edges required. We're better off just converting them
to a path after a certain point
Bug: chromium:1266446
Change-Id: I23ea39b0bd64f22d4e293a881992e3669afbe530
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473196
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a first step in making GrShaderCaps more general so we can use
it in Graphite.
Change-Id: I7fc874e5df8dba2cef05421840a4019e5499ab59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>