Commit Graph

9458 Commits

Author SHA1 Message Date
Stan Iliev
4732dd3158 Fix C API example
Test: built and ran skia-c-example.c
Change-Id: I5691fa474f3efb6198c389180653ccded67e4f7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210633
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2019-04-28 01:09:13 +00:00
Mike Klein
bcbf9633db Temporarily revert runtime decoder registration.
Some builds in Google3 can't find SkSharedMutex at link time.

This reverts commit ff7006ff80.
This reverts commit 05f45b21b7.

Change-Id: I889e9a3169cf017b8d5daacf75099663fc996d73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210785
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-26 15:41:56 +00:00
Mike Reed
4e1b07e09f stage naming change in colorfilter
1. want to standardize on naming convention (matching shaders asA...)
2. want to eliminate legacy asColorMatrix with its 255 bias

Bug: skia:
Change-Id: I43258aa3a406b92a3246e13e5dd996fcc207c784
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210621
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-26 01:52:53 +00:00
Mike Klein
05f45b21b7 runtime registration for decoders
What do you think of this sort of thing for letting
users register codecs at runtime instead of at build time?

Change-Id: I448ea3466862326c283ad9b2f1b7eea56cffc80c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210449
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-25 21:43:12 +00:00
Chris Dalton
2185f39667 Revert "ccpr: Set atlas proxy size to draw bounds rather than backing size"
This reverts commit 46d0f9aad1.

Reason for revert: Didn't switch to GrTexture size for clipping ops.

Original change's description:
> ccpr: Set atlas proxy size to draw bounds rather than backing size
> 
> Bug: skia:
> Change-Id: I6605754ecc5377b1c25847fdda478f8246979a2f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209808
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,csmartdalton@google.com

Change-Id: I9ea5f9939e7e7fe498a165a71a71b0a6e28cff6c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210424
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-04-25 17:44:50 +00:00
Robert Phillips
10d172169f Remove GrInternalSurfaceFlags::kNoPendingIO as it is no longer needed
Since explicit allocation is always enabled now, the resource allocator explicitly manages reuse of GrSurfaces and this flag isn't used/needed.

Change-Id: I5703bf4624e21f9aff9da76575f4ef757b1d2589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210140
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-25 13:37:59 +00:00
Chris Dalton
46d0f9aad1 ccpr: Set atlas proxy size to draw bounds rather than backing size
Bug: skia:
Change-Id: I6605754ecc5377b1c25847fdda478f8246979a2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209808
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-25 00:25:04 +00:00
Mike Klein
f0a5369d0c cut SK_SAMPLES_FOR_X, simplify SK_?32_SHIFT
SK_SAMPLES_FOR_X doesn't do anything other than set the SK_?32_SHIFT
macros, so we can just set them instead, and further we can derive
everything we need from SK_R32_SHIFT.

Change-Id: I766d00c868da04939208353d09201f189a99c0c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210121
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-24 20:58:58 +00:00
Mike Klein
b45d86256a flip static initializer default
Disallowing static global initializers is more Skia-user friendly.

Does it make sense to nest these both together under is_skia_dev_build
(built from our GN tree && !is_official_build)?  Seems like maybe we
can also do the Android TODO?

Change-Id: I882f917c1a8156102ecc9cec58d2aba638015b9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210210
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-24 20:15:48 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Hal Canary
0c22997075 SkTInternalLList: remove SkPtrWrapper, SkNoncopyable
Change-Id: I24fb1c38eb4cd9ec27b81a4e0010b1268442a29f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210063
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-04-24 14:34:00 +00:00
Mike Reed
c092f9e3a3 rm older api from colormatrix, change to normalized translate
Bug: skia:4872
Change-Id: I0846a019dd1fd495a20d522d2d82179ad8d61aea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209813
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-24 12:58:01 +00:00
Mike Reed
f07b61f05a (start to) explicitly use float for color values
Bug: skia:9012
Change-Id: I13ef8dea81a9d138b557be53b7adf19285fc9fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209810
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-23 21:06:16 +00:00
Brian Salomon
24d377eedf Store tasks to execute before VK secondary command buffers generically.
Repurpose GrTRecorder for storing these tasks. It's currently unused.
Reimplement on top of SkArenaAlloc and using emplace methods now that we
have C++14.

