aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* Implement a fast path for solid color lattice rectangleGravatar Stan Iliev2017-12-11
| | | | | | | | | | | | Add a flag that hints, which lattice rectangles are solid colors. Draw solid rectangles and 1x1 rectangles with drawRect. Test: Measured performance of a ninepatch drawn by HWUI Bug: b/69796044 Change-Id: Ib3b00ca608da42fa9f2d2038cc126a978421ec7c Reviewed-on: https://skia-review.googlesource.com/79821 Commit-Queue: Stan Iliev <stani@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* fixed SkSL optimizing away side effectsGravatar Ethan Nicholas2017-12-11
| | | | | | | | Bug: skia:7196 Change-Id: I44676003d9ea7970efb40df2f7e40c2de05a5f67 Reviewed-on: https://skia-review.googlesource.com/83440 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* Add GrGLMakeNativeInterface factory that returns sk_sp<const GrGLInterface>.Gravatar Brian Salomon2017-12-11
| | | | | | | | | | | | | | | Removes the concept of a configurable "default" interface and makes the default always be the "native" interface. Also removes unused functions: GrGLInterfaceAddTestDebugMarker and GrGLInterface::NewClone. Keeps around legacy GrGLCreateNativeInterface() until clients can be weened. Change-Id: I4a3bdafa8cf8c68ed13318393abd55686b045ccb Reviewed-on: https://skia-review.googlesource.com/83000 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* CCPR: Don't use instanced draw calls with geometry shadersGravatar Chris Dalton2017-12-11
| | | | | | | | | | | | It isn't necessary for the vertex shader to know all the points because everything happens in the geometry shader. It's simpler to use regular vertex arrays instead. Bug: skia: Change-Id: I7bf83180476fbe0ab01492611cd72e72b3f7d4f2 Reviewed-on: https://skia-review.googlesource.com/82881 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "add experimental bilerp_clamp_8888 stage"Gravatar Mike Klein2017-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a7fa3377d24643d86117159f8a58d2ee66880a4d. Reason for revert: lots of crashing GPU bots. Original change's description: > add experimental bilerp_clamp_8888 stage > > It looks like we can specialize hot image shaders into their > own single stages for a good speedup on both x86 and ARM. > > I've started here with bilerp_clamp_8888, and will > follow up with bgra and 565, and lowp versions of those, > and probably also the same for nearest neighbors. > > All pixels are identical in GMs. > > Change-Id: I2f6995767cd38053d670b8d0bfdb71b687803d70 > Reviewed-on: https://skia-review.googlesource.com/82100 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,liyuqian@google.com Change-Id: If70abb91b69bcd781e395dd3ac05ff1eebb1169f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/83340 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add experimental bilerp_clamp_8888 stageGravatar Mike Klein2017-12-11
| | | | | | | | | | | | | | | | It looks like we can specialize hot image shaders into their own single stages for a good speedup on both x86 and ARM. I've started here with bilerp_clamp_8888, and will follow up with bgra and 565, and lowp versions of those, and probably also the same for nearest neighbors. All pixels are identical in GMs. Change-Id: I2f6995767cd38053d670b8d0bfdb71b687803d70 Reviewed-on: https://skia-review.googlesource.com/82100 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix tautological comparison in GrTextureDomain.cppGravatar Hans Wennborg2017-12-09
| | | | | | | | | | | | | | | | | -1 is not a valid value for the GrTextureDomain::Mode enum, so certain versions of Clang warn that the comparison is a no-op: ../../third_party/skia/src/gpu/effects/GrTextureDomain.cpp:70:23: warning: comparison of constant -1 with expression of type 'GrTextureDomain::Mode' is always false [-Wtautological-constant-out-of-range-compare] SkASSERT((Mode)-1 == fMode || textureDomain.mode() == fMode); ~~~~~~~~ ^ ~~~~~ Bug: chromium:793189 Change-Id: Iba49ae15622285a62ad218dbdd78b0846338b7cb Reviewed-on: https://skia-review.googlesource.com/82962 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* centralize encoding to SkDataGravatar Mike Reed2017-12-09
| | | | | | | | Bug: skia: Change-Id: If3a9a6de54cf76d03e4d159b54b07a4ea6d5cda9 Reviewed-on: https://skia-review.googlesource.com/83020 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Fix tautological compare in GrSurfaceProxy.cppGravatar Hans Wennborg2017-12-09
| | | | | | | | | | | | | | | | | | | | -1 is not a valid value for the GrSurfaceOrigin enum, and certain versions of Clang warn that the comparison is effectively a no-op: ../../third_party/skia/src/gpu/GrSurfaceProxy.cpp:547:38: warning: comparison of constant -1 with expression of type 'GrSurfaceOrigin' is always true [-Wtautological-constant-out-of-range-compare] SkASSERT(kGrUnknownSurfaceOrigin != fProxy->origin()); ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~ Instead of trying to force -1 in there, drop the assert and initialize with top-left as origin. Bug: chromium:793189 Change-Id: I4cb6720d567f6c5650a19df33d3c77f2d738a516 Reviewed-on: https://skia-review.googlesource.com/82961 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Don't force GrGLSLVarying's scope to be compile-time constantGravatar Chris Dalton2017-12-08
| | | | | | | | Bug: skia: Change-Id: I70a191949fd26a39257a8a59a0a4c6448ec1fa37 Reviewed-on: https://skia-review.googlesource.com/82462 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* CCPR: Combine loops and serpentines back into a single shaderGravatar Chris Dalton2017-12-08
| | | | | | | | Bug: skia: Change-Id: I945471ccd2580a2d39afd9c80acb8d9e5e196435 Reviewed-on: https://skia-review.googlesource.com/82460 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Revert "use serialprocs for typefaces""Gravatar Mike Reed2017-12-08
| | | | | | | | | | | | | | This reverts commit 1a104bce20adc47a343fa910899ca6c4f261be40. Change (from first version) is - only signal error in readbuffer for corrupt stream, not default fonts - change test to ensure a non-null typeface (i.e. MakeDefault()) Bug: skia: Change-Id: I325445b56b0a402e1b89a2439df06e92314c793f Reviewed-on: https://skia-review.googlesource.com/82687 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Use sk_sp to own GrCaps in GrContext.Gravatar Brian Salomon2017-12-08
| | | | | | | Change-Id: I46cd37132ecdf0f93be4509c6a06fb74cb185076 Reviewed-on: https://skia-review.googlesource.com/82625 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* keep SVG arcs axis aligned with suppressionGravatar Cary Clark2017-12-08
| | | | | | | | | | | | | | another attempt at https://skia-review.googlesource.com/c/skia/+/79423 this time, bracket change with SK_SUPPORT_LEGACY_SVG_ARC_TO to avoid prematurely changing SVG layout test results. R=djsollen@google.com Bug: b:69622768 Change-Id: Ia929f89d4f4292dfead191a381cdb431f743726a Reviewed-on: https://skia-review.googlesource.com/82723 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* enforce 4-byte alignment and length for buffersGravatar Mike Reed2017-12-08
| | | | | | | | Bug:792859 Change-Id: Ib4cde1015429153709956d4ffc2d4321decb79b0 Reviewed-on: https://skia-review.googlesource.com/82160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* return data instead of boolGravatar Mike Reed2017-12-08
| | | | | | | | Bug: skia: Change-Id: Id7c3044a2fce087703544c624c75a7756b9c62b4 Reviewed-on: https://skia-review.googlesource.com/82602 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove instanced renderingGravatar Brian Salomon2017-12-08
| | | | | | | Change-Id: I4219b1d23a647b849ee41fe71b53e1c45edfc3f4 Reviewed-on: https://skia-review.googlesource.com/82241 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* CCPR: Move flatness checks from geometry shaders to CPUGravatar Chris Dalton2017-12-07
| | | | | | | | | | Vertex shaders can't discard geometry. Bug: skia: Change-Id: Iec22a103b7a4eda9a59fd99e48644183b0880f5f Reviewed-on: https://skia-review.googlesource.com/82260 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* turn back on NEON lowp code...Gravatar Mike Klein2017-12-07
| | | | | | | | | | | | Turns out I was defining JUMPER_HAS_NEON_LOWP, but checking JUMPER_NEON_HAS_LOWP. 🤦 Change-Id: Ib328190ce35a367bf3d08d8e66f0ab8791ccb8b2 Reviewed-on: https://skia-review.googlesource.com/82320 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Transition to using size_t for only byte allocation sizes.Gravatar Herbert Derby2017-12-07
| | | | | | | | | | This will simplify coming refactorings, and make the code similar to the image blur code. Change-Id: I4d61ac21e3428b0e4fce03159c66539b9b032fe7 Reviewed-on: https://skia-review.googlesource.com/81961 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Revert "use serialprocs for typefaces"Gravatar Mike Reed2017-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b681972e79993e37adb9de9666cc9064b528db8b. Reason for revert: need to handle null typeface in new procs Original change's description: > use serialprocs for typefaces > > Bug: skia: > Change-Id: Ibf59a0fdcf68e8555bd4241e9473e733f6a30993 > Reviewed-on: https://skia-review.googlesource.com/81840 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Reviewed-by: Mike Klein <mtklein@chromium.org> > Commit-Queue: Mike Reed <reed@google.com> TBR=mtklein@chromium.org,mtklein@google.com,fmalita@chromium.org,reed@google.com Change-Id: Id69500fbc291ecee753e7ee6b80abc2a7cd60d18 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/82341 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Temporarily readd old signature of GrContext::MakeGLGravatar Brian Salomon2017-12-07
| | | | | | | | Change-Id: I9c785dd2fd14e422b7e84067053d0565a4d782b6 Reviewed-on: https://skia-review.googlesource.com/82340 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add gray_8_as_lum and _as_red private grpixelconfigsGravatar Greg Daniel2017-12-07
| | | | | | | | Bug: skia: Change-Id: I70cbd0bc9f7a7a16fb9f0688d272d7afa607700a Reviewed-on: https://skia-review.googlesource.com/80622 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Fix gpu line dashing when line is zero length but has capGravatar Greg Daniel2017-12-07
| | | | | | | | Bug: skia:7387 Change-Id: I49a023f395ab1539c80881f95242a4bdad6e70b3 Reviewed-on: https://skia-review.googlesource.com/79722 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Make GrGLContext be uniquely owned.Gravatar Brian Salomon2017-12-07
| | | | | | | | | Make GrGLContext take GrGLInterface by sk_sp Change-Id: Iab11b27a7093ec897aaeeab9253958aeaa590b63 Reviewed-on: https://skia-review.googlesource.com/81701 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* use serialprocs for typefacesGravatar Mike Reed2017-12-07
| | | | | | | | | Bug: skia: Change-Id: Ibf59a0fdcf68e8555bd4241e9473e733f6a30993 Reviewed-on: https://skia-review.googlesource.com/81840 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* don't read directly from fReader for bare types, need available checkGravatar Mike Reed2017-12-07
| | | | | | | | Bug:792810 Change-Id: Ibb9d4b1dff05d48d7cb6674acf88a7a461bca818 Reviewed-on: https://skia-review.googlesource.com/82180 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Make GrGLSLPrimitiveProcessor::emitTransforms take local coords as GrShaderVar.Gravatar Brian Salomon2017-12-07
| | | | | | | | | Also remove unused position variable parameter. Change-Id: I37f98a03ac1ca750810de13b08e3ffa11e41828c Reviewed-on: https://skia-review.googlesource.com/81320 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* check for bad strings in readFlattenableGravatar Mike Reed2017-12-07
| | | | | | | | Bug:792815 Change-Id: I3b79d8b182bd129e9a17185991020d1dafb66a34 Reviewed-on: https://skia-review.googlesource.com/82060 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* sk_spification of GrGpu creation.Gravatar Brian Salomon2017-12-07
| | | | | | | | | | | | Make GrContext::MakeGL take interface as sk_sp. Make GrContext::MakeVulkan take GrVkBackendContext as sk_sp. Change-Id: I13c22a57bd281c51738f503d9ed3418d35a466df Reviewed-on: https://skia-review.googlesource.com/81842 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Fix buffer off-by-one error.Gravatar Herbert Derby2017-12-07
| | | | | | | | | | | | The maximum number of Gaussian factors produces is 5. But, 6 elements are needed to calculate those 5. BUG=chromium:792316 Change-Id: Ief356f6c21bed7e90e33900989744c27cfe8a9a9 Reviewed-on: https://skia-review.googlesource.com/81560 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Remove SkImage deferred texture image data APIs.Gravatar Brian Salomon2017-12-07
| | | | | | | | | | These APIs existed for Chrome. Chrome is no longer using them. Change-Id: I15a5e2f88c7e8d1356188748fc68d4658f6f1849 Reviewed-on: https://skia-review.googlesource.com/81021 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* upgrade SkReadBuffer to always validateGravatar Mike Reed2017-12-06
| | | | | | | | Bug: skia: Change-Id: I054560b66c6cde346d939015326d8547879d2c4b Reviewed-on: https://skia-review.googlesource.com/81160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Revert "keep SVG arcs axis aligned"Gravatar Cary Clark2017-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c3823848483eba33c3fa36187de7713e87651c1c. Reason for revert: need to add legacy flag to chrome first Original change's description: > keep SVG arcs axis aligned > > Computing the arc width introduces rounding errors that cause the > arc to exceed 1/4 circle and cause integer anchored arcs to start > outside their marks. A round rect may lose convexity as a result. > > Check if arcTo() inputs are integers and arc is 90 degrees; > if so, output conics which are axis-aligned on integers as well. > > This is triggered when using SVG to represent a round rect. > > Possible future enhancements are recorded in bug.skia.org/7383 > > R=​reed@google.com,djsollen@google.com > Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31 > Reviewed-on: https://skia-review.googlesource.com/79423 > Reviewed-by: Derek Sollenberger <djsollen@google.com> > Commit-Queue: Derek Sollenberger <djsollen@google.com> TBR=djsollen@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org Change-Id: Ia503ea62def15322df2b11da30d377a9543d6999 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/81281 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* add SkVptr()Gravatar Mike Klein2017-12-06
| | | | | | | | | | I was wondering how feasible using this to make downcasts safe would be. These tests would need to build and pass on all our bots, at least. Change-Id: I1753ba58841bf6c17d6ac3af7374518356e1bb05 Reviewed-on: https://skia-review.googlesource.com/81180 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove previous blur image implementation. Try 2Gravatar Herbert Derby2017-12-06
| | | | | | | | | | | The last version had a problem with the no simd compilation. TBR=mtklein@google.com Change-Id: I139388cf3bf1b55cb4a49133a98be129fd9711c6 Reviewed-on: https://skia-review.googlesource.com/80983 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* keep SVG arcs axis alignedGravatar Cary Clark2017-12-06
| | | | | | | | | | | | | | | | | | | Computing the arc width introduces rounding errors that cause the arc to exceed 1/4 circle and cause integer anchored arcs to start outside their marks. A round rect may lose convexity as a result. Check if arcTo() inputs are integers and arc is 90 degrees; if so, output conics which are axis-aligned on integers as well. This is triggered when using SVG to represent a round rect. Possible future enhancements are recorded in bug.skia.org/7383 R=reed@google.com,djsollen@google.com Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31 Reviewed-on: https://skia-review.googlesource.com/79423 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Revert "Remove previous blur image implementation"Gravatar Herb Derby2017-12-06
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a11346dd24fa7122246dc96ba15604713e460036. Reason for revert: Compile problems on linux Original change's description: > Remove previous blur image implementation > > Change-Id: Ie3bada767f0ba945cb17f174f179510768eb178d > Reviewed-on: https://skia-review.googlesource.com/77583 > Commit-Queue: Herb Derby <herb@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,herb@google.com Change-Id: I5f157fbc2fd4e2a37618dc9c0e72621ff9892ef6 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/81100 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Remove previous blur image implementationGravatar Herbert Derby2017-12-06
| | | | | | | Change-Id: Ie3bada767f0ba945cb17f174f179510768eb178d Reviewed-on: https://skia-review.googlesource.com/77583 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* CCPR: Eliminate texel buffersGravatar Chris Dalton2017-12-05
| | | | | | | | | | | | | | | | | | Points cost 8 bytes and indices cost 4. If a point is accessed twice, it's a wash whether we duplicate it or index. This change eliminates texel buffers by duplicating points across instance arrays. This reduces our dependence on extensions as well as getting rid of our indirect memory access pattern in vertex shaders. As a result of this change, memory usage by GPU buffers will only be a fraction larger at worst, and slightly better at best. Bug: skia: Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: I3c7f03772edd4f850d5fdd7b55552647335c1b52 Reviewed-on: https://skia-review.googlesource.com/79185 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* add serial procs to picturesGravatar Mike Reed2017-12-05
| | | | | | | | | 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>
* Reland "Hide SkEncodedInfo"Gravatar Leon Scroggins III2017-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts commit 1793e7bb46c1f9d430c1a699a1c3d3168159b659. 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>
* Add analytic clip FPs that read from the CCPR atlasGravatar Chris Dalton2017-12-05
| | | | | | | | 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>
* Avoid GrEllipseEffect for small radii on devices without 32 bit float.Gravatar Brian Salomon2017-12-05
| | | | | | | | | Also limit small radius bail in GrCircleEffect to clip out cases. Change-Id: I14ce736969b05203219d68f30283c36c84f78f3a Reviewed-on: https://skia-review.googlesource.com/80621 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Hide SkEncodedInfo"Gravatar Leon Scroggins2017-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c6f7a4ffa9522159efc42f7c948bba5e66bb8844. 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>
* Hide SkEncodedInfoGravatar Leon Scroggins III2017-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Restore ability to dump SKSL in addition to GLSLGravatar Brian Salomon2017-12-04
| | | | | | | Change-Id: Ib5d980414803234c0aff39b2cf085bb84405574a Reviewed-on: https://skia-review.googlesource.com/79902 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* helper api to force a raster imageGravatar Mike Reed2017-12-04
| | | | | | | | Bug: skia: Change-Id: I53f3d426e97f446b17dc965fa8dd6d6aae441ac9 Reviewed-on: https://skia-review.googlesource.com/79901 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* turn on extended Clang warnings on Windows tooGravatar Chris Dalton2017-12-04
| | | | | | | | | | 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>
* Only look at gamut_transform if we wrote to it.Gravatar Mike Klein2017-12-04
| | | | | | | | | | | | | If we're already in sRGB gamut, we will not write to the 3x4 matrix, but we still analyze it to see if we need clamping. So we might (harmlessly) re-clamp some already clamped colors unnecessarily. Found by this Chromium MSAN bot. Bug: chromium:789767 Change-Id: I5d76e59b541a03ee8efbd4352262b4f650e1ec01 Reviewed-on: https://skia-review.googlesource.com/79762 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>