Commit Graph

851 Commits

Author SHA1 Message Date
Mike Reed
60691a5127 add serial procs to pictures
Bug: skia:7380
Change-Id: Ic1b7e437316c7913711cf5cb119e3fe904cd2c05
Reviewed-on: https://skia-review.googlesource.com/76980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-05 20:33:18 +00:00
Leon Scroggins III
c8037dc5ed Reland "Hide SkEncodedInfo"
This partially reverts commit
1793e7bb46.

Hide SkEncodedInfo

Bug: skia:7353
Bug: skia:6839

This contains information that is not necessary for clients to know. The
Color enum tells the number of components in the input, but this is only
interesting internally (to the SkSwizzler).

Similarly, the Alpha enum differs from SkAlphaType in that it has
kBinary instead of kPremul. This is useful information only internally
for determining whether the SkColorSpaceXform needs to premultiply.

The bitsPerComponent is potentially useful for a client; Android (in
SkAndroidCodec) uses it to determine the SkColorType. Rather than
exposing bitsPerComponent, make SkAndroidCodec a friend so it can
access the SkEncodedInfo. A future change will change SkCodec to
recommend F16 for bitsPerComponent > 8, but that will be more involved;
it was the reason for the revert of this CL.

Switch conversionSupported to use an SkColorType, which is enough info.

Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
SkAlphaType.

SkCodec still needs an SkEncodedInfo, so move its header (which is
already not SK_API) to include/private.

TBR=mtklein@chromium.org,reed@google.com
Change-Id: I928b1f55317602cb37d29da63b53026c8d139cee
Reviewed-on: https://skia-review.googlesource.com/80860
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 19:28:08 +00:00
Chris Dalton
a32a3c32c3 Add analytic clip FPs that read from the CCPR atlas
Bug: skia:7190
Change-Id: Ie31d368f52910e6917efdeb1b024370b06fc11ee
Reviewed-on: https://skia-review.googlesource.com/77160
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-12-05 18:06:18 +00:00
Mike Klein
f32b27d2e4 remove mips support and bots
The NDK has deprecated mips and mips64:
https://developer.android.com/ndk/guides/abis.html

Might as well clean this up now while I remember.

Change-Id: Ie4b2334c75208082067cc16fe355d0349c7e0904
Reviewed-on: https://skia-review.googlesource.com/80560
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2017-12-05 17:19:45 +00:00
Leon Scroggins
1793e7bb46 Revert "Hide SkEncodedInfo"
This reverts commit c6f7a4ffa9.

Reason for revert: Causing differences in Gold, stemming from the fact that this changes the recommended SkImageInfo for 16 bits-per-component PNG from N32 to F16.
- an F16 bitmap already png-encodes to a 16 bits-per-component PNG, but it does not encode a linear colorspace (possibly a bug?). when we decode this PNG using getInfo(), it fails because it has an F16 color type and non-linear colorspace. (In the encode-srgb-png gm, this results in blank results for F16.) We could correct this on the encoder side, but it seems possible that a 16 bits-per-component PNG could be encoded with a different color space. In that case, we'd want SkCodec to recommend F16/SRGBLinear, but I think we'd want the SkCodec to store the encoded SkColorSpace so that we can Xform between the two. Currently SkCodec only stores one color space, so that will require a refactor.
- When decoding 16-bits-per-component PNGs, we are now decoding them to F16. This shows differences in Gold. The srgb/gpu results now look more like F16. I think this is fine.

Original change's description:
> Hide SkEncodedInfo
> 
> Bug: skia:7353
> Bug: skia:6839
> 
> This contains information that is not necessary for clients to know. The
> Color enum tells the number of components in the input, but this is only
> interesting internally (to the SkSwizzler).
> 
> Similarly, the Alpha enum differs from SkAlphaType in that it has
> kBinary instead of kPremul. This is useful information only internally
> for determining whether the SkColorSpaceXform needs to premultiply.
> 
> The bitsPerComponent is potentially useful for a client; Android (in
> SkAndroidCodec) uses it to determine the SkColorType. Rather than
> exposing bitsPerComponent, use it to make the same decision that Android
> would have made - 16 bits per component means to set the info to F16. Add
> a test that computeOutputColorType behaves as expected.
> 
> Switch conversionSupported to use an SkColorType, which is enough info.
> 
> Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
> SkAlphaType.
> 
> SkCodec still needs an SkEncodedInfo, so move its header (which is
> already not SK_API) to include/private.
> 
> Change-Id: Ie2cf11339bf999ebfd4390c0f448f7edd6feabda
> Reviewed-on: https://skia-review.googlesource.com/79260
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=mtklein@chromium.org,scroggo@google.com,reed@google.com

