Make sure graphite compiles standalone and not just if ganesh is also
enabled.
Bug: skia:12466
Change-Id: Ic843881a2a88c8d4b62f3a2ea38a10b6a86a12d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464817
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
With this you should be able to set skia_enable_gpu=false in your gn
args and still be able to compile and run graphite.
Bug: skia:12466
Change-Id: Ibffc8774a8c46afad3f717dabc54fa831338a807
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463317
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
The lexer uses a matrix of state transition data to parse text. This
matrix was highly sparse and contained large runs of zeros and repeated
values. I found that by transposing the matrix, it became extremely
compressible. In its transposed state, most slices had only 1-3 unique
nonzero values.
This CL leverages this finding to reduce the matrix data from ~55K to
~10K. A handful of slices do contain a large number of unique values and
continue to be represented as plain 16-bit arrays. Some slices contain
no data at all and were eliminated entirely. The majority of slices are
now represented by a compact two-bit array. Bit pattern 00 always
represents zero. Bit patterns 01, 10 and 11 are translated into values
v0, v1 and v2, which are stored per slice (bit-packed to save a few
extra bytes). This transformation involves a fair amount of bit shifting
and masking, but the generated code will be quite efficient:
https://godbolt.org/z/eTvjr96ez
Change-Id: Iecc67aadd510ccf63b4bcb11ed861d703efefaae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461356
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Implements a BSP tree with NEON/SSE optimizations that tracks
non-overlapping regions. This object can be used batch sets of paths
into non-overlapping draws. Performance on AppleM1 with our existing
benchmarks looks very promising:
desk_motionmarkarcs.skp 1227 paths -> 69 draws 450us
desk_motionmarksuits.skp 1417 paths -> 26 draws 201us
desk_chalkboard.skp 1940 paths -> 11 draws 84us
desk_ynevsvg.skp 859 paths -> 10 draws 31us
desk_micrographygirl.skp 318 paths -> 29 draws 11us
Bug: skia:12466
Change-Id: I847a93ed726dea10cb403cb76e578bd81eb920d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460298
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Adds test of command buffer submission with GPU recording (if enabled).
Also adds programmatic GPU recording support.
Bug: skia:12466
Change-Id: I85aba9f7e5e09f62f2ddc7040d1ff84bb9b4ae09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460337
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
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>
The ToolUtils file is getting a bit bloated, IMO. I noticed this when
working on Bazel includes.
Including non-header files is a small nuisance in Bazel, so it
is probably better to just make it its own compilation unit.
Change-Id: I06ca3808a37ebef6478f5afa3f14086429899590
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459197
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:12466
Change-Id: I401a185d818a964327d323b9ebcd0850ec0b1c9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457318
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of bedb69ccfb
Original change's description:
> Clean up #includes in SkCFObject.
>
> SKCFObject.h wasn't compiling without prefixing it with other includes,
> so adding them into the actual file itself. Also changed to use the
> more generic __APPLE__ as a guard rather than BUILD_FOR_MAC or
> BUILD_FOR_IOS defines, and added the file to BUILD.gn so it will be
> added to Xcode projects.
>
> Change-Id: I67a48d0156ef1eb5c69dd045f0acadf147053eb6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455163
> Auto-Submit: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ibf372fc07c78121beae8cd78e0a8a9f4a6d7ef5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455998
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit bedb69ccfb.
Reason for revert: breaking flutter roll
ERROR at //flutter/shell/gpu/gpu_surface_metal.mm:16:11: Including a private header.
#include "third_party/skia/include/ports/SkCFObject.h"
^------------------------------------------
This file is private to the target //third_party/skia:skia
Original change's description:
> Clean up #includes in SkCFObject.
>
> SKCFObject.h wasn't compiling without prefixing it with other includes,
> so adding them into the actual file itself. Also changed to use the
> more generic __APPLE__ as a guard rather than BUILD_FOR_MAC or
> BUILD_FOR_IOS defines, and added the file to BUILD.gn so it will be
> added to Xcode projects.
>
> Change-Id: I67a48d0156ef1eb5c69dd045f0acadf147053eb6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455163
> Auto-Submit: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I6aa236c784a3ebfb6e6b97dafa7761293f94cf3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455876
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
SKCFObject.h wasn't compiling without prefixing it with other includes,
so adding them into the actual file itself. Also changed to use the
more generic __APPLE__ as a guard rather than BUILD_FOR_MAC or
BUILD_FOR_IOS defines, and added the file to BUILD.gn so it will be
added to Xcode projects.
Change-Id: I67a48d0156ef1eb5c69dd045f0acadf147053eb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455163
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
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>
Bug: skia:12466
Change-Id: I3299940af72cffde3904cf5f6262955807d6d1bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453637
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12466
Change-Id: I90ebec9ee744de3822bd82d474858015d2490d72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453636
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:12466
Change-Id: I51dc73a213e672578767b41c01c487c942465964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452722
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ice0826af0b64fa8dd92975f879af8ab0f71740fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451039
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This should at least get something compiling.
Change-Id: I617fd4d6e4f0a3fdd6dedbe66f3a4448bb913b2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 481a58dfe0.
Reason for revert: Fixing the build
Original change's description:
> Revert "Small changes for SkText that are not in experimental directory"
>
> This reverts commit 92f1bc0083.
>
> Reason for revert: Blocking Android roll.
>
> Original change's description:
> > Small changes for SkText that are not in experimental directory
> >
> > (also made utf 8<->16 conversion static on SkUnicode)
> >
> > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> Auto-Submit: Brian Osman <brianosman@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
This reverts commit 92f1bc0083.
Reason for revert: Blocking Android roll.
Original change's description:
> Small changes for SkText that are not in experimental directory
>
> (also made utf 8<->16 conversion static on SkUnicode)
>
> Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
(also made utf 8<->16 conversion static on SkUnicode)
Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
This moves the functions for dealing with child effects into the public
module (where those types already live). With that change, blend and
colorFilter have no module-specific declarations.
Change-Id: I7665e68427ea4d8d1ed4d31afb658edb79bac5a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443412
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Bug: skia:8451 skia:10827
Change-Id: I5b38a1d72cd4558f8e2a92aaf9b12f05efce0923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442683
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
src/gpu/GrBlockAllocator -> src/core/SkBlockAllocator
src/gpu/GrTBlockList -> src/core/SkTBlockList
Tests and references also renamed.
Bug: skia:12330
Change-Id: I5fad05faa3dcecd89a0a478dcf30c090ea7589f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441477
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Skia has been using the not entirely public HarfBuzz subsetting API.
This API is changing for public release. In order to make the transition
from old to new build flags were added, which would require build
changes as HarfBuzz is updated downstream. Instead detect the existence
of the old or new API and use whichever is present automatically.
Change-Id: I0727f97ad7d394dfb24553076d4b383570cf0002
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437121
Reviewed-by: Garret Rieger <grieger@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
3a74ee5282..368e957887
Additionally adds a build option that switches to the new
harfbuzz subsetting api which is coming in the next version
of harfbuzz.
Change-Id: I924a7b4978412d636d4c8d19f5c6021ea3c73d21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433737
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This pulls the GPU-specific accessors off of SkCanvas and SkDevice - moving them all to skgpu::BaseDevice and SkCanvasPriv.
This will allow us to more easily change the gpu class hierarchy (esp. changing GrSurfaceDrawContext to skgpu::v1:SurfaceDrawContext) w/o churning the public API.
TBR=brianosman@google.com
Bug: skia:11837
Change-Id: Ib69a3ea27c840fa7758bc3318395a27228c7ae9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431539
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 5de8b19504.
Reason for revert: blocking Android roll
Original change's description:
> Feed all top-level GPU accessors through skgpu::BaseDevice
>
> This pulls the GPU-specific accessors off of SkCanvas and SkDevice - moving them all to skgpu::BaseDevice and SkCanvasPriv.
>
> This will allow us to more easily change the gpu class hierarchy (esp. changing GrSurfaceDrawContext to skgpu::v1:SurfaceDrawContext) w/o churning the public API.
>
> Bug: skia:11837
> Change-Id: I4e205255706680ac58ffe40f714884c2ee7ac799
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431036
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=robertphillips@google.com,brianosman@google.com,michaelludwig@google.com
Change-Id: I8a015be4edbe21d63db09d5593af13cc89df4217
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431538
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This pulls the GPU-specific accessors off of SkCanvas and SkDevice - moving them all to skgpu::BaseDevice and SkCanvasPriv.
This will allow us to more easily change the gpu class hierarchy (esp. changing GrSurfaceDrawContext to skgpu::v1:SurfaceDrawContext) w/o churning the public API.
Bug: skia:11837
Change-Id: I4e205255706680ac58ffe40f714884c2ee7ac799
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431036
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I46844754a86ae44b61747b7244edf6cc1fd73d61
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429102
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This will help us write tests confirming that runtime blends work the
same as the built-in blends.
Change-Id: I2f94aa7bbbc7124d09b490fc7509a4c281025307
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427618
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Add an overload to SkPathEffect that can be used when the CTM is known
at the callsite. GPU callsites are not handled here, that will be
tackled in a separate CL.
Path effects must implement the filterPath virtual that accepts the CTM,
although they are not obligated to use it. If a path effect does
use the CTM, the output geometry must be in the original coordinate
space, not device space.
Bug: skia:11957
Change-Id: I01615985599fe2736de954bb10dac881b0554ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420239
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Making GrDrawRandomOp and test_ops V1-only drags several GMs and tests with them. All the other GMs/tests explicitly require Ops.
Bug: skia:11837
Change-Id: I45c0a1054c3b1ec43f509595c6492581d10314cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425016
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Id2061ebe7873aa8b9480a2d8b0133c2fb79e79bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424098
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I4066aafc5b6137bfaf38100ff237fd9833023f34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424097
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I28eb4479476a531a7b45fbef0ce9da72a4d29dc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423997
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Original change's description:
> Metal: Add labels and debug groups to help with GPU Debugging.
>
> * Adds SK_ENABLE_MTL_DEBUG_INFO to enable labels and debug groups,
> dependent on skia_enable_gpu_debug_layers.
>
> Bug: skia:12150
> Change-Id: I5b4538c0f6df6ceed72d7e8e6f1952fd193b7b90
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422756
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:12150
Change-Id: I4bc686b7fdb1b929dbfdb2dd12fb5170fc9b36a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425185
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 9e583bfa3f.
Reason for revert: breaking flutter, needs available checks
Original change's description:
> Metal: Add labels and debug groups to help with GPU Debugging.
>
> * Adds SK_ENABLE_MTL_DEBUG_INFO to enable labels and debug groups,
> dependent on skia_enable_gpu_debug_layers.
>
> Bug: skia:12150
> Change-Id: I5b4538c0f6df6ceed72d7e8e6f1952fd193b7b90
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422756
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,chinmaygarde@google.com
Change-Id: I62deacb3527dc709fa8bb8c9f4631e523eae27f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12150
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423816
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
* Adds SK_ENABLE_MTL_DEBUG_INFO to enable labels and debug groups,
dependent on skia_enable_gpu_debug_layers.
Bug: skia:12150
Change-Id: I5b4538c0f6df6ceed72d7e8e6f1952fd193b7b90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422756
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>