1) Transform the path center to device space before computing the shadow offset.
2) Modulate the shadow color by the color filter's output color.
3) Make the scale of path points in the spot tessellator be relative to the path centroid.
4) Clamp the shadow alphas at 1.
Change-Id: I480476df79b959f11c1eca0ba2a49a134d355cbb
Reviewed-on: https://skia-review.googlesource.com/7860
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
(1) Use libjpeg-turbo color space extensions when possible.
(2) Use transform_scanline_procs when pre-libjpeg-turbo transformation
are required.
(3) Add support for Gray and F16.
BUG=skia:
Change-Id: I77b977cb8c9e0afc17d907dd73a1cf3f16539bcc
Reviewed-on: https://skia-review.googlesource.com/7642
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
The code to handle acute outer angles in generated geometry was pretty
broken: it did a simple runnning average of consecutive acute vertices,
and didn't handle acute angles between the last and first edges.
Replaced it with something simpler that does proper bevelling for
angles less than 2.5 degrees.
This revealed a bug with thin path segments, exposed by the thinconcavepaths
test. This will be fixed by upcoming changes, but I've also dded a few more
test cases to make it clearer.
Change-Id: I23a628ab2e16acaab798c746a5fd87842cacbfab
Reviewed-on: https://skia-review.googlesource.com/7660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
Generate targets for dm and nanobench from ninja and add them to the
generated Android.bp file.
Remove nanobenchAndroid and SkAndroidSDKCanvas. These rely on HWUI
internals and are currently unused.
Update gyp file references to removed files, just in case.
Change-Id: Ic6ae18a70bfd0c33804e7996d077f2081dfdfe07
Reviewed-on: https://skia-review.googlesource.com/7635
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Some of my local changes slipped into the tree.
BUG=skia:
Change-Id: I6e452f12608db6b80c5887ccd3cac199cfbf9494
Reviewed-on: https://skia-review.googlesource.com/7625
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
This was found by a tip of tree build of clang.
Change-Id: I9aa3fecd47ae69350e8d58e796f960a991b7759e
Reviewed-on: https://skia-review.googlesource.com/7586
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This opens the door for swapping all the effects over to taking GrTextureProxies.
Change-Id: I3b03ba93a68f9945c9a8fee008fd170ed57616eb
Reviewed-on: https://skia-review.googlesource.com/7344
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This refactor will make it simple to add F16 and
GammaCorrect support to the webp encoder.
BUG=skia:
Change-Id: I379ba2ff0b44d865847877322e86d0c138e727c8
Reviewed-on: https://skia-review.googlesource.com/7356
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
(actually fixes undefined result in getClipBounds)
future CLs
- update all callers to new apis
- move/rename virtuals
BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=7400
Change-Id: I45b93014e915c0d1c36d97d948c9ac8931f23258
Reviewed-on: https://skia-review.googlesource.com/7400
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: Iec5fc759e331de24caea1347f9510917260d379b
Reviewed-on: https://skia-review.googlesource.com/7363
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Ganesh doesn't support Index8, because GPUs don't really
support it. So serializing it in the deferred blob just
meant doing an expansion before upload. This forces that
to happen when we build the blob. It also paves the way
for removing the last usage of MakeTextureFromPixmap,
which I'd like to remove.
BUG=skia:
Change-Id: I7c0292098d71e2f8ec1f9910e1234761822ce957
Reviewed-on: https://skia-review.googlesource.com/7340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix)
Relanding of: https://skia-review.googlesource.com/c/6977/
Change-Id: Ibc9b9e354f7fc23b1a6e6e4fe7c9fe3cef771c02
Reviewed-on: https://skia-review.googlesource.com/7265
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: Ifd221365a7b9f9a4a4fc5382621e0da7189e1148
Reviewed-on: https://skia-review.googlesource.com/6526
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
BUG=skia:
Change-Id: Ic5b2b07fb3f408edf1f2b982235424c22795fe50
Reviewed-on: https://skia-review.googlesource.com/7187
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
SampleApp doesn't have (can't easily get) an image, so I couldn't use
the new helper function there. It's probably still worth having?
BUG=skia:
Change-Id: I60c208ff958076015a9539359921b9aff68f25c8
Reviewed-on: https://skia-review.googlesource.com/7129
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix)
Change-Id: Ibac3a540fcb1967ceef571157d41c1937acfadf8
Reviewed-on: https://skia-review.googlesource.com/6977
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The original is at:
https://skia-review.googlesource.com/c/6887/
The only change to the original is to temporarily comment out
a check in SkImageInfoPriv.h until a Chrome unit test can
be fixed.
The idea is share these standards for the following:
SkImage::readPixels()
SkCanvas::readPixels()
SkCanvas::writePixels()
SkBitmap::readPixels()
SkPixmap::readPixels()
On the raster side, SkPixmap::readPixels() is the right
place to check, because all raster calls go through
there eventually. Then at lower levels (ex: SkPixelInfo),
we can assert.
There's not really a unifying location for gpu calls,
so I've added this in multiple places. I haven't really
dug into the gpu code to SkASSERT() on invalid cases
that we will have already caught.
Follow-up work:
Similar refactor for SkReadPixelRec::trim().
Code cleanup in SkPixelInfo::CopyPixels()
BUG=skia:6021
Change-Id: I6a16f9479bc09e3c87e10c72b0378579f1a70866
Reviewed-on: https://skia-review.googlesource.com/7104
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
simplify_boundary() was incorrectly comparing squared distances
against a non-squared constant. For .25 of a pixel, we need to
compare against 0.25 squared, or 0.0625.
This also includes a fix to get_edge_normal(), We were actually
returning edge "vectors", instead of edge normals. This wasn't
causing problems, since the error cancels itself out, but it's
confusing.
BUG=skia:
Change-Id: I0d50f2d001ed5e41de2900139c396b9ef75d2ddf
Reviewed-on: https://skia-review.googlesource.com/7043
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit cf5d6caff7.
Reason for revert: Chrome DEPS roll failing, based on the unit tests, I suspect this is the cause.
Original change's description:
> Add SkImageInfoValidConversion() and SkImageInfoIsValid
>
> The idea is share these standards for the following:
> SkImage::readPixels()
> SkCanvas::readPixels()
> SkCanvas::writePixels()
> SkBitmap::readPixels()
> SkPixmap::readPixels()
>
> On the raster side, SkPixmap::readPixels() is the right
> place to check, because all raster calls go through
> there eventually. Then at lower levels (ex: SkPixelInfo),
> we can assert.
>
> There's not really a unifying location for gpu calls,
> so I've added this in multiple places. I haven't really
> dug into the gpu code to SkASSERT() on invalid cases
> that we will have already caught.
>
> Follow-up work:
> Similar refactor for SkReadPixelRec::trim().
> Code cleanup in SkPixelInfo::CopyPixels()
>
> BUG=skia:6021
>
> Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2
> Reviewed-on: https://skia-review.googlesource.com/6887
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
>
TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.
BUG=skia:6021
Change-Id: I63b88e90bdbb3051a14de00ac73a8351ab776d25
Reviewed-on: https://skia-review.googlesource.com/7095
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Should be no user- or test-visible changes.
BUG=skia:
Change-Id: I6499dc978a41fee344b847c118f84227271561c5
Reviewed-on: https://skia-review.googlesource.com/6906
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
The idea is share these standards for the following:
SkImage::readPixels()
SkCanvas::readPixels()
SkCanvas::writePixels()
SkBitmap::readPixels()
SkPixmap::readPixels()
On the raster side, SkPixmap::readPixels() is the right
place to check, because all raster calls go through
there eventually. Then at lower levels (ex: SkPixelInfo),
we can assert.
There's not really a unifying location for gpu calls,
so I've added this in multiple places. I haven't really
dug into the gpu code to SkASSERT() on invalid cases
that we will have already caught.
Follow-up work:
Similar refactor for SkReadPixelRec::trim().
Code cleanup in SkPixelInfo::CopyPixels()
BUG=skia:6021
Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2
Reviewed-on: https://skia-review.googlesource.com/6887
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
- Implementation.
- Use in SkLinearPipeline.
TBR=mtklein@google.com
Change-Id: Ie014184469b217132b0307b5a9ae40c0c60e5fc9
Reviewed-on: https://skia-review.googlesource.com/6921
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This fixes an issue where color filters aren't correctly applied to color glyphs. Instead we apply the filter to the SkPaint's color which is correct for mask glyphs only.
Add color filter and alpha + various effects to coloremoji gm
Change-Id: If77dece71d43468fec65499857eaaaedb56428e9
Reviewed-on: https://skia-review.googlesource.com/6891
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
When path features are exactly a pixel wide, the extruded inner edges
can become collinear and then be removed, since their winding is
zero. We need these edges to be preserved through triangulation,
otherwise opaque portions of the geometry can become transparent.
Since the simplify() pass can handle zero-winding edges just fine, the
the fix is to simply not remove them.
In addition, this changes refactors out disconnect() from all the calls
to remove_edge_above()/remove_edge_below(). It also renames the remaining
function erase_edge() (since it's now unconditional).
Add a new test to a new "thinconcavepaths" GM.
BUG=680260
NOTRY=true
Change-Id: I1d3a436c95a01c4d4ef5dc05503de4312677f65d
Reviewed-on: https://skia-review.googlesource.com/6902
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
This reverts commit 6ff51aedda.
Reason for revert: breaks win2k8 and PDFium
Change-Id: Ib1e2db8e523d5d321836ce00e3773def3db8be2f
Reviewed-on: https://skia-review.googlesource.com/6898
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
- Implementation.
- Use in SkLinearPipeline.
TBR=mtklein@google.com
Change-Id: Ia8efd09b2f3139a57182889ba84d1610eae92749
Reviewed-on: https://skia-review.googlesource.com/6352
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Disables use of SDFs for very small paths (because of blurring) and
adds a border of 1 pixel in device space to handle antialiasing.
BUG=chromium:677889
Change-Id: Icd2f7e80323b1255f8de52b97360e9a2d995c765
Reviewed-on: https://skia-review.googlesource.com/6895
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This makes GrPaints usable only once. In some places we must make copies in order to issue draws with the same paint state.
Change-Id: Ie816e5185ce93a064111cad64c6880e1e21184c2
Reviewed-on: https://skia-review.googlesource.com/6844
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
BUG=skia:
Change-Id: Ie7d4fac3024b361a281f456fec2b3a837e2bfe43
Reviewed-on: https://skia-review.googlesource.com/6881
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
SkFontMgr factories now return sk_sp and the legacy factories are no
longer used and can be removed.
BUG=skia:5077
Change-Id: Ieaff8555b297d1db157f8b78cdd6e7d07a3b5490
Reviewed-on: https://skia-review.googlesource.com/6894
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).
* SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h
* "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"
Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'"
This reverts commit c456b73fef.
Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab
Reviewed-on: https://skia-review.googlesource.com/6886
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This reverts commit d081ff314f.
Reason for revert: Failing unit tests.
Original change's description:
> More fixes for distance field paths
>
> Disables use of SDFs for very small paths (because of blurring) and
> adds a border of 1 pixel in device space to handle antialiasing.
>
> BUG=chromium:677889
>
> Change-Id: I81e49477c943d41523fd836e55abd696a985491f
> Reviewed-on: https://skia-review.googlesource.com/6832
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
BUG=chromium:677889
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I4a6a698fa2e9e58c1c98a5a89f54bed724527951
Reviewed-on: https://skia-review.googlesource.com/6890
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Disables use of SDFs for very small paths (because of blurring) and
adds a border of 1 pixel in device space to handle antialiasing.
BUG=chromium:677889
Change-Id: I81e49477c943d41523fd836e55abd696a985491f
Reviewed-on: https://skia-review.googlesource.com/6832
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>