Change-Id: I0c5dd1461e1b70d1e55349a8e7ee6b029c3f556e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7353, skia:6839
Reviewed-on: https://skia-review.googlesource.com/80660
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 15:38:22 +00:00
Leon Scroggins III
c6f7a4ffa9 Hide SkEncodedInfo
Bug: skia:7353
Bug: skia:6839

This contains information that is not necessary for clients to know. The
Color enum tells the number of components in the input, but this is only
interesting internally (to the SkSwizzler).

Similarly, the Alpha enum differs from SkAlphaType in that it has
kBinary instead of kPremul. This is useful information only internally
for determining whether the SkColorSpaceXform needs to premultiply.

The bitsPerComponent is potentially useful for a client; Android (in
SkAndroidCodec) uses it to determine the SkColorType. Rather than
exposing bitsPerComponent, use it to make the same decision that Android
would have made - 16 bits per component means to set the info to F16. Add
a test that computeOutputColorType behaves as expected.

Switch conversionSupported to use an SkColorType, which is enough info.

Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
SkAlphaType.

SkCodec still needs an SkEncodedInfo, so move its header (which is
already not SK_API) to include/private.

Change-Id: Ie2cf11339bf999ebfd4390c0f448f7edd6feabda
Reviewed-on: https://skia-review.googlesource.com/79260
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 00:52:42 +00:00
Chris Dalton
d1ec4105f7 Fix ANGLE build with extended clang warnings
Add newline-eof to the list of ignroed warnings.
Fix shadowed fields.

Bug: skia:
Change-Id: I4985ce2495194a7f805af98c4f42c44691086e36
Reviewed-on: https://skia-review.googlesource.com/79681
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-04 20:54:40 +00:00
Chris Dalton
1ef80942b3 turn on extended Clang warnings on Windows too
Plus some small rearrangements of the various warning lists.

Change-Id: Ied58f940341d69ddab971a529fd01b1e96b65641
Reviewed-on: https://skia-review.googlesource.com/67720
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-04 19:29:51 +00:00
Robert Phillips
7ffbcf909d Add unit test for SkDeferredDisplayLists (take 2)
Change-Id: I76a4c77d5b9418cb7fe677bd55ba32a2e336924d
Reviewed-on: https://skia-review.googlesource.com/79820
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 18:37:29 +00:00
Ben Wagner
bee6cacc54 Merge UBSAN_float_cast_overflow into ASAN.
The new check was a different config while we fixed the errors. Most
errors are now fixed, and merging these will help with running both on
the CQ.

No-Try: true
Change-Id: I5804ecea84a8dbbaacf6a4ea96e2af9505641d49
Reviewed-on: https://skia-review.googlesource.com/79323
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-04 17:08:09 +00:00
Robert Phillips
8172c0a24a Revert "Add unit test for SkDeferredDisplayLists"
This reverts commit 8458a2807b.

Reason for revert: ??
Original change's description:
> Add unit test for SkDeferredDisplayLists
> 
> Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28
> Reviewed-on: https://skia-review.googlesource.com/78660
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Iec3abb18d3ed41fcfbec72bc2de14603f659f8ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/79720
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 14:38:15 +00:00
Robert Phillips
8458a2807b Add unit test for SkDeferredDisplayLists
Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28
Reviewed-on: https://skia-review.googlesource.com/78660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 14:00:14 +00:00
Brian Salomon
6574921253 Revert "Revert "Fix rendering of drrects with small circular inner rrects.""
This reverts commit ec727c981d.

Change-Id: Id3164619016d58b2bcc0b8af606215653f553fce
Reviewed-on: https://skia-review.googlesource.com/79422
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-01 21:25:39 +00:00
Brian Salomon
ec727c981d Revert "Fix rendering of drrects with small circular inner rrects."
This reverts commit 096074af2c.

Reason for revert: failing processor validation test

