The code generated from std::move()ing them should be fine.
Bug: skia:8355
Change-Id: I63ef650b5fbcf9fb6356006190eae5e0977ae642
Reviewed-on: https://skia-review.googlesource.com/151982
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: I0ca1f3b60d05ce02d1e53bb8b989c9dc1babddd1
Reviewed-on: https://skia-review.googlesource.com/150915
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
When repeatedly insetting rings we can wind up with bisector vectors
that correspond to a slightly concave ring. This would cause the first
intersection when computing the next ring's inset depth to be outside
the current ring. Instead skip adjacent bisectors that intersect outside
the ring during the search.
Change-Id: I3efab5a9f44966888cfa86715876b7b177950732
Reviewed-on: https://skia-review.googlesource.com/151827
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Centralize the calculation to SkGlyphCacheCommon. This allows this
function to be used with NO_GPU.
In addition, this was used in the last remaining function in GrTest.
That function was used in a single place. I made the function a static
and remove GrTest.h. This had massive knock-on effects.
Change-Id: I80f874a988f9af4383a83acf7c273d23b8d67c22
Reviewed-on: https://skia-review.googlesource.com/151480
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Rather that returning nullptr for a recording
canvas, return a raster canvas instead.
R=reed@google.com,robertphillips@google.com
Bug: skia:
Change-Id: I211d8ef368b9aec6d14cc72d1652ac6a03f3fa7b
Reviewed-on: https://skia-review.googlesource.com/151666
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This is a reland of 2f2757fa6b
Original change's description:
> ccpr: Implement stroking with fine triangle strips
>
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
>
> Conic strokes and non-rigid-body transforms are not yet supported.
>
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>
TBR=robertphillips@google.com
Bug: skia:
Change-Id: I3f0065e80975ee8334300bc5e934231b66b49178
Reviewed-on: https://skia-review.googlesource.com/151188
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
We weren't checking whether the new point in lineTo was backtracking or not.
Also:
Replace distance-to-line check with triangle area check. The previous check
was asymmetric. Given point sequence (a, b, c) it might make a different
decision than when given (c, b, a).
Compute normals late since we don't use them to detect colinear edges
anymore.
Rename SkPointPriv::SetOrhog -> SkPointPriv::MakeOrthog and return
computed value rather than take SkPoint* dst.
Bug: chromium:869172
Change-Id: I8da53edf1a2e6098f4199da57368ebb644866e4c
Reviewed-on: https://skia-review.googlesource.com/150682
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit 2f2757fa6b.
Reason for revert: issues with DDL
Original change's description:
> ccpr: Implement stroking with fine triangle strips
>
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
>
> Conic strokes and non-rigid-body transforms are not yet supported.
>
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,caryclark@google.com,csmartdalton@google.com,reed@google.com,allanmac@google.com
Change-Id: I1980b09976df8275817eaffb6766dbd9fd3e59c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/150980
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Implements strokes by linearizing the curve into fine triangle strips
and interpolating a coverage ramp for edge AA. Each triangle in the
strip emits either positive or negative coverage, depending on its
winding direction. Joins and caps are drawn with the existing CCPR
shaders for triangles and conics.
Conic strokes and non-rigid-body transforms are not yet supported.
Bug: skia:
Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
Reviewed-on: https://skia-review.googlesource.com/148243
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Allan MacKinnon <allanmac@google.com>
This reverts commit 5f7b5e3624.
Reason for revert: Codec CL has re-landed.
Original change's description:
> Revert "Stop conflating F16 with linear gamma"
>
> This reverts commit d1589c7213.
>
> Reason for revert: Depends on skcms CL that's been reverted.
>
> Original change's description:
> > Stop conflating F16 with linear gamma
> >
> > Note to self: I debugged this, realized that the codecs
> > need to handle A2B -> XYZ, then realized that I just need
> > to wait for https://skia-review.googlesource.com/c/skia/+/136062
> >
> > Bug: skia:
> > Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
> > Reviewed-on: https://skia-review.googlesource.com/137587
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
>
> TBR=mtklein@google.com,brianosman@google.com
>
> Change-Id: I6dca583697c8efd2563d30cb7ab9ef505b6903ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/148860
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Iee66531049843758e7ed4130b99d8df6a553d805
Reviewed-on: https://skia-review.googlesource.com/149700
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit d1589c7213.
Reason for revert: Depends on skcms CL that's been reverted.
Original change's description:
> Stop conflating F16 with linear gamma
>
> Note to self: I debugged this, realized that the codecs
> need to handle A2B -> XYZ, then realized that I just need
> to wait for https://skia-review.googlesource.com/c/skia/+/136062
>
> Bug: skia:
> Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
> Reviewed-on: https://skia-review.googlesource.com/137587
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com
Change-Id: I6dca583697c8efd2563d30cb7ab9ef505b6903ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/148860
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Note to self: I debugged this, realized that the codecs
need to handle A2B -> XYZ, then realized that I just need
to wait for https://skia-review.googlesource.com/c/skia/+/136062
Bug: skia:
Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
Reviewed-on: https://skia-review.googlesource.com/137587
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This lets us remove the old S32 functions, and fix a couple bugs.
I think this is a good first step to using SkColor4f for paint colors.
Bug: skia:
Change-Id: I0337c2b6db29b73c2f682f85b9cf68c985de7cce
Reviewed-on: https://skia-review.googlesource.com/147205
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Add a SK_LEGACY_SKCODEC_NONE_ENUM #define'able to ease transition.
Also rename another internal "kNone" enum in SkWebpCodec.cpp.
The "kNone" name is overloaded:
- include/core/SkImageGenerator.h defines its own kNone.
- include/encode/SkPngEncoder.h defines its own kNone.
- include/private/GrTypesPriv.h defines multiple kNone's.
Bug: skia:
Change-Id: I18c03a74f2f1b0237016e0eef53dcd4478b82609
Reviewed-on: https://skia-review.googlesource.com/146020
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Change-Id: Ieac05047826b1fb80950d65573d38494a1a5c5e7
Reviewed-on: https://skia-review.googlesource.com/148383
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
AFAICT none of our clients are using this feature
This will change the occludedrrectblur GM.
Change-Id: I7e5b8fa67db0373dee11a1467d2b2b6a414a1574
Reviewed-on: https://skia-review.googlesource.com/147561
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
- SkIntToScalar not needed for literal values
- more compact use of SkPath makers
Bug: skia:
Change-Id: Ia43a6f753cfe07f362ed1a032687790f9cc23f0e
Reviewed-on: https://skia-review.googlesource.com/147802
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Adapting gray to 565 will add a noticeable purple/green tint.
I'd rather only the 565 images in Gold were tainted with that.
Change-Id: Ib09e92b2f78c6de086345124e9eefeb31bbb5fa8
Reviewed-on: https://skia-review.googlesource.com/147422
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
These shallow gradient tests work best if we're using actual gray.
Any green/purple leak into them will just confuse triaging them.
Change-Id: If4a3a136df7a62cbec8b90bf50985db6eb8de204
Reviewed-on: https://skia-review.googlesource.com/147420
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Docs-Preview: https://skia.org/?cl=145148
Bug: skia:
Change-Id: If27722105a1e8999f6440b6fd4044cc1f327827e
Reviewed-on: https://skia-review.googlesource.com/145148
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
- gives us zero setup cost
- perfect accuracy (at least better than our 16-polyline approx)
- slower at runtime, but for skottie seems still way under the radar
Bug: skia:
Change-Id: Ic01f76184c359c65d6af9a3bedeac34a2ad7d3a6
Reviewed-on: https://skia-review.googlesource.com/146961
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
What is left of the SkView system is used only by samples or viewer.
As a result, move it out of the Skia source tree and re-organize so it
is a bit easier to understand and use more shared code.
Move samplecode/ClockFaceView.cpp to samplecode/SampleTextEffects.cpp,
sice that's what's actually in it.
Move SkAnimTimer.h to tools/timer, since it's actually shared between gm
and samples.
Change-Id: I55dafd94c64e4f930ddbd19168e0f812af86c455
Reviewed-on: https://skia-review.googlesource.com/146161
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a reland of 1b016d50b9
Original change's description:
> Intersection calc cleanup.
>
> * Fixes some bugs in compute_intersection
> * Adds an intersection check that doesn't need to compute the exact pt
> * Make some of the variable names consistent
> * General floating point tweaks
>
> Bug: skia:
> Change-Id: Ib2fb8bee39b5d9c635d62e606fe826b7efe64dfa
> Reviewed-on: https://skia-review.googlesource.com/145532
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I3fe00add6f700b58fd756b9fbb24078e010ed9ba
Reviewed-on: https://skia-review.googlesource.com/145920
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit fdf05f4ff4.
Reason for revert: Android fixed after removing multitexture support from TextureOp.
Original change's description:
> Revert "Move GrGeometryProcessor's textures out of classes and into"
>
> This reverts commit af87483873.
>
> Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
>
> This reverts commit 607be37e3d.
>
> Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
>
> This reverts commit b948572c78.
>
> Revert "Remove multitexturing support from GrTextureOp."
>
> This reverts commit 986f64c601.
>
> Revert "Make result of GrOp::combineIfPossible be an enum."
>
> This reverts commit 641ac7daa8.
>
> Bug: b/112244393
> Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
> Reviewed-on: https://skia-review.googlesource.com/145646
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com
Change-Id: I1d41c2ecf7862e31fb025a7a00bb07bae9d83a47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/112244393
Reviewed-on: https://skia-review.googlesource.com/145780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit af87483873.
Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
This reverts commit 607be37e3d.
Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
This reverts commit b948572c78.
Revert "Remove multitexturing support from GrTextureOp."
This reverts commit 986f64c601.
Revert "Make result of GrOp::combineIfPossible be an enum."
This reverts commit 641ac7daa8.
Bug: b/112244393
Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
Reviewed-on: https://skia-review.googlesource.com/145646
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is to prepare for a third value that requests that ops be linked
together so that the first op may do the work for multiple linked ops
without actually merging the GrOp objects.
Change-Id: Ib6e012a89be5edd054aee69d8475bea612331852
Reviewed-on: https://skia-review.googlesource.com/145522
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Remove late draw consolidation in GrOpFlushState. Rarely did anything
and doesn't work with new allocation strategy. Ops can use GrMesh arrays
to acheive the same thing. (Each Op that cared to would have to implement
but it isn't applicable to most Ops).
Modify GrMeshDrawOp::Target::draw() to take array of meshes, with single
mesh as a special case.
Change-Id: I552677de47b9ffd2fcaf55af85f70f290e5aa9c7
Reviewed-on: https://skia-review.googlesource.com/145426
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It probably doesn't need to be ref counted at all and should be stored
in GrOpFlushState's arena but that's a larger change for another day.
Change-Id: I5f593fb426b8e7794f2ca81194f5a8d9e0f0a072
Reviewed-on: https://skia-review.googlesource.com/145332
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.
SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.
Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.
Also added more unit testing and cleaned up old tests.
Removed functions that were unused outside of tests or used only once.
Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This is an unfortunate amount of plumbing for this, but benchmarks
confirm that we're better off doing this work in the vertex shader
(with a ubyte attribute) than using a float4 attribute.
Change-Id: I358d330ee452ea0a89cdd725019c8df2686036a0
Reviewed-on: https://skia-review.googlesource.com/144351
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This allows us to identify clockwise-winding triangles, in terms of
Skia device space, in all backends and with all render target origins.
Bug: skia:
Change-Id: I220e1c459e0129d1cc4dee6458ef94277fbedd21
Reviewed-on: https://skia-review.googlesource.com/142662
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
SkColorSpace::MakeSRGB().get() is scary, and causes more ref/unref
pairs than strictly necessary for these singletons.
This time the implementation is still in SkColorSpace.cpp,
so these should really work as singletons.
Change-Id: I40f2942c8dcde3040663a04c4f5330aca90868ae
Reviewed-on: https://skia-review.googlesource.com/143305
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Pins out-of-range solutions for cubic/quad max curvature instead of
throwing them out. Code that wants to know the endpoint(s) closest to
max curvature now has the information. Code not interested in these
values can just ignore 0 and 1.
Bug: skia:
Change-Id: I8e7e2ef236b4ab963865dc049ac3e09d5396757d
Reviewed-on: https://skia-review.googlesource.com/143041
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:
Change-Id: I6b3a4b3405662c89464aef7c2f106ec906992241
Reviewed-on: https://skia-review.googlesource.com/142161
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
When two outer boundary edges are collinear, they are part of an
overlap region. As of 77169c8fd6, we (correctly) leave these edges
connected, but we must also adjust the winding to magnitude 1 to
keep the winding rules correct.
Note: this adds a new test case to the concavepaths GM, affecting all platforms.
Bug: 863389
Change-Id: I7e3a06df537cd189101e7ad39a4815a78be8fbdd
Reviewed-on: https://skia-review.googlesource.com/141952
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>