aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
Commit message (Collapse)AuthorAge
* Don't use uninitialized gamma data for adjusting SDF distance.Gravatar Jim Van Verth2017-08-25
| | | | | | | | | | | If the gamma is linear, the corresponding LUT for adjusting colors is not initialized. This change takes that into account when computing distance adjustments for SDF text. Change-Id: I7ca1410bb27cf29ef08ccd666297bf5c3cd3dcdd Reviewed-on: https://skia-review.googlesource.com/38940 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* tiny concave path point fixGravatar Cary Clark2017-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tiny path added to PathTest.cpp has tinier cross products (e.g. 1e-12) so appears to be a series of unbending lines as far as getConvexity is concerned. This point fix looks for paths that do not bend left or right or go backwards, but do have a bounds, and calls them concave. A better fix may be to consider empty and degenerate paths to be concave instead of convex; I don't know if anyone relies on the existing behavior. Another better fix may be to change the math to compute the path turns even though the numbers are very small; on the surface, very difficult. R=bsalomon@google.com,reed@google.com Bug:755839 Change-Id: Ie2280f3f0b95fecab2899f5fc579fd39258e0647 Reviewed-on: https://skia-review.googlesource.com/38720 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* rework plus blend modeGravatar Mike Klein2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most interesting parts of this are how plus interacts with partial coverage. Plus needs its clamp to happen after the lerp. Luckily, some of its math folds away: d' = clamp[ d*(1-c) + (s+d)*c ] == clamp[ d - dc + sc + dc ] == clamp[ d + sc ] What's nice there is that coverage can be folded into the src term. This suggests that we can re-write the plus stage to clamp internally (and thus, be viable for 8-bit) if we always pre-scale with coverage. We don't have a way to pre-scale with 565 coverage until now, but it's only a step or two away from there. We can use the alternate formulation we derived for alpha for lerp_565, calculating the alpha coverage from red, green, and blue coverages _and_ the values of src and dst alpha. While we already pre-scale srcover today for 8-bit or constant coverage, we cannot do the same for 565. When evaluating the expression d' = s + (1-a)d we need the a term to be pre-scaled with red's coverage when calculating dr', with blue's when calculating db', etc. Essentially we need to carry around a bunch of extra values, and we've got no way to do that. So instead, we'll just carefully pre-scale plus with any coverage, and keep post-lerping srcover when we have 565 coverage. Change-Id: I7a7a52eec7d482e1b98bb8a01ea0a3d5e67bef65 Reviewed-on: https://skia-review.googlesource.com/38300 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* add SkTaskGroup::done()Gravatar Mike Klein2017-08-24
| | | | | | | | | | This lets you check if the work's done without blocking. Seems handy. Change-Id: Ie27c7b6fe0d01262b6a777abbc18b0de108641c0 Reviewed-on: https://skia-review.googlesource.com/38120 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Validate rrect type in SkRRect::isValidGravatar Adrienne Walker2017-08-23
| | | | | | | | Bug: chromium: 758161 Change-Id: I2472ff59af2fab05d94d88d5effb44828e8a5132 Reviewed-on: https://skia-review.googlesource.com/37800 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Revert "Consolidate SkRasterPipelineBlitter blendmode construction"Gravatar Florin Malita2017-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 19bf2b3a645c9e4129ee72e26541c4edea708393. Reason for revert: not going to cover all cases Original change's description: > Consolidate SkRasterPipelineBlitter blendmode construction > > Only blitAntiH & blitMask/kA8 for now, but hopefully we can extend for > blitRect & blitMask/kLCD16 also. > > Change-Id: I5e888d49c0c11f2f1fc595dbfb382044fc224edc > Reviewed-on: https://skia-review.googlesource.com/37542 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Florin Malita <fmalita@chromium.org> TBR=mtklein@google.com,fmalita@chromium.org Change-Id: Ibd007bbc76f1bf8ec34998cc6ccb6b842792034c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/37860 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Consolidate SkRasterPipelineBlitter blendmode constructionGravatar Florin Malita2017-08-23
| | | | | | | | | | Only blitAntiH & blitMask/kA8 for now, but hopefully we can extend for blitRect & blitMask/kLCD16 also. Change-Id: I5e888d49c0c11f2f1fc595dbfb382044fc224edc Reviewed-on: https://skia-review.googlesource.com/37542 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* add compile-time not-supported checks to runtime CPU checksGravatar Mike Klein2017-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to call Init_ssse3() if we know Skia's built globally with SSSE3. And there's definitely no reason to call Init_ssse3() if Skia's build globally with SSE4.1+. These are the only places the Init_foo() methods are called, and those in turn are the only places that refer to their optimized routines, so guarding like this allows redundant routines to be dead-code stripped by the linker. There are still situations where we end up with two copies of the same routine, compiled at _the same_ optimization level. If you're on a Mac and have SSSE3 or SSE4.1 as your global baseline instruction set, you'll get two copies, one from SkOpts.o's defaults, and one from SkOpts_{ssse3,sse41}.o's "better" routines. I'm still thinking about how to best fix this. Might just be as simple as removing "static" and letting the linker dedup. This cuts off about 70K of code on a build of ok. Change-Id: Ia349d2c5299072bbd43966132798500de059b9ca Reviewed-on: https://skia-review.googlesource.com/37600 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove code associated with legacy affine imageshadersGravatar Mike Reed2017-08-23
| | | | | | | | | | | requires https://skia-review.googlesource.com/c/33180 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Bug: skia: Change-Id: I226e120cc5aebe393bda8bc069e7927fdc981a0e Reviewed-on: https://skia-review.googlesource.com/36800 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Fix poor handling of nullptr for new blur codeGravatar Herb Derby2017-08-22
| | | | | | | | | BUG=chromium:749147 Change-Id: I2d4259805300c3f5ed9d25e142e9f12570c59781 Reviewed-on: https://skia-review.googlesource.com/37121 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Don't validate() in ~SkPathRefGravatar Adrienne Walker2017-08-22
| | | | | | | | | | | | | | | | | If an SkPathRef is constructed from arbitrary memory, it might not be valid. However, any SkPathRef should be able to be destroyed cleanly. An alternative to this would be to have CreateFromBuffer always do the validation (even in release builds), return null for invalid ones, and do the cleanup itself, but this seems like extra complication and maybe not something general release builds want. Bug: chromium: 752755 Change-Id: I1d509a5d5d0b173c20162ff79d731d6c8b4b6fb4 Reviewed-on: https://skia-review.googlesource.com/37321 Commit-Queue: Adrienne Walker <enne@chromium.org> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Deinline methods of SkClipStack::ElementGravatar Brian Salomon2017-08-22
| | | | | | | Change-Id: Id234acc00d04cd9f3321b954902b83c4fd103c46 Reviewed-on: https://skia-review.googlesource.com/36740 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Remove SK_SUPPORT_LEGACY_BILERP2 dead codeGravatar Florin Malita2017-08-22
| | | | | | | | | Flag no longer defined. Change-Id: I4b4aa33ecd23b485cf80d79882f52da96c82a567 Reviewed-on: https://skia-review.googlesource.com/36822 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* use rasterpipeline if localmatrix is rotated or skewed for imagesGravatar Mike Reed2017-08-21
| | | | | | | | | Bug: skia: Change-Id: Ib269b5b9d79b055fe614aaacfd7e0d05d48f6085 Reviewed-on: https://skia-review.googlesource.com/33180 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Make texture created by SkColorSpaceXformImageGenerator be the right sizeGravatar Brian Salomon2017-08-18
| | | | | | | | | Previously it was the size of the original image with the subset contents at the top left. Change-Id: I9a50e44e5666acb06d9c3cfbb850c31e52a9e405 Reviewed-on: https://skia-review.googlesource.com/36441 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add SK_API to SkOverdrawCanvas and SkOverdrawColorFilter.Gravatar Sadrul Habib Chowdhury2017-08-18
| | | | | | | | | | | | The SkiaRenderer in chromium is going to use the overdraw canvas and filter for measuring overdraw. Move these headers out of src/ into include/. Bug: chromium:704285 Change-Id: I2abb1671b73e3d26552462cf700340a7e3b874f0 Reviewed-on: https://skia-review.googlesource.com/36160 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Remove uses of sk_throw.Gravatar Ben Wagner2017-08-17
| | | | | | | | | | | The sk_throw macro is now an alias to SK_ABORT, but is often used when other macros better describe the situation. This change replaces sk_throw with SK_ABORT or SkASSERT_RELEASE as appropriate. Change-Id: I313facc6d535c8e8bec90ceeaf17ae3a381c48f3 Reviewed-on: https://skia-review.googlesource.com/35882 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* If a conic contains any infinite points, abort chopping to quads.Gravatar Stephen White2017-08-17
| | | | | | | | | | | Otherwise bad things (asserts, bogus data, dogs and cats living together, mass hysteria). Bug: 755043 Change-Id: I64cd1dacf553463f18babcb24deb2be08c762c67 Reviewed-on: https://skia-review.googlesource.com/35730 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
* Add atrace events for bitmap uploads to Android framework builds.Gravatar Derek Sollenberger2017-08-17
| | | | | | | Change-Id: I736d82ab4ab66860a03f839bedc4f7614d38c6e6 Reviewed-on: https://skia-review.googlesource.com/35840 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Revert "Switched highp float to highfloat and mediump float to half."Gravatar Brian Salomon2017-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 88d99c63878c2d3d340120f0321676f72afcb4f0. Reason for revert: Believed to be causing unit test failures in Chrome roll: https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/364433 https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.android%2Flinux_android_rel_ng%2F364433%2F%2B%2Frecipes%2Fsteps%2Fcontent_browsertests__with_patch__on_Android%2F0%2Flogs%2FWebRtcCaptureFromElementBrowserTest.VerifyCanvasWebGLCaptureColor%2F0 Original change's description: > Switched highp float to highfloat and mediump float to half. > > The ultimate goal is to end up with "float" and "half", but this > intermediate step uses "highfloat" so that it is clear if I missed a > "float" somewhere. Once this lands, a subsequent CL will switch all > "highfloats" back to "floats". > > Bug: skia: > Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca > Reviewed-on: https://skia-review.googlesource.com/31000 > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com Change-Id: I8bfa97547ac3920d433665f161d27df3f15c83aa No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/35705 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Switched highp float to highfloat and mediump float to half.Gravatar Ethan Nicholas2017-08-16
| | | | | | | | | | | | | The ultimate goal is to end up with "float" and "half", but this intermediate step uses "highfloat" so that it is clear if I missed a "float" somewhere. Once this lands, a subsequent CL will switch all "highfloats" back to "floats". Bug: skia: Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca Reviewed-on: https://skia-review.googlesource.com/31000 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Replace SkFAIL with SK_ABORT.Gravatar Ben Wagner2017-08-16
| | | | | | | | | | | | SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically changes uses of SkFAIL to SK_ABORT in preparation for its removal. The related sk_throw macro will be changed independently, due to needing to actually clean up its users. Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb Reviewed-on: https://skia-review.googlesource.com/35284 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Cleanup tracing macros for use by the Android frameworkGravatar Derek Sollenberger2017-08-16
| | | | | | | Change-Id: I1b918cc55a5faba1e5c1e02ffeda5d5713866edd Reviewed-on: https://skia-review.googlesource.com/35282 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Use SkSafeMath to calculate memory sizes.Gravatar Herb Derby2017-08-16
| | | | | | | | | BUG=chromium:749147 Change-Id: I07d18e089be1138ad83bfde392c7daf2d01d388c Reviewed-on: https://skia-review.googlesource.com/34747 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Fix bogus math in object allocation.Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | When a size_t is convert from a very large number to ptrdiff_t, it becomes negative causing the existing block to be used instead of allocating a new block. Remove broken test from last try. TBR=bungeman@google.com BUG=chromium:744109 Change-Id: Ifc81bb8f416d64f640730c66bce56a8e4c677173 Reviewed-on: https://skia-review.googlesource.com/35080 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Fix bogus math in object allocation."Gravatar Florin Malita2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0bc4d60fe0a1ceae6dde0103c3fdf78ee1673ffa. Reason for revert: https://chromium-swarm.appspot.com/task?id=38007b6df51fef10&refresh=10 terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Caught signal 6 [Aborted], was running: 8888 image scanline_kNonNative_premul interlaced3.png unit test ArenaAllocReallyBigAlloc unit test ClampRange 565 image scaled_codec_premul_0.200 interlaced3.png_0.200 unit test ClipStack Likely culprit: unit test ArenaAllocReallyBigAlloc Stack trace: /mnt/pd0/s/w/ir/out/Debug/dm(+0x2381c1) [0x567aa1c1] linux-gate.so.1(__kernel_sigreturn+0) [0xf770cca0] linux-gate.so.1(__kernel_vsyscall+0x9) [0xf770cc89] /lib/i386-linux-gnu/libc.so.6(gsignal+0xb0) [0xf7027dc0] /lib/i386-linux-gnu/libc.so.6(abort+0x157) [0xf7029287] /usr/lib/i386-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x16f) [0xf729d2ff] /usr/lib/i386-linux-gnu/libstdc++.so.6(+0x71ea4) [0xf729aea4] /usr/lib/i386-linux-gnu/libstdc++.so.6(+0x71f1d) [0xf729af1d] /usr/lib/i386-linux-gnu/libstdc++.so.6(__cxa_rethrow+0) [0xf729b1d0] /usr/lib/i386-linux-gnu/libstdc++.so.6(+0x727ff) [0xf729b7ff] /usr/lib/i386-linux-gnu/libstdc++.so.6(_Znaj+0x18) [0xf729b898] /mnt/pd0/s/w/ir/out/Debug/dm(_ZN12SkArenaAlloc11ensureSpaceEjj+0xa0) [0x56f113a6] /mnt/pd0/s/w/ir/out/Debug/dm(+0x3c2462) [0x56934462] /mnt/pd0/s/w/ir/out/Debug/dm(+0x239acb) [0x567abacb] /mnt/pd0/s/w/ir/out/Debug/dm(+0x239bdc) [0x567abbdc] /mnt/pd0/s/w/ir/out/Debug/dm(+0xa6417b) [0x56fd617b] /mnt/pd0/s/w/ir/out/Debug/dm(_ZNKSt8functionIFvvEEclEv+0x20) [0x56f10504] /mnt/pd0/s/w/ir/out/Debug/dm(_ZN12SkThreadPool4LoopEPv+0x298) [0x56f10bdb] /mnt/pd0/s/w/ir/out/Debug/dm(+0xb39700) [0x570ab700] /lib/i386-linux-gnu/libpthread.so.0(+0x627a) [0xf76df27a] /lib/i386-linux-gnu/libc.so.6(clone+0x66) [0xf70e3b56] Aborted Command exited with code 134 Original change's description: > Fix bogus math in object allocation. > > When a size_t is convert from a very large number to ptrdiff_t, it > becomes negative causing the existing block to be used instead of > allocating a new block. > > BUG=chromium:744109 > > Change-Id: I0bf98e3fb924851c162f6eca43d29a3f40dc9eaa > Reviewed-on: https://skia-review.googlesource.com/34541 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Herb Derby <herb@google.com> TBR=bungeman@google.com,herb@google.com Change-Id: I8ce2b45d13178395247dabd7af6853354399721c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:744109 Reviewed-on: https://skia-review.googlesource.com/35000 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Fix bogus math in object allocation.Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | When a size_t is convert from a very large number to ptrdiff_t, it becomes negative causing the existing block to be used instead of allocating a new block. BUG=chromium:744109 Change-Id: I0bf98e3fb924851c162f6eca43d29a3f40dc9eaa Reviewed-on: https://skia-review.googlesource.com/34541 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Skip bilerp for integral-translate-only matrices (!clamp-clamp case)Gravatar Florin Malita2017-08-15
| | | | | | | | | | | | | | | | We've landed https://skia-review.googlesource.com/24126 to restore this optimization, but we check too late: for non-clamp/clamp cases we'd already adjusted the matrix scale, so the optimization never kicks in. Relocate the integral translation check before all other matrix adjustments. BUG=chromium:744674 Change-Id: I395d327c3ddf74dc6d23bb8aee782ec62a7373f1 Reviewed-on: https://skia-review.googlesource.com/34840 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* Add an average mode for sigma < 2Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | | The original code had an optimization when sigma < 2 that averaged pixels instead of Gaussian bluring them. This CL adds that behavior back to the new implementation. Add the flag SK_LEGACY_USE_GAUSS_FOR_SMALL_RADII to control the new behavior. BUG=chromium:745290 Change-Id: I6e7417ce7f42949f88376b549743a9f047667f09 Reviewed-on: https://skia-review.googlesource.com/34624 Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Revert "Revert "Revert "Add an average mode for sigma < 2"""Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f6975ea5fb178c572cf4c1cd255e5fe623418d45. Reason for revert: Did not take into account there are layout test problems too. Adding a legacy flag. Original change's description: > Revert "Revert "Add an average mode for sigma < 2"" > > We are going to have the google3 auto roller build the CL, > and add the fixes to the failing tests to that CL. Because > these are scuba changes, this should be simpler. > > This reverts commit 8e7503195c40492df6a9c072d3303c9df9ec32dc. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Revert "Add an average mode for sigma < 2" > > > > This reverts commit ba8275148ab8b10393b053e2586b852796c4afc2. > > > > Reason for revert: layout tests, Google3 equivalent failing. > > > > Original change's description: > > > Add an average mode for sigma < 2 > > > > > > The original code had an optimization when sigma < 2 that averaged > > > pixels instead of Gaussian bluring them. This CL adds that > > > behavior back to the new implementat. > > > > > > BUG=chromium:745290 > > > Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1 > > > Reviewed-on: https://skia-review.googlesource.com/34180 > > > Commit-Queue: Herb Derby <herb@google.com> > > > Reviewed-by: Mike Klein <mtklein@chromium.org> > > > > TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com > > > > Change-Id: Ie8f38b042acec42260913cb7bed5538a2c957e9b > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: chromium:745290 > > Reviewed-on: https://skia-review.googlesource.com/34640 > > Reviewed-by: Mike Klein <mtklein@google.com> > > Commit-Queue: Mike Klein <mtklein@google.com> > > TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com > > Change-Id: I5f7b706a2f8c8d52b3576c638ecddf12a1652031 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: chromium:745290 > Reviewed-on: https://skia-review.googlesource.com/34641 > Reviewed-by: Herb Derby <herb@google.com> > Commit-Queue: Herb Derby <herb@google.com> TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com Change-Id: I9064f8494e5a1a4a78dd545697e22f52985c0fa1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:745290 Reviewed-on: https://skia-review.googlesource.com/34623 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Revert "Add an average mode for sigma < 2""Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are going to have the google3 auto roller build the CL, and add the fixes to the failing tests to that CL. Because these are scuba changes, this should be simpler. This reverts commit 8e7503195c40492df6a9c072d3303c9df9ec32dc. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Add an average mode for sigma < 2" > > This reverts commit ba8275148ab8b10393b053e2586b852796c4afc2. > > Reason for revert: layout tests, Google3 equivalent failing. > > Original change's description: > > Add an average mode for sigma < 2 > > > > The original code had an optimization when sigma < 2 that averaged > > pixels instead of Gaussian bluring them. This CL adds that > > behavior back to the new implementat. > > > > BUG=chromium:745290 > > Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1 > > Reviewed-on: https://skia-review.googlesource.com/34180 > > Commit-Queue: Herb Derby <herb@google.com> > > Reviewed-by: Mike Klein <mtklein@chromium.org> > > TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com > > Change-Id: Ie8f38b042acec42260913cb7bed5538a2c957e9b > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: chromium:745290 > Reviewed-on: https://skia-review.googlesource.com/34640 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com Change-Id: I5f7b706a2f8c8d52b3576c638ecddf12a1652031 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:745290 Reviewed-on: https://skia-review.googlesource.com/34641 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Add an average mode for sigma < 2"Gravatar Mike Klein2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ba8275148ab8b10393b053e2586b852796c4afc2. Reason for revert: layout tests, Google3 equivalent failing. Original change's description: > Add an average mode for sigma < 2 > > The original code had an optimization when sigma < 2 that averaged > pixels instead of Gaussian bluring them. This CL adds that > behavior back to the new implementat. > > BUG=chromium:745290 > Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1 > Reviewed-on: https://skia-review.googlesource.com/34180 > Commit-Queue: Herb Derby <herb@google.com> > Reviewed-by: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com Change-Id: Ie8f38b042acec42260913cb7bed5538a2c957e9b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:745290 Reviewed-on: https://skia-review.googlesource.com/34640 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Add an average mode for sigma < 2Gravatar Herb Derby2017-08-14
| | | | | | | | | | | | The original code had an optimization when sigma < 2 that averaged pixels instead of Gaussian bluring them. This CL adds that behavior back to the new implementat. BUG=chromium:745290 Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1 Reviewed-on: https://skia-review.googlesource.com/34180 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Record SkCanvas::flush().Gravatar Mike Klein2017-08-14
| | | | | | | | | | We can record multiple frames in an .skp by recording SkCanvas::flush(). This should make SkPictures, SkLiteDL, and .skp files all record flush(). Change-Id: I6cf6e0e4ef993530d9f92fa168a53702ffce7d5e Reviewed-on: https://skia-review.googlesource.com/34081 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix tracing macros for framework buildsGravatar Brian Osman2017-08-14
| | | | | | | | Bug: skia: Change-Id: Ia5c27af2c8dafd5d6f2171fa82f435dbfdebd346 Reviewed-on: https://skia-review.googlesource.com/33760 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Guard AA change to wait for rebaselinesGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We use SK_SUPPORT_LEGACY_DELTA_AA to guard the golden image change. Such flag is defined for Android, Chrome, and Google3 so our auto-rollers should all be OK. TBR: bungeman@google.com Bug: skia:6947 Change-Id: Ic2705e82f4f7f15ec08499254dce75b93d41727e Reviewed-on: https://skia-review.googlesource.com/33762 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* SkSafeMath for tracking size_t overflowGravatar Herb Derby2017-08-11
| | | | | | | | | | | | | | Do multiply (mul) and add while tracking that the calculation does not overflow, which can be checked with ok(). The new unit test shows a couple examples. Author: Herb Derby <herb@google.com> Change-Id: I7e67671d2488d67f21d47d9618736a6bae8f23c3 Reviewed-on: https://skia-review.googlesource.com/33721 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Don't store clipped x which could break edge orderGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We only need to clip a temporary x to ensure that we don't blit beyond clip. Storing such clipped x is problematic because it may make our edges unsorted. The added unit test would fail without this fix. Bug: skia:6947 Change-Id: I6c21d7c7c097e50fef18ab151921d6c07c089318 Reviewed-on: https://skia-review.googlesource.com/33420 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Much lower overhead Skia event tracing in the frameworkGravatar Brian Osman2017-08-11
| | | | | | | | Bug: skia: Change-Id: I0172e9e74898fb615cbb0ac61e46cbf9012ae75b Reviewed-on: https://skia-review.googlesource.com/33262 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.Gravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008 Reviewed-on: https://skia-review.googlesource.com/32760 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Expose SkPath validation as booleanGravatar Adrienne Walker2017-08-10
| | | | | | | | | | | | | | | | As a part of serializing SkPaths, I want to be able to know (without asserting) whether or not a path is valid so that I can discard potentially malicious deserialized paths. Currently, SkPath(Ref) both just have asserting validation functions which can't be used externally. This patch adds accessors that don't assert. Bug: chromium:752755 skia:6955 Change-Id: I4d0ceb31ec660b87e3fda438392ad2b60a27a0da Reviewed-on: https://skia-review.googlesource.com/31720 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Bypass libandroid dynamic linking for ATrace in framework buildsGravatar Brian Osman2017-08-10
| | | | | | | | | | | | | | | These symbols were resolving, but weren't really connected to systrace on Android. Using the macros/functions allows this to work correctly. This change doesn't actually cause anything to happen in framework builds - that still requires installing an instance of SkATrace, but now doing so will route all of Skia's TRACE_EVENT macros to systrace. Bug: skia: Change-Id: I6d2eafac7ef2531ba92094b92f68e59e0490ef62 Reviewed-on: https://skia-review.googlesource.com/33400 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Some performance tweaks for DAAGravatar Yuqian Li2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | 1. Always inline (Clang previously ignored inline and got 25% slower) 2. SIMD everywhere other than x86 gcc: non-SIMD is only faster in my desktop with gcc; with Clang on my desktop, SIMD is 50% faster than non-SIMD. 3. Allocate 4x memory instead of 2x when running out of space: on old Android devices with Linux kernel 3.10 (e.g., Nexus 6P, 5X), the alloc/memcpy will triger a major bottleneck in kernel (30% of the running time). Such bottleneck goes away (the kernel is no longer doing stupid things during alloc/memcpy) in Linux kernel 3.18 (e.g., Pixel), and that's why DAA is much faster on Pixel than on Nexus 6P. I think maybe I should adopt SkRasterPipeline for device-specific optimizations. Bug: skia: Change-Id: I0408aa7671a5f1b39aad3bec25f8fc994ff5a1bb Reviewed-on: https://skia-review.googlesource.com/30820 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Replace interp() with clut_{3,4}D stages.Gravatar Mike Klein2017-08-10
| | | | | | | | | | | | | | | I tried to follow exactly the same strategy as a start. (Though I did fix the off-by-one dimensions.) It does rather look like we only need 3D and 4D now that I've looked at the call sites. Looks like about a 20% speedup. Change-Id: I8b1af64750ad1750716ee1ab0767e64591c7206a Reviewed-on: https://skia-review.googlesource.com/32842 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* No chop at y extrema for cubicsGravatar Yuqian Li2017-08-09
| | | | | | | | | | | | | | | | | | The new Delta AA scan converter does not need the edge to be updated with monotonic Y so chopping at y extrema is not necessary. Removing such chopping brings ~10% performance increase to chalkboard.svg which has tons of small cubics (the same is true for many svgs I saw). We didn't remove the chopping for quads because that does not bring a significant speedup. Moreover, dropping those y extremas would make our strokecircle animation look a little more wobbly (because we would have fewer divisions for the quads at the top and bottom of the circle). Bug: skia: Change-Id: I3984d2619f9f77269ed24e8cbfa9f1429ebca4a8 Reviewed-on: https://skia-review.googlesource.com/31940 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove SkColorLookUpTable::interp3D().Gravatar Mike Klein2017-08-09
| | | | | | | | | | It looks like our recursive approach is faster than interp3D(), and we'd prefer trilinear interpolation over tetrahedral for quality. Change-Id: I1019254b9ecf24b2f4feff17ed8ae1b48fcc281e Reviewed-on: https://skia-review.googlesource.com/32800 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Move gFDot6INVERSE definition to cpp fileGravatar Yuqian Li2017-08-09
| | | | | | | | Bug: skia:6946 Change-Id: Iee029a73ae899b0f73910b45c7cf83bd37dc07c3 Reviewed-on: https://skia-review.googlesource.com/32840 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* add gamma stageGravatar Mike Klein2017-08-09
| | | | | | | | | | | | | | | | Until now we've been using 3 separate parametric stages to apply gamma to r,g,b. That works fine, but is kind of unnecessarily slow, and again less clear in a stack trace than seeing "gamma". The new bench runs in about 60% of the time the old one does on my Trashcan. BUG=skia:6939 Change-Id: I079698d3009b081f1c23a2e27fc26e373b439610 Reviewed-on: https://skia-review.googlesource.com/32721 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* use rasterpipeline for images if matrix is >= scale+translateGravatar Mike Reed2017-08-08
| | | | | | | | | Bug: skia: Change-Id: I36112fe54c6f2d0965d0b88f0291d7ffe0902715 Reviewed-on: https://skia-review.googlesource.com/30480 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* rewrite SkColorLookUpTable::interpDimension()Gravatar Mike Klein2017-08-08
| | | | | | | | | | | | - Avoid calling floor() and ceil(), which are real external calls on most platforms. - Interpolate all output channels in parallel. - Simplify recursion, allow the compiler to unroll. Change-Id: I9ef814e91b18c5775292ca20e9ec01222b6a89cf Reviewed-on: https://skia-review.googlesource.com/32182 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>