Original change's description:
> Fix rendering of drrects with small circular inner rrects.
> 
> Previously when the inner rrect was a circle with a radius of 1 we would
> cause a inf * 0 in the shader which would lead to the shape not rendering.
> 
> This change also makes concentric circle drrects draw as stroked circles.
> 
> bug: chromium:789262
> 
> Change-Id: I6efbe3fdde25d6c4e031c7412d83df009afe014a
> Reviewed-on: https://skia-review.googlesource.com/79141
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ie9b9c81380c0f98a6fc6c6dc350ec56402c4ff2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/79264
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-01 20:53:10 +00:00
Brian Salomon
096074af2c Fix rendering of drrects with small circular inner rrects.
Previously when the inner rrect was a circle with a radius of 1 we would
cause a inf * 0 in the shader which would lead to the shape not rendering.

This change also makes concentric circle drrects draw as stroked circles.

bug: chromium:789262

Change-Id: I6efbe3fdde25d6c4e031c7412d83df009afe014a
Reviewed-on: https://skia-review.googlesource.com/79141
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-12-01 20:00:09 +00:00
Yuqian Li
9b50d9dd2b Try to bypass the false-positive clang thread analysis warning
This is identical to 70221 except for 3 lines inside SkFlexibleTaskGroup2D::work
to bypass the false-positive warning. We cannot reproduce the error the android
roller generated so we'll have to try and see.

The detailed warning can be found in:
https://skia-review.googlesource.com/c/skia/+/78720

TBR: mtklein@google.com
Bug: skia:
Change-Id: I3e2f414581dbd1398482cf45cf4f43eaf0535651
Reviewed-on: https://skia-review.googlesource.com/79321
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2017-12-01 19:39:51 +00:00
Leon Scroggins III
6d892f58bf Add comments explaining use of "-Wno-over-aligned"
Follow up to I04a5b013dd0ec8f162046388e89cf08cb9476bab

Change-Id: I5ab77564fe867ad1fef48fb322ff75869c025776
Reviewed-on: https://skia-review.googlesource.com/79040
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-01 15:14:19 +00:00
Leon Scroggins
8a90c4da1c Revert "Renaming and refactoring to prepare for init-once threaded backend"
This reverts commit 07a42411f8.

Reason for revert: This looks to be breaking the Android roll. See https://googleplex-android-review.googlesource.com/c/platform/external/skia/+/3295488

external/skia/src/core/SkTaskGroup2D.cpp:73:28: error: releasing mutex 'rowData.fMutex' that was not held [-Werror,-Wthread-safety-analysis]
            rowData.fMutex.unlock();


Original change's description:
> Renaming and refactoring to prepare for init-once threaded backend
> 
> Bug: skia:
> Change-Id: I39b1d73b612a9c133847dd7361d634a0351659f1
> Reviewed-on: https://skia-review.googlesource.com/70221
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>

TBR=mtklein@google.com,herb@google.com,liyuqian@google.com

Change-Id: I701e6c62f6f437a6a285953b45b2e58cf7f0b6e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/78720
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-11-30 21:27:59 +00:00
Leon Scroggins III
74663e722e Add "-Wno-over-aligned" to Android.bp for x86 Android
Speculative fix for Android roll, broken here: ag/3293969.

We used to make an exception for this warning on Skia builds, until I
disabled it in https://skia-review.googlesource.com/c/skia/+/60530,
because it no longer seemed necessary: Turning on most warnings without
this exception in Android framework builds, as I did in
https://skia-review.googlesource.com/55703 did not break Android.

I'm not sure why Skia's waterfall did not show the problem, but this
should fix it on the Android framework side.

TBR=mtklein@chromium.org

Change-Id: I04a5b013dd0ec8f162046388e89cf08cb9476bab
Reviewed-on: https://skia-review.googlesource.com/78580
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-11-30 20:08:38 +00:00
Yuqian Li
07a42411f8 Renaming and refactoring to prepare for init-once threaded backend
Bug: skia:
Change-Id: I39b1d73b612a9c133847dd7361d634a0351659f1
Reviewed-on: https://skia-review.googlesource.com/70221
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-11-30 19:35:08 +00:00
Chris Dalton
706a6ff60c Add "lazy" texture proxies
Adds ultra-deferred proxies that are instantiated by a user-supplied
callback during flush.