Currently it stores copy and upload tasks. In the future it will store
transfer-out commands.

Removes the optimization that reset copy-ins on clear/discard. However,
none of our existing tests exercised it.

Change-Id: I0474f77cc2d368461d542de50a7a0c5609312001
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209643
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-04-23 20:43:04 +00:00
Mike Klein
127e519cc4 fix sk_colorspace include guard
Change-Id: Id6db4fd8147ac96d8fecab3b73d50c5098a070f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209897
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-23 20:35:04 +00:00
Mike Klein
dbbefa86bf inject SkUserConfig.h with -DSK_USER_CONFIG_HEADER
This lets clients explicitly declare which SkUserConfig.h
to use, rather than implictly via include directory priority.

See include/gpu/gl/GrGLConfig.h for a similar setup.

Looks like keeping an #else case around is going to be the
easiest way to keep Android building, unless I can find a
way to push -DSK_USER_CONFIG_HEADER up to Skia's reverse
dependencies.

Change-Id: I9c297324cbafbd5f0d1a3dc1c90f0ceae0339e88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209866
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-23 18:59:51 +00:00
Mike Reed
361a640cc9 change colormatrixfilter to be 0...1 for translate
... once I've updated callers of SkColorMatrix, that can be changed to
0...1 as well.

Replacement for https://skia-review.googlesource.com/c/skia/+/209408

Bug: skia: 4872
Change-Id: Ieb0173e7af4c34f6a2c0b90787afb5387c216d68
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209806
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-23 16:51:56 +00:00
Hal Canary
bd5e9505d8 Make default SkUserConfig a noop
Change-Id: Ica7d62c758558c0e2c7bea9da8a08f25d1cfaeed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209805
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-23 16:07:56 +00:00
Robert Phillips
12c4629624 Remove the option of disabling explicit resource allocation
We're burning our boats behind us. Succeed or die trying!

Change-Id: I6a9f71b758a6ae7b090c5221ab12a5ab4d166b47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209647
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-23 12:24:26 +00:00
Brian Osman
c3186302bd Add skcms directory to public includes
skcms is part of Skia's public API now. This attempts to recognize that,
and pave the way for moving the header to another location more easily
in a follow up CL, or - at a minimum - for clients that redistribute
Skia as a library + includes to relocate the skcms.h header as part of
that.

Change-Id: I15da63b0d4ab8916a71fb7e6ab3656db87252707
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209640
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-22 20:32:23 +00:00
Greg Daniel
06be079791 Add wait function on GrContext to wait on semaphores.
This behaves like the SkSurface::wait call but is not tied to a specific
surface.

Change-Id: Ic572296e0f581204bf69a7178645d99e365c0692
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209648
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-04-22 20:28:23 +00:00
Mike Reed
50d79af7b7 hide internals of SkColorMatrix (so we can migrate to col-major)
Change-Id: If0eb6fb2efb6816b92ad7ca7d8caaace71397b7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209409
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-22 19:10:04 +00:00
Mike Klein
86e61993a9 Revert "simplify and centralize SK_API"
This reverts commit 7f960d2083.

Reason for revert: Chrome roll again

Original change's description:
> simplify and centralize SK_API
> 
> Attempt two, this time not setting visibility("default")
> unless SKIA_IMPLEMENTATION is defined.
> 
> Bug: skia:8975
> Change-Id: I8d4e2071f1a8ee8a5702ac62ffc4000379d4fc43
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207854
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,brianosman@google.com,chinmaygarde@google.com

Change-Id: I0f9e6e5da2c17f789a4599042b9ae3a1ba412987
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-22 18:09:45 +00:00
Robert Phillips
5f78adf890 Add explicit GrSurfaceProxy flag to skip explicit resource allocation (take 2)
This approach eliminates a lot of edge cases where ops (e.g., the SmallPathOp) are treating their proxies in a special manner (i.e., just holding a raw ref and never adding pendingIO). Given that the atlas managers are managing the lifetime of the proxies there is no reason for the GrResourceAllocator to be aware of them.

