Commit Graph

9491 Commits

Author SHA1 Message Date
Mike Klein
046ecb1b5e remove SkMiniPicture and co.
This was an optimization for Chromium that I believe is no longer
relevant in a world of PaintOpBuffers.

Change-Id: Ic7526715a0ef1c3cec387a44189b7d56d5107af5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213680
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-14 19:19:44 +00:00
Chris Dalton
7b2c85577d Clear and discard stencil buffers on tilers
Bug: skia:
Change-Id: I42e99cb75567825ac7751fc0ec56e4c45132628b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210425
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-05-14 18:47:44 +00:00
Herb Derby
8fae51b699 Introduce SkStrikeSpecStorage.
SkStrikeSpecStorage is the centralized class for creating different sets of
SkScalerContextRecs/Effects for different text rendering methods.

It is initailly called SkStrikeSpecStorage, but as a last stage will be
renamed to SkStrikeSpec as it encompasses the current functionality of
the existing SkStrikeSpec.

I'm breaking up a much larger prototype for this CL and several
following CLs. The prototype is at:

https://skia-review.googlesource.com/c/skia/+/209109

Change-Id: I617eaae6fcb4b0b29914c3f1a82c52c81d81aabe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212733
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-13 21:01:47 +00:00
Herb Derby
9b86955c65 Add thread safety annotations for SkMutex
Introduce SkAutoMutexExclusive for SkMutex RAII.

Unsubclass SkMutex from SkBaseMutex to allow annotations
for class field mutexes separate from global mutexes.

Leave SkAutoMutexAcquire for handling global mutexes using
SkBaseMutex.

Test using GrSingleOwner.h.

Change-Id: I19d9d0ae0d05206cbb6ef137dc362969048c9c07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213136
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-05-13 15:44:33 +00:00
Robert Phillips
9dbcdcc8ba Alter createTestingOnlyBackendTexture methods
This intended to bring this API more into line with the proposed GrBackendObject API with an eye towards replacing the former with the latter.

TBR=bsalomon@google.com
Change-Id: I4367f03fb10fff788749f21c4843060111a6df1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-13 15:39:33 +00:00
Mike Reed
617d801ff7 Reland "Reland "remove legacy 255-biased colormatrix""
This reverts commit 7cf4242f8a.

Reason for revert: flutter in google3 updated

Original change's description:
> Revert "Reland "remove legacy 255-biased colormatrix""
> 
> This reverts commit b75be23bc4.
> 
> Reason for revert: Flutter also appears to be using this
> 
> third_party/flutter_engine/lib/ui/painting/paint.cc:95:32: error: no member named 'MatrixRowMajor255' in 'SkColorFilters'
>         return SkColorFilters::MatrixRowMajor255(decoded.data());
> 
> Original change's description:
> > Reland "remove legacy 255-biased colormatrix"
> > 
> > This reverts commit 34d286a6d7.
> > 
> > Reason for revert: google3 sites updated (hopefully)
> > 
> > Original change's description:
> > > Revert "remove legacy 255-biased colormatrix"
> > > 
> > > This reverts commit ec654f7397.
> > > 
> > > Reason for revert: Seems to be breaking the Google3 roll
> > > 
> > > Original change's description:
> > > > remove legacy 255-biased colormatrix
> > > > 
> > > > Bug: skia:4872
> > > > Bug: skia:9012
> > > > 
> > > > Change-Id: I7c1ac4e94405404fcb13079b5b578a5a26aad02e
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210628
> > > > Reviewed-by: Mike Reed <reed@google.com>
> > > > Commit-Queue: Mike Reed <reed@google.com>
> > > > Auto-Submit: Mike Reed <reed@google.com>
> > > 
> > > TBR=reed@google.com
> > > 
> > > Change-Id: Ib51de4f5a3f5d28b4870ca61fff43cce96e7426f
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:4872, skia:9012
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211587
> > > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> > TBR=robertphillips@google.com,reed@google.com
> > 
> > Change-Id: I60e966eb05a092c2b590f819db5bacc1fe6db5db
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:4872, skia:9012
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211643
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=robertphillips@google.com,reed@google.com
> 
> Change-Id: I6f0852e6c6c7d7dc38e51112d9e01cd302447772
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:4872, skia:9012
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211655
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

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