Bug: skia:7190
Change-Id: I75a7ac6dba953c3b0a99febc203a7f4d2f3789fc
Reviewed-on: https://skia-review.googlesource.com/76461
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-30 15:37:12 +00:00
Brian Osman
ede860e91c Delete even more unused views code
Bug: skia:
Change-Id: I41480aa89dfcd8cb7e016e477cbabe354f35ce8a
Reviewed-on: https://skia-review.googlesource.com/75480
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-29 18:12:35 +00:00
Jim Van Verth
329c5a6d82 Bundle resources and skps directories into iOS app.
Will bundle resources/ for viewer (and skps/ if
that directory exists in the main Skia directory).
Also updates file code on iOS to fall back to bundle directory.

Docs-Preview: https://skia.org/?cl=76803
Bug: skia:7339
Change-Id: I244f67559c866451a6d02c3f1c4948d89457ec84
Reviewed-on: https://skia-review.googlesource.com/76803
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-11-29 17:06:25 +00:00
Brian Salomon
29f9ed4dcc Revert "Revert "Make PathGeoBuilder use consistent iterators.""
This reverts commit b451321324.

Bug: chromium:788500
Change-Id: I6028b20770009b703f76ce2d9b451c561eaa705a
Reviewed-on: https://skia-review.googlesource.com/77582
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-29 16:18:45 +00:00
Brian Salomon
b451321324 Revert "Make PathGeoBuilder use consistent iterators."
This reverts commit 9c8a16bb1e.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Make PathGeoBuilder use consistent iterators.
> 
> Previously it used a degenerate consuming iterator to determine the whether there were multiple contours. This was inconsistent with the tessellating step.
> 
> Bug: chromium:788500
> Change-Id: I3938c69cf40bc551acdb8d5fa9b54d2c96e2a460
> Reviewed-on: https://skia-review.googlesource.com/76961
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I18005ea2d7ba88c66334f110a5a74c6d82e4ab90
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:788500
Reviewed-on: https://skia-review.googlesource.com/77440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-29 13:30:06 +00:00
Brian Salomon
9c8a16bb1e Make PathGeoBuilder use consistent iterators.
Previously it used a degenerate consuming iterator to determine the whether there were multiple contours. This was inconsistent with the tessellating step.

Bug: chromium:788500
Change-Id: I3938c69cf40bc551acdb8d5fa9b54d2c96e2a460
Reviewed-on: https://skia-review.googlesource.com/76961
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-29 13:07:28 +00:00
Hal Canary
9b491b23bb SkPDF: fix fTextScaleX error
BUG=skia:7315
Change-Id: Ic613cb6fb8faed5b0840db4f500940bd6823de66
Reviewed-on: https://skia-review.googlesource.com/76981
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-11-28 20:48:37 +00:00
Mike Klein
9c1c892af7 drop 32-bit Android NDK builds down to API 16
Change-Id: I40ded57601da605a1393ce56589455909f66ad00
Reviewed-on: https://skia-review.googlesource.com/77020
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-28 20:36:38 +00:00
Jim Van Verth
443a913b8f Add create_bundle support for GN
Docs-Preview: https://skia.org/?cl=75383
Bug: skia:7339
Change-Id: I985734e8b7b5af21a82cb8ee59acbfb5ff1d3ff7
Reviewed-on: https://skia-review.googlesource.com/75383
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-11-28 15:29:07 +00:00
Mike Klein
aa73b96760 clean up SkDeferredCanvas
To our knowledge it's not used.
Its defer- mode in DM isn't even run on the bots.

Change-Id: Ifebfa2a77bfed8370eb421d379697f04fa2c8608
Reviewed-on: https://skia-review.googlesource.com/76420
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-27 21:31:26 +00:00
Mike Klein
c9bc81434a Handle null colorspace in SkToSRGBColorFilter.
This was uncovered by the linked fuzzer issue.

I haven't looked hard at it, but I'd guess it's fuzzed an ICC profile
into one that can't be deserialized, and we get a null in CreateProc().

We could probably restrict the null check to just CreateProc(), but
putting it in Make() and asserting in the constructor feels cozy.

BUG=chromium:787718