Pulled out of:

https://skia-review.googlesource.com/c/skia/+/208227 (Implement alternate method for determining recycle-ability of allocated GrSurfaces)

Change-Id: I0a8d3c2d56036d568b6d49ddc78c32761642d1c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209419
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-22 18:05:33 +00:00
Mike Klein
7f960d2083 simplify and centralize SK_API
Attempt two, this time not setting visibility("default")
unless SKIA_IMPLEMENTATION is defined.

Bug: skia:8975
Change-Id: I8d4e2071f1a8ee8a5702ac62ffc4000379d4fc43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207854
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-22 16:32:03 +00:00
Greg Daniel
5816b3d45d Fully add back old GrContext flush api.
I left off the optional finished proc on the previous cl :(

Change-Id: I5f540c718bb7e12e7ea74287f1e50e35edd79700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209417
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-04-22 16:19:23 +00:00
Mike Klein
e0eeda5756 add constexpr constructor to SkMatrix
This is an experiment in making SkMatrix less sharp.

Change-Id: Ie1881b0905b594aa1c444440fae5253970850e12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208340
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-22 15:41:29 +00:00
Greg Daniel
d10c90155c Add back deprecated GrCotnext flush API till clients get fixed.
Change-Id: I14b90a9022ebd4d5b3251964af5c7060853c0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209412
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-04-22 14:59:31 +00:00
Brian Osman
cbc33b8e35 Add SkSL viewing/editing to viewer
Still only works with the GL backend. For other backends,
need to add similar logic to the shader caching, and some
extra checks in Viewer to force the SkSL flag on.

But in GL, this lets you toggle the checkbox and see the
SkSL / GLSL at will (and edit in either form).

Change-Id: I6d392113aa9cbcbd6e64589b849de70d0ac3beeb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209165
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-22 13:57:02 +00:00
Mike Klein
6350cb0f4b Revert "Add explicit GrSurfaceProxy flag to skip explicit resource allocation"
This reverts commit 7bb47f2a2e.

Reason for revert: chrome roll maybe

Original change's description:
> Add explicit GrSurfaceProxy flag to skip explicit resource allocation
> 
> This approach eliminates a lot of edge cases where ops (e.g., the SmallPathOp) are treating their proxies in a special manner (i.e., just holding a raw ref and never adding pendingIO). Given that the atlas managers are managing the lifetime of the proxies there is no reason for the GrResourceAllocator to be aware of them.
> 
> Pulled out of:
> 
> https://skia-review.googlesource.com/c/skia/+/208227 (Implement alternate method for determining recycle-ability of allocated GrSurfaces)
> 
> Change-Id: Ia6bec5e8f5d5bc63e86ae011bcc3f8e061c066b2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209400
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Id65bd176f56aa91ff76ec1979aef6206b7665d63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209600
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-22 12:42:31 +00:00
Mike Reed
d567408362 Add secret draw-behind method
This is a variant of drawPaint but is automatically clipped
to the bounds of the most recent saveBehind buffer (axis-aligned bounds).

No public exposure.

Impl is pretty simple (its a variant of drawPaint)
- find the most recent saveBehind device bounds
- if there is none, draw nothing, else
  - temporarily intersect the device's clip with that bounds
  - drawPaint
  - restore the clip

See https://buganizer.corp.google.com/issues/129117085

Change-Id: I7c532e63a80b118fb2416c572b8e0d2abf8cf59a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209166
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-19 20:50:22 +00:00
Robert Phillips
7bb47f2a2e Add explicit GrSurfaceProxy flag to skip explicit resource allocation
This approach eliminates a lot of edge cases where ops (e.g., the SmallPathOp) are treating their proxies in a special manner (i.e., just holding a raw ref and never adding pendingIO). Given that the atlas managers are managing the lifetime of the proxies there is no reason for the GrResourceAllocator to be aware of them.

Pulled out of:

https://skia-review.googlesource.com/c/skia/+/208227 (Implement alternate method for determining recycle-ability of allocated GrSurfaces)

Change-Id: Ia6bec5e8f5d5bc63e86ae011bcc3f8e061c066b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209400
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-19 19:25:02 +00:00
Mike Reed
5000791eeb remove experimental from some APIs (that are no longer experiments)
Change-Id: I614dc116307cbeefb26768e2fff423bb50603eaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209168
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-18 18:18:27 +00:00
Ben Wagner
2c2240f668 Make more SkTypeface virtuals pure.
This ensures that proxy typefaces are really proxying these calls. Also,
sometimes the defaults aren't really the right thing.

Change-Id: Ifac417452136adca8152f4cd7670fd40553bd3b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209105
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-18 15:38:56 +00:00
Heather Miller
a94670bd08 Update Skia milestone to 76
Change-Id: I146f97bd27d17bffd51fc572ecee84552b238e20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209160
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2019-04-18 12:24:23 +00:00
Ben Wagner
14c90c1ca2 Reland "Remove includes from SkFontTypes.h"
This is a reland of cdd5914dc1

Original change's description:
> Remove includes from SkFontTypes.h
> 
> These aren't needed and at least the comment on the one seems out of
> date.
> 
> Change-Id: If76723b7534b338b4d85b84b7c436bf9659a5f15
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208666
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

Change-Id: I862910310b95a0c8c1be5187d0a9d27d02e5a761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209062
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-17 22:07:49 +00:00
Greg Daniel
e6bfb7daf0 Add struct to wrap all the gpu flush options.
Bug: skia:8802
Change-Id: Ia92807034a8f54067cead59e29c233f91e11f175
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208674
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-17 20:03:29 +00:00
Mike Reed
64670cb1b8 Reland "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This is a reland of fde841de44

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I5162c93b3ea6146d09334545744b791d993397b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 17:56:39 +00:00
Robert Phillips
33906ad1e2 Reland "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
This reverts commit 652b007a4c.

Reason for revert: Potentially causing Google3 errors

Original change's description:
> Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
> 
> with legacy guard for google3
> 
> Needs this to land first: https://critique.corp.google.com/#review/243924283
> 
> This reverts commit 70ed05e53a.
> 
> Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Id2b3ed8a6157b5e33721b0c5168c5680bfac15b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208669
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-17 12:03:53 +00:00
Mike Reed
652b007a4c Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
with legacy guard for google3

Needs this to land first: https://critique.corp.google.com/#review/243924283

This reverts commit 70ed05e53a.

Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 03:08:40 +00:00
Mike Reed
70ed05e53a Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This reverts commit fde841de44.

Reason for revert: used in headless on google3, need to add a guard

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,herb@google.com,reed@google.com

Change-Id: I1d28ed5c31deaa76aa3c4b627454b0ad3356a6fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208800
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-17 00:02:12 +00:00
Mike Reed
0b5e302326 Revert "Remove includes from SkFontTypes.h"
This reverts commit cdd5914dc1.

Reason for revert: need to revert so I can revert "Simplify SkTypeface::charsToGlyphs"

Original change's description:
> Remove includes from SkFontTypes.h
> 
> These aren't needed and at least the comment on the one seems out of
> date.
> 
> Change-Id: If76723b7534b338b4d85b84b7c436bf9659a5f15
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208666
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=mtklein@google.com,bungeman@google.com

Change-Id: I84e3eb2f38ecf6b86f39102a3852c65193093b79
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208667
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-17 00:00:54 +00:00
Ben Wagner
cdd5914dc1 Remove includes from SkFontTypes.h
These aren't needed and at least the comment on the one seems out of
date.

Change-Id: If76723b7534b338b4d85b84b7c436bf9659a5f15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208666
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-16 22:22:20 +00:00
Mike Reed
fde841de44 Simplify SkTypeface::charsToGlyphs API to require UTF32 input
Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-04-16 21:34:10 +00:00
Ben Wagner
78e5577492 IWYU for SkCanvas.h
SkCanvas.h has accumulated a need to include a few more headers. Fixing
this allows for easier changes to other files.

Change-Id: I520eecf6c67580cc1201e68e8ffb8f7ee79587d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208665
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-16 21:07:40 +00:00
Ben Wagner
db13d38748 Move SkTLazy.h to src/
It is no longer used in public or private includes or by any users.

Change-Id: Id3803531b411dc7a565b2bb688505eb2c1212cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-16 20:31:20 +00:00
Mike Klein
96e4e53cf1 Reland "align skvx::Vec<N,T> to N*sizeof(T)"
This is a reland of e3b110dc6e

PS1 is the original, so best to diff against that.
This is the original with compiler workarounds.

Original change's description:
> align skvx::Vec<N,T> to N*sizeof(T)
>
> This increases the alignment of these vector types.  I would have liked
> to keep the alignment minimal, but it's probably no big deal either way.
>
> In terms of code generation, it doesn't make much difference for x86 or
> ARMv8, but it seems hugely important for good ARMv7 NEON code.  It's a
> ~10x difference for the bench I've been playing around with that spends
> most of its time in that SkOpts::blit_row_color32 routine.
>
> Bug: chromium:952502
> Change-Id: Ib12caad6b9b3f3f6e821ed70bfb57099db37b15f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208581
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>

Bug: chromium:952502
Cq-Include-Trybots: skia.primary:Test-Win2016-MSVC-GCE-CPU-AVX2-x86-Release-All,Build-Debian9-GCC-mips64el-Debug
Change-Id: Ief99e14ab4de5a56840ed6bb326cf7669c51dc97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208681
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-16 19:48:50 +00:00
Mike Klein
9a885b27f3 pass SkVx::Vec arguments as const&
Yet another surprising finding when looking at ARM code generation is
that passing these values to functions by const& does make a difference,
even when fully inlined.  I can only guess that the compiler's somehow
more sure that way that the values won't change?  Anyway, convert all
skvx functions that take Vec arguments to take const Vec& instead.

This tweak is enough to let the natural implementation of mull()
actually produce good code generation, so I've promoted that to SkVx.h
and added a unit test.  Notice in the NEON case we've got a base case at
N=8 and two recursive cases, one down to 8 as usual when N > 8, but also
one up to 8 when N < 8.

This also is another big speedup for ARMv7 NEON, bringing it to nearly
the same speed as ARMv8 NEON on the same device.

Bug: chromium:952502
Change-Id: I0f19bab45cf02222ccc8090053ea2a4a380f1dfe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208582
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-04-16 19:24:50 +00:00
Mike Klein
50303b9adc Revert "align skvx::Vec<N,T> to N*sizeof(T)"
This reverts commit e3b110dc6e.

Reason for revert: bot failures

Original change's description:
> align skvx::Vec<N,T> to N*sizeof(T)
> 
> This increases the alignment of these vector types.  I would have liked
> to keep the alignment minimal, but it's probably no big deal either way.
> 
> In terms of code generation, it doesn't make much difference for x86 or
> ARMv8, but it seems hugely important for good ARMv7 NEON code.  It's a
> ~10x difference for the bench I've been playing around with that spends
> most of its time in that SkOpts::blit_row_color32 routine.
> 
> Bug: chromium:952502
> Change-Id: Ib12caad6b9b3f3f6e821ed70bfb57099db37b15f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208581
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,michaelludwig@google.com

Change-Id: I72357b9775685efcc2cd75db220711c8145b8ac4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:952502
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-16 18:25:54 +00:00
Mike Klein
e3b110dc6e align skvx::Vec<N,T> to N*sizeof(T)
This increases the alignment of these vector types.  I would have liked
to keep the alignment minimal, but it's probably no big deal either way.

In terms of code generation, it doesn't make much difference for x86 or
ARMv8, but it seems hugely important for good ARMv7 NEON code.  It's a
~10x difference for the bench I've been playing around with that spends
most of its time in that SkOpts::blit_row_color32 routine.

Bug: chromium:952502
Change-Id: Ib12caad6b9b3f3f6e821ed70bfb57099db37b15f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208581
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-16 17:59:22 +00:00