Bug: skia:4872, skia:9012
Change-Id: Ife10b97b48cc6ab214a1bdeb0c990f629f5c3bc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213420
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-05-13 12:57:41 +00:00
Brian Salomon
ab32f65653 Add SkSurface::asyncReadPixels()
Initial version. Current limitations: No Metal support, no color space
conversions, for each src color type only one dst color type is legal (
which may or may not be the src color type), no alpha type conversions.

Bug: skia:8962

Change-Id: I6f046a32342b8f5ffb1799d67d7ba15c250ef9bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212981
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-05-10 19:13:07 +00:00
Herb Derby
a1b7be612c Add thread safety annotations.
Start out with spinlock. I tried to be more extensive, but some
of our abstractions confused the analysis. Will expand further
in following CLs.

Change-Id: I3e320c957d8ef427065a2b7e7d2187b7c6b0aef1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213060
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-05-10 13:40:38 +00:00
Greg Daniel
797efcac71 Add option to GrContext::flush for GrPrepareForExternalIORequests.
This will allow clients to specify a set of SkImages and SkSurfaces that they
want transitioned to a state which they can use for their own external IO.
Specifically for Vulkan this will move the surface and images back to the queues
in which they were originally wrapped or created with.

Bug: skia:8802
Change-Id: I6a76c4c4a333a8e752632d349899f5fd9921329d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210460
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-09 18:50:06 +00:00
Brian Salomon
f9a1fdf01f Reland "Add flush() to SkImage."
This reverts commit 693bc2bae5.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Add flush() to SkImage."
>
> This reverts commit d0503a72ac.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Add flush() to SkImage.
> >
> > This allows a client to ensure all uses of a texture-backed image have
> > been flushed.
> >
> > Does nothing if the image isn't texture-backed.
> >
> > The implementation adds support for triggering a flush if any of a set
> > of proxies are used rather than just a single proxy.
> >
> > Change-Id: I358882d9737e63c6e69b924c0767f49b8f8f36ec
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212405
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Ie376bf4225307f45b8fb3eb4a63bf84702365797
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212884
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Idcba378ce2e3af0af9d0eef35737670055539ec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212960
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-09 15:07:51 +00:00
Brian Salomon
693bc2bae5 Revert "Add flush() to SkImage."
This reverts commit d0503a72ac.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add flush() to SkImage.
> 
> This allows a client to ensure all uses of a texture-backed image have
> been flushed.
> 
> Does nothing if the image isn't texture-backed.
> 
> The implementation adds support for triggering a flush if any of a set
> of proxies are used rather than just a single proxy.
> 
> Change-Id: I358882d9737e63c6e69b924c0767f49b8f8f36ec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212405
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ie376bf4225307f45b8fb3eb4a63bf84702365797
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212884
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-09 13:48:08 +00:00
Brian Salomon
d0503a72ac Add flush() to SkImage.
This allows a client to ensure all uses of a texture-backed image have
been flushed.

Does nothing if the image isn't texture-backed.

The implementation adds support for triggering a flush if any of a set
of proxies are used rather than just a single proxy.

Change-Id: I358882d9737e63c6e69b924c0767f49b8f8f36ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212405
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-09 13:36:07 +00:00
Ben Wagner
51e15a69ce Use SkTextEncoding enum instead of macros.
Change-Id: I4b6259590fa0693ee0522b4999a1c0fe250b173d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212504
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-07 20:54:16 +00:00
Ben Wagner
07dad1bc42 Fix some documentation for SkFont.
In particular, linear metrics now means 'linearly scalable metrics' as
expected. This also makes the documentation for the setter and getter
for subpixel positioning agree.

Change-Id: I08f5009f32516a0fdaecefc1d7dbe5f43c005a69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212406
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-07 16:54:10 +00:00
Brian Salomon
b0d8b76c4f Make finish flush procs work with GL.
This will be required for async readback support.

This is implemented using sync objects when available and otherwise
calls glFinish.

Relaxes the unit test requirement that providing a callback with no
work to flush always calls the proc immediately.

Bug: skia:8962
Change-Id: Ieefcab6dccc3924e50260343f01904e7303bb12b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212198
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-07 10:35:38 +00:00
Kevin Lubick
d6b32ed39d [img-decode] Start on proposed new spec
This adds readPixel and a partial stub of window.createImageData