Change-Id: Ic4b1dad28c00ee5870f22093eedbf34686c32120
Reviewed-on: https://skia-review.googlesource.com/76080
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-11-27 18:00:56 +00:00
Hal Canary
dfaa057c15 SkPDF: less tolerance for small circles
BUG=chromium:772953
Change-Id: I9452ac8ad66ab8be26a9388f8c85a1f0e61bd392
Reviewed-on: https://skia-review.googlesource.com/75960
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-11-27 14:59:45 +00:00
Jim Van Verth
c02cb8a86c Revert "Use int when possible to calculate atlas indices in shaders."
This reverts commit 999ec57291.

Reason for revert: Causing issues with NexusPlayer Vulkan.

Original change's description:
> Use int when possible to calculate atlas indices in shaders.
> 
> On certain iOS devices half has a mantissa of only 10 bits, which is not
> enough to perform the floating point trickery to get the lower bits
> out of the "texture coordinates". Instead we use int if available, and
> float if not available.
> 
> Also re-enables multitexturing for iOS and adds a sample which
> stresses the issue.
> 
> Bug: skia:7285
> Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
> Reviewed-on: https://skia-review.googlesource.com/71181
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I82801a73a2a8067588049b213f010ff25f4014f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7285
Reviewed-on: https://skia-review.googlesource.com/74001
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-11-20 22:11:39 +00:00
Ethan Nicholas
e9d172af84 converted ConstColorProcessor to SkSL
Bug: skia:
Change-Id: Ic3b18f82c1ab940637fb26dec1cf376dd859b35d
Reviewed-on: https://skia-review.googlesource.com/73720
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-20 20:34:38 +00:00
Jim Van Verth
999ec57291 Use int when possible to calculate atlas indices in shaders.
On certain iOS devices half has a mantissa of only 10 bits, which is not
enough to perform the floating point trickery to get the lower bits
out of the "texture coordinates". Instead we use int if available, and
float if not available.

Also re-enables multitexturing for iOS and adds a sample which
stresses the issue.

Bug: skia:7285
Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
Reviewed-on: https://skia-review.googlesource.com/71181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-11-20 18:07:08 +00:00
Brian Salomon
cbcb0a12ad Revert "Revert "Add Atlas Text interface for rendering SDF glyphs.""
This reverts commit 9c2202ffc2.

Bug: skia:
Change-Id: I482ddf74f8e40d3d0908c840ba5c6ff981ccefbd
Reviewed-on: https://skia-review.googlesource.com/73345
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-19 18:55:18 +00:00
Greg Daniel
9c2202ffc2 Revert "Add Atlas Text interface for rendering SDF glyphs."
This reverts commit 39631f3df1.

Reason for revert: break google3 rool

Original change's description:
> Add Atlas Text interface for rendering SDF glyphs.
> 
> This new API is built upon SDF text atlas code from the GPU backend. Unlike using the GPU
> backend to draw text, this set of interfaces allows the client to render the SDF glyphs. The
> client issues text draws to potentially multiple targets and then the client flushes. The
> client then gets commands from Skia with data to put into a texture atlas and vertices to
> draw that reference the texture. The client is responsible for creating the texture, uploading
> the SDF data to the texture, and drawing the vertices provided by Skia.
> 
> Change-Id: Ie9447e19b85f0ce1c2b942e5216c787a74f335d3
> Reviewed-on: https://skia-review.googlesource.com/59360
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I4aad0c99e645b476fd8ba25731f2a10e8802bb25
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/73420
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-18 13:32:08 +00:00
Brian Salomon
39631f3df1 Add Atlas Text interface for rendering SDF glyphs.
This new API is built upon SDF text atlas code from the GPU backend. Unlike using the GPU
backend to draw text, this set of interfaces allows the client to render the SDF glyphs. The
client issues text draws to potentially multiple targets and then the client flushes. The
client then gets commands from Skia with data to put into a texture atlas and vertices to
draw that reference the texture. The client is responsible for creating the texture, uploading
the SDF data to the texture, and drawing the vertices provided by Skia.

Change-Id: Ie9447e19b85f0ce1c2b942e5216c787a74f335d3
Reviewed-on: https://skia-review.googlesource.com/59360
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-17 20:35:06 +00:00
Ethan Nicholas
be0a042dcf converted Premul / Unpremul to SkSL
Bug: skia:
Change-Id: I4944badbb530e17b9ff7cca389f943e0b5982e01
Reviewed-on: https://skia-review.googlesource.com/72983
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-17 20:11:36 +00:00
Brian Salomon
55ad774812 Revert "Revert "Add method to sk_gpu_test::TestContext to automatically restore the previous context.""
This reverts commit 1e09e461d2.

