SK_SUPPORT_LEGACY_ONDRAWBITMAP_VIRTUALS flag to stage this
Change-Id: I32c1bc954446b44cbe656f07cf6f2ad70668b723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This had a not-very-useful matrix utility in it. We've had setSkMatrix
for a while, and the one other user always wanted a 4x4, which can be
done with SkM44 just as easily.
Change-Id: I3f00a0a1ccaf58bc9c775da4eef819af5a5fa7e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277605
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This moves the byte block linked list structure outside of GrMemoryPool
into a new type, GrBlockAllocator. This new type is solely responsible
for managing the byte blocks, tracking where the next allocation
occurs, and creating/destroying the byte blocks. It also tries to
encapsulate all of/most alignment related math, while making it
convenient for clients to add per-allocation padding/metadata.
It has added functionality compared to the original block linked list
that was embedded in GrMemoryPool:
- Supports resetting the entire allocator
- Supports resizing the last allocation
- Is able to rewind an entire stack of allocations, instead of just the
last allocation.
- Supports multiple block growth policies instead of just a fixed size.
- Supports templated alignment, and variable alignment within a single
GrBlockAllocator
- Query the amount of available memory
- Performs as much math as possible in 32-bit ints with static asserts
that ensure overflow won't happen.
Some of this flexibility was added so that the GrBlockAllocator can be
used to implement an arena allocator similar to SkArenaAlloc, or to
replace the use of SkTArray in GrQuadBuffer. It is also likely possible
that GrAllocator can be written on top of GrBlockAllocator. I will try
to perform these consolidations in later CLs.
Change-Id: Ia6c8709642369b66b88eb1bc46264fb2aa9b62ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262216
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
In the old code, the cache was checked and perged on every reattach
of a strike. That was left out of the multi-threaded code. Add the
check and purge back in to maintain cache size.
* Removed minimum cache size from setCacheSizeLimit.
Bug: skia:10046
Change-Id: I2438c83f04b6da8133c161a29604c3c3d7f58cd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277066
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
The only vaguely tricky thing to adapt from templating on T to T*.
Don't think there's a need for the unit tests now right?
Bug: skia:9703
Change-Id: Ib8fcebd9e0e35bea5ef23e6fd5962654a28d587b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277214
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Seems very one-off (esp. given SkSL). No one seems to use it.
Change-Id: Iaded54c5b4183fa4aa9c318b5dbe1d410cca539a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276617
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Metal and D3D don't require the GrGpu to delete resources, and for
Vulkan, we'll store the GrVkGpu in each individual resource. This will
allow us to use sk_sp<SomeManagedResource> in the future.
Bug: skia:9935
Change-Id: Id51022b935ad360367976a6bdf60cdda9e3f7dee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276456
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This was a convenience for Cary to not have to use extra_cflags,
and iterferes with using prebuilt C++ code by breaking the ABI.
Change-Id: I9e14ec04106a0abf9b55e5803242c2eb226d6e3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276445
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Bug: skia:9935
Change-Id: Ie13b9077c5db805020973e5cbab1aa8468c88742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276214
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 9d4b788807.
Copyright issue has been fixed in
https://skia-review.googlesource.com/c/skia/+/275998.
Original description:
Bug: skia:9756
In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.
Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.
Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.
Change IsPng signature to match other SkCodecs.
TBR=djsollen@google.com
Change-Id: Ic847bae0154e0a2922100b3f2ee14a077ee5635a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276007
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Bug: skia:9935
Change-Id: I28f799cb53eb12fc1bd63f4fbcf1e1a09d7ccf3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274937
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: I5cba7406522479c05dc5148357eed31d105a31fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275876
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 1b0124fec6.
Reason for revert: Check generated files bot is unhappy.
Original change's description:
> Move interpreter disassemble to out-of-line member of ByteCode
>
> Now it returns a string (rather than just calling printf).
>
> Adds GUI view of particle effect byte code (for fun), and fixes the
> unit tests that called ByteCodeFunction::disassemble, which wasn't
> doing anything.
>
> Change-Id: Ide3fd933cf14832feae7ff9e0fdc1ae8f24a28d4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273878
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com,ethannicholas@google.com
Change-Id: I478a93769a3e1a72a339853d6d41865dba8bbe66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275800
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Now it returns a string (rather than just calling printf).
Adds GUI view of particle effect byte code (for fun), and fixes the
unit tests that called ByteCodeFunction::disassemble, which wasn't
doing anything.
Change-Id: Ide3fd933cf14832feae7ff9e0fdc1ae8f24a28d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273878
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 94aaf7cdf5.
Reason for revert: you know what I already typed the reason stop making rules that people have to follow, robots.
Original change's description:
> Split building encoding from decoding
>
> Bug: skia:9756
>
> In CanvasKit, a large part of the binary is for encoding. Clients
> would be happier with a smaller binary and no webp/jpeg encoding. Make
> this an option by splitting up the GN arguments.
>
> Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
> existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
> PNG.
>
> Update CanvasKit compile script to disable webp and jpeg encoding.
> Update debugger compile script to disable all encoding.
>
> Change IsPng signature to match other SkCodecs.
>
> Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Nathaniel Nifong <nifong@google.com>
TBR=djsollen@google.com,scroggo@google.com,kjlubick@google.com,nifong@google.com
Change-Id: I4fc2ea916743fda7e7d0d668b59e52052e880104
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275710
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: I0d94bf055413ab7911136256f2ce2cda3581f45a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275656
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Beginning steps for adding textures and buffers.
Bug: skia:9935
Change-Id: Ib7a361a88c99ede4f89a456794b955e3c2750afa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275457
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:9756
In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.
Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.
Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.
Change IsPng signature to match other SkCodecs.
Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Change-Id: I478b10c23aae0c363b0d7342f25663ca8fc0d0fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274637
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
- used for debug lock tracking in SkFont*
- used for debug logging in SkPathOps
- genuine use in GLTestContext_cmd_buf?
switched that to thread_local
- keep empty SkTLS_{pthread,win}.cpp until
references to them can be cleaned up
Bug: skia:10006
Change-Id: I195a94c95d3f1a1918ee8c9bc4a15fa5b4344fbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit e5a06ce678.
Reason for revert: Need to make change in google3 first
Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
>
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
>
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Use SkIDChangeListener and update GrBitmapTextureMaker to add listener
to key to deregister if texture is purged before genID changes.
Add a common listener list implementation and replace existing lists.
Change-Id: Ib0c78241eaf59b59b892d8b004b2bb095140bc6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274549
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Generalizes the system used on SkPathRef where a GrTexture's key
destructor signals that a listener on the image can be removed via
the unique key custom data.
Removes texturesAreCacheable() from SkImageGenerator. This was used to
prevent unbounded growth in a narrow situation related to
GrBackendTextureImageGenerator.
Change-Id: I3c605da099acfac94751e793331e356a0979d359
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274038
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Trying to stage the texture format CLs in a little at a time.
Bug: skia:9935
Change-Id: I0fc6fe09fdb55d6c24b53af7edbcc8e8fc857ed7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273803
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ie50b15323df0a71c8d4276e3bc603061e469824d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273465
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is a reland of af5f9f008d
This was reverted due to Metal GMs failing. That is a bug in Metal where
pipeline creation fails with "internal error". Reporting to Apple, filing
Skia bug, and moving on.
Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
>
> It was used to sample clip masks using device coords.
>
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
>
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
>
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
>
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ia4530e6799019cd92863fe983a2d3c71df6f0620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273511
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
At the time Chromium is painting, we're passing node IDs
along with painting commands to enable tagging. However,
this assumes that all nodes will end up in the structure
tree, which we might not want.
Instead, allow the client to prune the structure tree
later before telling Skia to generate the PDF, but
keep all of the node IDs to be matched up with.
As an example, suppose the doc looks like this:
root id=1
paragraph id=2
div id=3
text1 id=4
link id=5
text2 id=6
The pruned tree passed to Skia would look like this:
root id=1
paragraph id=2 extra_ids=3,4
link id=5 extra_ids=6
We need to pass the extra node IDs into Skia so
that when content is tagged with id=4, we know to
map that to the paragraph node with id=2 instead.
Note that the resulting PDF document will *not*
have any of these extra IDs, they're all remapped
and consolidated.
While it's not strictly necessary that this is done
in Skia, it's easiest to implement it here. Doing the
same upstream would require replaying an SkPicture
and rewriting all of the node IDs.
Bug: chromium:607777
Change-Id: I0ecb62651e60b84cc5b9d053d7f7d3b9efda1470
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272462
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
This is a reland of 29dc430f43
Original change's description:
> Create D3D device and queue
>
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:9935
Change-Id: I1c8797e09cdeb3694ea7f47b2236ab7d91d9519f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 29dc430f43.
Reason for revert: This is breaking the Google3 autoroller due to header file d3d12.h not being available on google3.
Original change's description:
> Create D3D device and queue
>
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
Change-Id: I3857444cae52cc2338258c46b974ae5496bbaedc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272726
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
Clients will need official access to this class for the compilation iterator.
This CL also hides some of the cruft we don't want exposed.
Bug: skia:9455
Change-Id: I696c058f1c409fb459229552fbbdd935ec112358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:9935
Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit ad3b2c9886.
Reason for revert: clang
Original change's description:
> Move SkDeferredDisplayList.h into include\core
>
> Clients will need official access to this class for the compilation iterator.
>
> This CL also hides some of the cruft we don't want exposed.
>
> Bug: skia:9455
> Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Ica80434e7423fb202355eb77a614ece1c4d54726
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272641
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Clients will need official access to this class for the compilation iterator.
This CL also hides some of the cruft we don't want exposed.
Bug: skia:9455
Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit af5f9f008d.
Reason for revert: bad GM results on Metal
Original change's description:
> Remove GrDeviceSpaceTextureDecalFragmentProcessor.
>
> It was used to sample clip masks using device coords.
>
> Replace with a more generic GrDeviceSpaceEffect that simply calls a
> child FP with sk_FragCoord.
>
> Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
> at all if they are all applied in the FS (explicit coords). Moreover,
> the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
> var for local coords even when all FPs use explicit coords and wouldn't
> use a local coords var.
>
> Make CPP SkSL code gen for clone copy the explicit coord status of
> children.
>
> Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Ie02951dcc037d282dc3829cad216a0a0c9474038
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272518
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It was used to sample clip masks using device coords.
Replace with a more generic GrDeviceSpaceEffect that simply calls a
child FP with sk_FragCoord.
Also fix issue in GrQuadPerEdgeAA GP. It wouldn't setup coord transforms
at all if they are all applied in the FS (explicit coords). Moreover,
the GrGLSLGeometryProcessor::emitTransforms() helper required a valid VS
var for local coords even when all FPs use explicit coords and wouldn't
use a local coords var.
Make CPP SkSL code gen for clone copy the explicit coord status of
children.
Change-Id: Ib8bb36028354405c8012f6e91e9eb46db75d16a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271658
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The plan is:
Add SkDDLTmpRedirect.h
update clients to point to SkDDLTmpRedirect.h
Move SkDeferredDisplayList.h to include/core (and update SkDDLTmpRedirect.h)
update clients to point to SkDeferredDisplayList.h in its new location
remove SkDDLTmpRedirect.h
This staging is required to land:
https://skia-review.googlesource.com/c/skia/+/272343 (Move SkDeferredDisplayList.h into include\core)
Change-Id: I3302cdb8607b259d084bb9dd00600652c7f9a93a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>