Change-Id: Iee992312b9331b71852fe2198f844a7e4ae9e963
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211344
Reviewed-by: Mike Reed <reed@google.com>
2019-05-06 17:39:19 +00:00
Brian Osman
5e7fbfd9b0 Add ShaderErrorHandler to GrContextOptions
Allows clients to customize behavior when shaders fail to compile.
Added nicer shader error handling to viewer.

Change-Id: If82b48e40d64fd786f37e88c564fd623b53c7f9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211361
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-06 16:29:13 +00:00
Hal Canary
c2f260ad78 SkColors: Fix new color constants
Change-Id: I4ed40624f64aada1163585aa2a8bd0b643b2ccec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211992
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-05-03 16:50:46 +00:00
Ben Wagner
0b9b1f1847 IWYU for SkTLogic.h
Noticed that there was an include for <array> in there that didn't make
a lot of sense, so cleaned up the others which are hanging around from
older code which was in there.

Change-Id: I77acbb0914989e9bf67ab74dfd842a798ea592f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206172
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-02 21:17:37 +00:00
skia-autoroll
752b740ed6 Roll skia/third_party/skcms 668026c511f3..853f66269c16 (2 commits)
https://skia.googlesource.com/skcms.git/+log/668026c511f3..853f66269c16

2019-05-02 brianosman@google.com Remove headers from gni source lists
2019-05-02 brianosman@google.com Remove non-explicit endian 16-bit pixel format aliases


The AutoRoll server is located here: https://autoroll.skia.org/r/skcms-skia-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel
TBR=ethannicholas@google.com,mtklein@google.com

Change-Id: I06c0b83cfa584618dafc270f14fdcf8460d87b91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211840
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-05-02 20:33:17 +00:00
Hal Canary
0a7b393e32 SkPaint: new constructor
Change-Id: I5033070bf5d52571869a687387b4f4fc6dddfdd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211597
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-05-02 19:52:07 +00:00
Mike Reed
68eb8c2763 remove deprecated postTranslate255
Change-Id: Id2bdf73b5111c34f0ed1f36da85548a942568dcb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211595
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-05-02 17:28:53 +00:00
Robert Phillips
7cf4242f8a Revert "Reland "remove legacy 255-biased colormatrix""
This reverts commit b75be23bc4.

Reason for revert: Flutter also appears to be using this

third_party/flutter_engine/lib/ui/painting/paint.cc:95:32: error: no member named 'MatrixRowMajor255' in 'SkColorFilters'
        return SkColorFilters::MatrixRowMajor255(decoded.data());

Original change's description:
> Reland "remove legacy 255-biased colormatrix"
> 
> This reverts commit 34d286a6d7.
> 
> Reason for revert: google3 sites updated (hopefully)
> 
> Original change's description:
> > Revert "remove legacy 255-biased colormatrix"
> > 
> > This reverts commit ec654f7397.
> > 
> > Reason for revert: Seems to be breaking the Google3 roll
> > 
> > Original change's description:
> > > remove legacy 255-biased colormatrix
> > > 
> > > Bug: skia:4872
> > > Bug: skia:9012
> > > 
> > > Change-Id: I7c1ac4e94405404fcb13079b5b578a5a26aad02e
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210628
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Mike Reed <reed@google.com>
> > > Auto-Submit: Mike Reed <reed@google.com>
> > 
> > TBR=reed@google.com
> > 
> > Change-Id: Ib51de4f5a3f5d28b4870ca61fff43cce96e7426f
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:4872, skia:9012
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211587
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=robertphillips@google.com,reed@google.com
> 
> Change-Id: I60e966eb05a092c2b590f819db5bacc1fe6db5db
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:4872, skia:9012
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211643
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I6f0852e6c6c7d7dc38e51112d9e01cd302447772
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4872, skia:9012
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211655
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-01 22:29:01 +00:00
Brian Osman
8518f2e56a Add an AssertOnShaderCompileFailure GrContextOption
Part of a multi-step plan:

1) Add this option (which is *not* GL specific).
2) Disable this in Chromium at context-creation.
3) Finish adding the shader error handler, with default
   behavior controlled via this flag, and remove Chromium
   driver checks from the corresponding code at the same time.

Change-Id: I7e50c8404a05c1f291f187cf48481d0cbb34066a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211646
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-01 18:48:44 +00:00
Mike Reed
b75be23bc4 Reland "remove legacy 255-biased colormatrix"
This reverts commit 34d286a6d7.