Change-Id: I95d5544a7baaa078536790493ce4119816a77e94
Reviewed-on: https://skia-review.googlesource.com/72903
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-17 16:22:56 +00:00
Brian Osman
1e09e461d2 Revert "Add method to sk_gpu_test::TestContext to automatically restore the previous context."
This reverts commit 5627d65146.

Reason for revert: Google3

Original change's description:
> Add method to sk_gpu_test::TestContext to automatically restore the previous context.
> 
> The motivation for this is to allow a GM to create a GL context, do some some work in it, and then return to the context that was set when it was invoked.
> 
> Change-Id: Ie8496072a10f8f3ff36a08889e593a6ca961b61a
> Reviewed-on: https://skia-review.googlesource.com/70720
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ifb79638c9d4500ca3be9a5be39a5ad78b20247c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/72981
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-16 22:31:39 +00:00
Ethan Nicholas
8dca18ac7b converted GrAARectEffect to SkSL
Bug: skia:
Change-Id: I08254806fe7cb97dab21c5625aa16dd34aea9468
Reviewed-on: https://skia-review.googlesource.com/72120
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-16 21:54:38 +00:00
Ethan Nicholas
3bc00fe810 fix Housekeeper-PerCommit bot
Bug: skia:
Change-Id: I393fa79c6c34b5d0b8d66b87749789644c6ee1e4
Reviewed-on: https://skia-review.googlesource.com/72740
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-16 19:18:53 +00:00
Ethan Nicholas
7970765f7d Switched SkSL from using raw strings back to STRINGIFY
Stringify was stripping the comments from the strings, whereas raw
strings preserve them, which led to an increase in executable
size. The only effect of this change is to strip the comments back
out.

Bug: 784880
Change-Id: Icf2f9cf522cb890179f2e481a3504e8171732705
Reviewed-on: https://skia-review.googlesource.com/72524
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-16 17:52:42 +00:00
Brian Salomon
5627d65146 Add method to sk_gpu_test::TestContext to automatically restore the previous context.
The motivation for this is to allow a GM to create a GL context, do some some work in it, and then return to the context that was set when it was invoked.

Change-Id: Ie8496072a10f8f3ff36a08889e593a6ca961b61a
Reviewed-on: https://skia-review.googlesource.com/70720
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-11-16 16:30:53 +00:00
Vladimir Levin
70fb479ae6 Ensure that removing last extension from GrGLExtension doesn't assert.
This patch fixes an assert that triggers when removing the last
extension in the list, since the index operator goes out of bounds.

Added a test that fails without the code changes and passes with the
changes.

R=bsalomon@chromium.org

Change-Id: I0d561b150899c178f638dde088af773fddf112d9
Reviewed-on: https://skia-review.googlesource.com/72000
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-15 20:25:42 +00:00
Brian Salomon
559f556d9d Remove support for image load/store
This isn't used and has become a maintenance burden.

Change-Id: I5f3af8f91e5c4f073fe4ea30e0a7f1f61efeea47
Reviewed-on: https://skia-review.googlesource.com/70640
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-15 20:06:12 +00:00
Ethan Nicholas
aae47c878b sksl enum support
Bug: skia:
Change-Id: I4d505b31cf8b59de12bcdbca410aafc085977ba9
Reviewed-on: https://skia-review.googlesource.com/68621
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-13 14:36:40 +00:00
Herb Derby
66498bc416 Try 2 for Gauss filter calculation
Originally reviewed at:
https://skia-review.googlesource.com/c/skia/+/67723

Change-Id: Ie62d81f818899f3a79df888c1594d3fbccf6d414
Reviewed-on: https://skia-review.googlesource.com/69681
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-10 19:58:57 +00:00
Mike Klein
10d66cc3f8 move Sk{Test,Random}ScalerContext to tools
There's no need for Skia users to link this test code.

Change-Id: I9d6ef2a053d0cf5cb916aa254389ca819c48bae1
Reviewed-on: https://skia-review.googlesource.com/69922
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-10 17:02:20 +00:00