Reason for revert: google3 sites updated (hopefully)

Original change's description:
> Revert "remove legacy 255-biased colormatrix"
> 
> This reverts commit ec654f7397.
> 
> Reason for revert: Seems to be breaking the Google3 roll
> 
> Original change's description:
> > remove legacy 255-biased colormatrix
> > 
> > Bug: skia:4872
> > Bug: skia:9012
> > 
> > Change-Id: I7c1ac4e94405404fcb13079b5b578a5a26aad02e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210628
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> > Auto-Submit: Mike Reed <reed@google.com>
> 
> TBR=reed@google.com
> 
> Change-Id: Ib51de4f5a3f5d28b4870ca61fff43cce96e7426f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:4872, skia:9012
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211587
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I60e966eb05a092c2b590f819db5bacc1fe6db5db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4872, skia:9012
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211643
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-05-01 17:46:14 +00:00
Robert Phillips
6db27c28c6 Reduce opList splitting by default in Skia
Local Skia and DDL recording will always attempt to reduce opList splitting.
Android, Flutter, Google3 and non-DDL Chrome will not.

Note that this is a bit aggressive. Intermediate flushes based on memory usage have not yet been implemented.

The plan is to run this locally in Skia until the next Chrome branch and then enable it everywhere else (when intermediate flushes have been implemented).

OpList splitting reduction in Chrome is disabled in the following Chrome-side CL:

https://chromium-review.googlesource.com/c/chromium/src/+/1588756/ (Disable opList splitting reduction in Skia)

It is disabled in Android in:

https://googleplex-android-review.git.corp.google.com/c/platform/external/skia/+/7259923 (Update #defines to suppress Ganesh features in SkUserConfigManual.h)

It is disabled in Flutter and Google3 w/in this CL.

Change-Id: I59ff448d2c42629fab6cffccb2894d030c73431d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211101
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-05-01 15:24:08 +00:00
Robert Phillips
34d286a6d7 Revert "remove legacy 255-biased colormatrix"
This reverts commit ec654f7397.

Reason for revert: Seems to be breaking the Google3 roll

Original change's description:
> remove legacy 255-biased colormatrix
> 
> Bug: skia:4872
> Bug: skia:9012
> 
> Change-Id: I7c1ac4e94405404fcb13079b5b578a5a26aad02e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210628
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ib51de4f5a3f5d28b4870ca61fff43cce96e7426f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4872, skia:9012
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211587
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-01 15:20:49 +00:00
Mike Reed
ec654f7397 remove legacy 255-biased colormatrix
Bug: skia:4872
Bug: skia:9012

Change-Id: I7c1ac4e94405404fcb13079b5b578a5a26aad02e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210628
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-05-01 13:50:48 +00:00
Mike Klein
159a959596 Revert "Temporarily revert runtime decoder registration."
This reverts commit bcbf9633db.

Next patch set implements a local shared spinlock
rather than depending on SkSharedMutex.

Next patch removes the thread safety and the unit test.

Original change's description:
> 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>

Change-Id: I6df8e2dfb64a92c780b62acddf7a797f24ba8e31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210792
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-30 17:34:12 +00:00
Chris Dalton
f91b755b34 Reland "ccpr: Set atlas proxy size to draw bounds rather than backing size"
This is a reland of 46d0f9aad1

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>

Bug: skia:
Change-Id: Ic13317fd021843961989a79050735c225702ad45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211181
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-29 23:32:34 +00:00
Brian Osman
3d47f37cb5 Add skcms' LICENSE to include/third_party/skcms
Bug: skia:9031
Change-Id: I3b6fb817a63040911fe43378410f3baa7366e90e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211102
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-29 18:45:46 +00:00
Brian Osman
ea236bf818 Move skcms.h to include/third_party/skcms
Add a shim to redirect until clients are updated

Change-Id: Ib43614e5620b1a24ca18187c1646a8ed1a9ee7a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211003
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-29 15:02:45 +00:00
Robert Phillips
d425dee662 Enable opList sorting everywhere
This should have very little impact until we enable opList-splitting-reduction.

Change-Id: Iacc3d1b34c390b65b5ee185bcbdd118d5023aaa7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210630
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-29 14:00:46 +00:00
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