aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* SkLeanWindows.h: #include "Windows.h" fewer placesGravatar halcanary2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | $ git grep -l '<windows.h>' include src include/private/SkLeanWindows.h $ git grep -l SkLeanWindows.h | grep '\.h$' include/ports/SkTypeface_win.h include/utils/win/SkHRESULT.h include/utils/win/SkTScopedComPtr.h include/views/SkEvent.h src/core/SkMathPriv.h src/ports/SkTypeface_win_dw.h src/utils/SkThreadUtils_win.h src/utils/win/SkWGL.h The same for `#include <intrin.h>` that was found in SkMath.h. Those functions that needed it are moved to SkMathPriv.h. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041943002 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng Review-Url: https://codereview.chromium.org/2041943002
* Revert of Move immintrin/arm_neon includes to where they are used. (patchset ↵Gravatar mtklein2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #2 id:20001 of https://codereview.chromium.org/2045633002/ ) Reason for revert: Appears to have broken the ARMv7 aspect of the Google3 roll in bizarre seemingly-unrelated ways. Original issue's description: > Move immintrin/arm_neon includes to where they are used. > > On my Mac (so, immintrin), this improves compile time, both wall and cpu, > by about 16%. To test I ran this on an SSD with files hot in their caches: > > $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \ > ninja -C out/Release -t clean && \ > time ninja -C out/Release > > Before: 159 wall / 3367 cpu > 159 wall / 3368 cpu > > After: 137 wall / 2860 cpu > 136 wall / 2863 cpu > > I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc. > That made no signficant difference, so I've kept immintrin for its simplicity. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002 > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > TBR=reed@google.com > No public API changes. > > Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a TBR=herb@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2046213002
* Fix dashing bug where hwaa was unintentionally disabledGravatar csmartdalton2016-06-07
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046483003 Review-Url: https://codereview.chromium.org/2046483003
* Switch to a whitelist for manual mip-map generationGravatar brianosman2016-06-07
| | | | | | | | | | | | | Due to performance regression on various GPUs, we're only going to use the new draw-call based mip-mapper when necessary. Of the bots where we have test coverage, that means Intel and Mac-NVIDIA. We also had failures on our AMD 7770 bots - I'm upgrading the drivers on those two machines, and I'm leaving them out of the whitelist for now. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2042313002 Review-Url: https://codereview.chromium.org/2042313002
* Fix for rare crash in Poly::addEdge().Gravatar senorblanco2016-06-07
| | | | | | | | | | | | Don't add an edge if the bottom vertex was already added, or if an island vertex has a left poly but no right poly. (Sorry for the lack of test, but the only reduction I could create was still a huge path and only crashes in Chrome.) BUG=617907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2043873005 Review-Url: https://codereview.chromium.org/2043873005
* Make GrShape use the original path when path effect fails.Gravatar bsalomon2016-06-07
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2044793002 Review-Url: https://codereview.chromium.org/2044793002
* linear -> sRGB: use fast approximate sqrt()Gravatar mtklein2016-06-07
| | | | | | | | | | | | | | | | Since we're already approximating the sRGB gamma curve with a sqrt(), we might as well approximate with it a faster approximate sqrt(). On Intel, this .rsqrt().invert() version is 2-3x faster than .sqrt() (~3x faster on older machines, ~2x faster on newer machines). This should provide ~11 bits of precision, suspiciously exactly enough. Running dm --config srgb, there are diffs, but none perceptible. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046063002 Review-Url: https://codereview.chromium.org/2046063002
* Move immintrin/arm_neon includes to where they are used.Gravatar mtklein2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | On my Mac (so, immintrin), this improves compile time, both wall and cpu, by about 16%. To test I ran this on an SSD with files hot in their caches: $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \ ninja -C out/Release -t clean && \ time ninja -C out/Release Before: 159 wall / 3367 cpu 159 wall / 3368 cpu After: 137 wall / 2860 cpu 136 wall / 2863 cpu I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc. That made no signficant difference, so I've kept immintrin for its simplicity. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot TBR=reed@google.com No public API changes. Review-Url: https://codereview.chromium.org/2045633002
* Refactor creation of GrVkRenderPasses to make them move generalGravatar egdaniel2016-06-07
| | | | | | | | | | | | | | | | | | | | | This change is a refactorization to open up more flexable use for render passes in the future. Once we start bundling draw calls into a single render pass we will need to start using specific load and store ops instead of the default currently of load and store everything. We still will need to simply get a compatible render pass for creation of framebuffers and pipeline objects. These render passes don't need to know load and store ops. Thus in this change, I'm defaulting the "compatible" render pass to always be the one which both loads and stores. All other load/store combinations will be created lazily when requested for a specific draw (future change). The CompatibleRPHandle is a way for us to avoid analysing the RenderTarget every time we want to get a new GrVkRenderPass. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1977403002 Review-Url: https://codereview.chromium.org/1977403002
* Make GrDashEffect take a AA mode enum.Gravatar bsalomon2016-06-07
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2042923003 Review-Url: https://codereview.chromium.org/2042923003
* Get segment masks from GrShape.Gravatar bsalomon2016-06-07
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046753002 Review-Url: https://codereview.chromium.org/2046753002
* Make GrShape track the winding direction and starting point for rrect types.Gravatar bsalomon2016-06-06
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2042813002 Review-Url: https://codereview.chromium.org/2042813002
* Add new SkSourceGammaTreatment enum, used in situations like mipmap ↵Gravatar brianosman2016-06-06
| | | | | | | | | construction, where we need to know if we should respect (vs. ignore) the gamma encoding of sRGB tagged images. Plumb that extensively. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2037413002 Review-Url: https://codereview.chromium.org/2037413002
* Add SkDefaultXform as a catch-all to handle color conversionsGravatar msarett2016-06-06
| | | | | | | | | | | I'd like to start optimizing the common case for color xforms, but before doing that, I think it makes sense to have correct code to support all xforms. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2038823002 Review-Url: https://codereview.chromium.org/2038823002
* Use Options object passed to startScanlineDecodeGravatar scroggo2016-06-06
| | | | | | | | | | This->options() has not been updated to include the latest settings. Originally brought up in crrev.com/1997703003, which has been reverted. This is not really related to that change anyway, so separating it out. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2046493004 Review-Url: https://codereview.chromium.org/2046493004
* Revert of Make SkPngCodec decode progressively. (patchset #26 id:520001 of ↵Gravatar scroggo2016-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1997703003/ ) Reason for revert: Still causing problems in Google3, e.g. https://test.corp.google.com/ui#cl=124138817&flags=CAMQBQ==&id=OCL:124138817:BASE:124139560:1465227435491:219ffbdb&t=//third_party/skia/HEAD:dm Original issue's description: > Make SkPngCodec decode progressively. > > This is a step towards using SkCodec in Chromium, where progressive > decoding is necessary. > > Switch from using png_read_row (which expects all the data to be > available) to png_process_data, which uses callbacks when rows are > available. > > Create a new API for SkCodec, which supports progressive decoding and > scanline decoding. Future changes will switch the other clients off of > startScanlineDecode and get/skip-Scanlines to the new API. > > Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced > PNG images. In the new API, interlaced PNG fits kTopDown. Also remove > updateCurrScanline(), which was only used by the old implementation for > interlaced PNG. > > DMSrcSink: > - In CodecSrc::kScanline_Mode, use the new method for scanline decoding > for the supported formats (just PNG and PNG-in-ICO for now). > > fuzz.cpp: > - Remove reference to kNone_ScanlineOrder > > SkCodec: > - Add new APIs: > - startIncrementalDecode > - incrementalDecode > - Remove kNone_SkScanlineOrder and updateCurrScanline() > > SkPngCodec: > - Implement new APIs > - Switch from sk_read_fn/png_read_row etc to png_process_data > - Expand AutoCleanPng's role to decode the header and create the > SkPngCodec > - Make the interlaced PNG decoder report how many lines were > initialized during an incomplete decode > - Make initializeSwizzler return a bool instead of an SkCodec::Result > (It only returned kSuccess or kInvalidInput anyway) > > SkIcoCodec: > - Implement the new APIs; supported for PNG in ICO > > SkSampledCodec: > - Call the new method for decoding scanlines, and fall back to the old > method if the new version is unimplemented > - Remove references to kNone_SkScanlineOrder > > tests/CodecPartial: > - Add a test which decodes part of an image, then finishes the decode, > and compares it to the straightforward method > > tests/CodecTest: > - Add a test which decodes all scanlines using the new method > - Repurpose the Codec_stripes test to decode using the new method in > sections rather than all at once > - In the method check(), add a parameter for whether the image supports > the new method of scanline decoding, and be explicit about whether an > image supports incomplete > - Test incomplete PNG decodes. We should have been doing it anyway for > non-interlaced (except for an image that is too small - one row), but > the new method supports interlaced incomplete as well > - Make test_invalid_parameters test the new method > - Add a test to ensure that it's safe to fall back to scanline decoding without > rewinding > > BUG=skia:4211 > > The new version was generally faster than the old version (but not significantly so). > > Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/ > > Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/ > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003 > > Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e > > Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965 > > Committed: https://skia.googlesource.com/skia/+/6fb2391b2cc83ee2160b4e994faa8128975acc1f TBR=reed@google.com,msarett@google.com,scroggo@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=skia:4211 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2044573002 Review-Url: https://codereview.chromium.org/2044573002
* Gamma sanity checksGravatar msarett2016-06-06
| | | | | | | | | | | (1) Make load_gammas() return false on invalid gammas. (2) Assert that gamma always exists after loading. (3) Avoid dividing by zero. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2043803002 Review-Url: https://codereview.chromium.org/2043803002
* Name parametric gamma curve typesGravatar msarett2016-06-06
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041753004 Review-Url: https://codereview.chromium.org/2041753004
* Remove GrRenderTarget from GrPipelineBuilderGravatar robertphillips2016-06-06
| | | | | | | | | | | | | | | | This used to be "Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder" but has been split into: https://codereview.chromium.org/1993263002/ (Make GrAppliedClip friendless) https://codereview.chromium.org/1997773002/ (Retract GrRenderTarget from GLProgramsTest) https://codereview.chromium.org/1993403002/ (GrSWMaskHelper and GrSoftwarePathRenderer only need the textureProvider (not GrContext)) https://codereview.chromium.org/2004433002/ (Retract GrRenderTarget from GrTestTarget) https://codereview.chromium.org/2015333002/ (Change parameters to GrPipelineBuilder's ctor) https://codereview.chromium.org/2035823002/ (Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1988923002 Review-Url: https://codereview.chromium.org/1988923002
* MIPS32r2: Fix Chromium runtime crashGravatar milko.leporis2016-06-05
| | | | | | | | | | | | | | | | | | Crash is caused by ldxc1 instruction, which traps when double values are not aligned on 8-byte boundaries. Problem was tracked to SkChunkAlloc which produces pointers aligned on 4-byte boundaries leading to misalignment. This change makes sure that SkChunkAlloc will produce pointers that are aligned to 8 bytes. Appropriate tests are added to tests/MemsetTest.cpp TEST=Build Chromium with Clang and run on MIPS32r2 platform TEST=./out/Debug/dm --match Memset BUG=130022 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1849183004 Review-Url: https://codereview.chromium.org/1849183004
* Add the ability to handle premul and swizzle src bitmap data.Gravatar herb2016-06-04
| | | | | | | BUG=skia:5378 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2030953002 Review-Url: https://codereview.chromium.org/2030953002
* More Unref GrXPFactory.Gravatar bungeman2016-06-03
| | | | | | | | | | | Not releasing the reference was caught by the Skia asan bot. All remaining occurences of this pattern have been updated. This fixes "Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack". TBR=herb Review-Url: https://codereview.chromium.org/2037243002
* Add ability to rotate light direction in drawLitAtlas Sample slideGravatar robertphillips2016-06-03
| | | | | | | | As requested by Greg. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2032263004 Review-Url: https://codereview.chromium.org/2032263004
* Unref GrXPFactory.Gravatar bungeman2016-06-03
| | | | | | | | Not releasing the reference was caught by asan in the Chromium roll. This fixes "Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack". Review-Url: https://codereview.chromium.org/2037193002
* SkMipMap::ComputeLevelSize to return SkISizeGravatar cblume2016-06-03
| | | | | | | | | | | This previously returned SkSize, which had scalar components. That doesn't make sense for a mipmap size. R=bsalomon@google.com BUG=578304 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2036313002 Review-Url: https://codereview.chromium.org/2036313002
* Plumbing mipmaps to the point of creation.Gravatar cblume2016-06-03
| | | | | | | | | | | | When creating a DeferredTextureImage we may create mipmaps. Those mipmaps need to then be passed along for when the texture is actually created. R=bsalomon@google.com BUG=578304 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2031273002 Review-Url: https://codereview.chromium.org/2031273002
* Make GrClipMaskManager stateless and push GrPipelineBuilder construction ↵Gravatar robertphillips2016-06-03
| | | | | | | | | | | | | downstack This will be followed up with a CL to remove the GrRenderTarget from the GrPipelineBuilder. Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2035823002 Review-Url: https://codereview.chromium.org/2035823002
* Add gm for displaying different variants of 8888 bitmaps and fix a small ↵Gravatar herb2016-06-03
| | | | | | | | | rejection case for sprite blitters. BUG=skia:5378 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2036493004 Review-Url: https://codereview.chromium.org/2036493004
* SkPDF: handle unpremul rightGravatar halcanary2016-06-03
| | | | | | | . GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2037083002 Review-Url: https://codereview.chromium.org/2037083002
* Abandon offset support with texel buffersGravatar csmartdalton2016-06-03
| | | | | | | | | | | | We don't seem to require nonzero offsets for texel buffers at this point in time, and requiring this feature greatly reduces the number of desktop clients that can use texel buffers. If we find a use for offsets later we can always add it back as a separate feature. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2036953002 Review-Url: https://codereview.chromium.org/2036953002
* Support ARB extensions for indirect drawingGravatar csmartdalton2016-06-03
| | | | | | | | | | Adds support for the ARB extensions and fixes incorrect logic that was being used on the GL version for indirect drawing. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2038743002 Review-Url: https://codereview.chromium.org/2038743002
* Fix uses of SkImageInfo in BRD to preserve color space infoGravatar msarett2016-06-03
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2035483005 Review-Url: https://codereview.chromium.org/2035483005
* Make SkPngCodec decode progressively.Gravatar scroggo2016-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a step towards using SkCodec in Chromium, where progressive decoding is necessary. Switch from using png_read_row (which expects all the data to be available) to png_process_data, which uses callbacks when rows are available. Create a new API for SkCodec, which supports progressive decoding and scanline decoding. Future changes will switch the other clients off of startScanlineDecode and get/skip-Scanlines to the new API. Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced PNG images. In the new API, interlaced PNG fits kTopDown. Also remove updateCurrScanline(), which was only used by the old implementation for interlaced PNG. DMSrcSink: - In CodecSrc::kScanline_Mode, use the new method for scanline decoding for the supported formats (just PNG and PNG-in-ICO for now). fuzz.cpp: - Remove reference to kNone_ScanlineOrder SkCodec: - Add new APIs: - startIncrementalDecode - incrementalDecode - Remove kNone_SkScanlineOrder and updateCurrScanline() SkPngCodec: - Implement new APIs - Switch from sk_read_fn/png_read_row etc to png_process_data - Expand AutoCleanPng's role to decode the header and create the SkPngCodec - Make the interlaced PNG decoder report how many lines were initialized during an incomplete decode - Make initializeSwizzler return a bool instead of an SkCodec::Result (It only returned kSuccess or kInvalidInput anyway) SkIcoCodec: - Implement the new APIs; supported for PNG in ICO SkSampledCodec: - Call the new method for decoding scanlines, and fall back to the old method if the new version is unimplemented - Remove references to kNone_SkScanlineOrder tests/CodecPartial: - Add a test which decodes part of an image, then finishes the decode, and compares it to the straightforward method tests/CodecTest: - Add a test which decodes all scanlines using the new method - Repurpose the Codec_stripes test to decode using the new method in sections rather than all at once - In the method check(), add a parameter for whether the image supports the new method of scanline decoding, and be explicit about whether an image supports incomplete - Test incomplete PNG decodes. We should have been doing it anyway for non-interlaced (except for an image that is too small - one row), but the new method supports interlaced incomplete as well - Make test_invalid_parameters test the new method - Add a test to ensure that it's safe to fall back to scanline decoding without rewinding BUG=skia:4211 The new version was generally faster than the old version (but not significantly so). Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/ Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/ GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003 Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965 Review-Url: https://codereview.chromium.org/1997703003
* SkMultiPictureDocument & SkMultiPictureDocumentReaderGravatar halcanary2016-06-02
| | | | | | | | | | | | also, a new DM::Src. motivation: To be used to test the printing pipeline in Chromium. BUG=skia:5370 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2023593002 Review-Url: https://codereview.chromium.org/2023593002
* add MakeS32 helper to SkImageInfo, fix named-gamma constructor bugGravatar reed2016-06-02
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2035813003 Review-Url: https://codereview.chromium.org/2035813003
* Tessellator: stop copying vertices into Polys and Monotones.Gravatar senorblanco2016-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vertices which are produced by stage 5 of the tesselator are copied into the Polys and MonotonePolys it produces. This is necessary because each vertex may have an arbitrary valence, since it may participate in an arbitrary number of Polys, so we can't use the vertex's prev/next pointers to represent all the Monotones of which this vertex may be a member. However, each Edge can only be a member of two Polys (one on each side of the edge). So by adding two prev/next pointer pairs to each Edge, we can represent each Monotone as a list of edges instead. Then we no longer need to copy the vertices. One wrinkle is that the ear-clipping stage (6) of the tessellator does require prev/next pointers, in order to remove vertices as their ears are clipped. So we convert the edge list into a vertex list during Monotone::emit(), using the prev/next pointers temporarily for that monotone. This change improves performance by 7-20% on a non-caching version of the tessellator, and reduces memory use. Other notes: 1) Polys are initially constructed empty (no edges), but with the top vertex, which is needed for splitting Polys. Edges are added to Polys only after their bottom vertex is seen. 2) MonotonePolys are always constructed with one edge, so we always know their handedness (left/right). MonotonePoly::addEdge() no longer detects when a monotone is "done" (edge of opposite handedness); this is handled by Poly::addEdge(), so MonotonePoly::addEdge() has no return value. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2029243002 Review-Url: https://codereview.chromium.org/2029243002
* Adjust tolerance for when Ganesh stroked-line-as-rect optimization kicks inGravatar robertphillips2016-06-02
| | | | | | | | Some GPUs results look worse for the < 1.0f tolerance (i.e., iPad) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2035843002 Review-Url: https://codereview.chromium.org/2035843002
* Remove SK_SUPPORT_LEGACY_TYPEFACE_MAKE_FROM_NAME.Gravatar bungeman2016-06-02
| | | | | | | | | | The define SK_SUPPORT_LEGACY_TYPEFACE_MAKE_FROM_NAME is no longer used by any clients and the code it guards can now be removed as well. TBR=reed This just removes dead code. Review-Url: https://codereview.chromium.org/2030983002
* Exclude Mali devices from manual mip-mapping.Gravatar brianosman2016-06-02
| | | | | | | | | With manual mip-mapping, the Nexus 10 is failing the sRGB mip-map test. That suggests a failure in the sRGB implementation (decode after bilerp, possibly?). Using the driver's mip-mapper resolves the unit test issue, at least. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2036763002 Review-Url: https://codereview.chromium.org/2036763002
* Add getting the size of a given mipmap level.Gravatar cblume2016-06-02
| | | | | | | | | | | When allocating memory for mipmaps, it would be very handy to know the dimensions of a given mipmap level. R=bsalomon@google.com BUG=578304 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018283002 Review-Url: https://codereview.chromium.org/2018283002
* Add a caps bit to enable/disable the new manual mip-mapperGravatar brianosman2016-06-02
| | | | | | | | | | Turn it off on Adreno3xx devices, because the small-render-target bug on those devices leads to empty mipmaps for the smallest mips. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2026393004 Review-Url: https://codereview.chromium.org/2026393004
* Manually generated sRGB mipmaps, with successively smaller draws.Gravatar brianosman2016-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dirty GL-generated mipmaps whenever an sRGB texture is used with a new value for TEXTURE_SRGB_DECODE. Add a new test rectangle to the gamma GM that tests that textures are correctly converted to linear before filtering when generating mipmaps. Added a new unit test that alternates how a texture is interpreted (sRGB or not), to verify that we rebuild mipmaps when needed, and that we get the correct results out in both modes. This test originally failed on four of our bots producing incorrect mips in three different ways. I'm not real surprised, but it looks like we can't rely on glGenerateMipmap to do the right thing, in conjunction with TEXTURE_SRGB_DECODE. Instead, actually create mip-chains using a series of draw calls. (My first attempt used glBlitFramebuffer, and that still had bugs on several bots). This approach appears to work correctly on any device that fully supports sRGB. Because the mipmap draws are fairly destructive to state, I had to hoist them out of bindTexture. That means adding a second pass over the texture accesses in the processor, at the very beginning of flush. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1840473002 Review-Url: https://codereview.chromium.org/2007973002
* Handle stroked single line special case in GaneshGravatar robertphillips2016-06-02
| | | | | | | | | | | | | This CL roughly halves the time spent on the captured stroked lines skp. On my Linux desktop it boosts the external benchmark from 2618 to 5007. This is a companion to: https://codereview.chromium.org/2019193002/ (Add new GM to exercise stroked line special case) The idea is to land the GM first so any regressions are visible. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2023693002 Review-Url: https://codereview.chromium.org/2023693002
* Add a test to ensure that a case where SkCubicClipper::ChopMonoAtY returns ↵Gravatar mbarbella2016-06-01
| | | | | | | | | | | false is handled properly. Also fixes a style issue in the fix for the issue being tested. BUG=chromium:613918 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2021343004 Review-Url: https://codereview.chromium.org/2021343004
* Create SkColorSpaceXform to handle color conversionsGravatar msarett2016-06-01
| | | | | | | | | | | | Also adds testing of qcms color correction, so we can compare SkColorSpaceXform outputs to qcms outputs. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952063002 Committed: https://skia.googlesource.com/skia/+/740cc88ee3d63c75e52d31238f2a32600cc57a8c Review-Url: https://codereview.chromium.org/1952063002
* Recognize common parametric gammaGravatar msarett2016-06-01
| | | | | | | | | | | 5% of images with ICC profiles (in my test set of 10k) have this exact gamma representation, which is very close to 2.2f. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2027413002 Review-Url: https://codereview.chromium.org/2027413002
* Fix uninit warning on valgrind bot in SkPathPriv:IsSimpleClosedRectGravatar Brian Salomon2016-06-01
| | | | | | | TBR=robertphillips@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2030713002 Review URL: https://codereview.chromium.org/2030713002 .
* Revert of Make SkPngCodec decode progressively. (patchset #24 id:480001 of ↵Gravatar scroggo2016-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1997703003/ ) Reason for revert: Still breaking Google3 e.g.: https://sponge.corp.google.com/target?id=9261d31b-34fc-4f0f-981e-f92f7c5cea2c&target=//third_party/skia/HEAD:dm#shard=1|run=1|attempt=1|page=-1 https://test.corp.google.com/ui#cl=123773095&flags=CAMQBQ==&id=OCL:123773095:BASE:123773415:1464804876959:b0ea9b1c&t=//third_party/skia/HEAD:dm Original issue's description: > Make SkPngCodec decode progressively. > > This is a step towards using SkCodec in Chromium, where progressive > decoding is necessary. > > Switch from using png_read_row (which expects all the data to be > available) to png_process_data, which uses callbacks when rows are > available. > > Create a new API for SkCodec, which supports progressive decoding and > scanline decoding. Future changes will switch the other clients off of > startScanlineDecode and get/skip-Scanlines to the new API. > > Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced > PNG images. In the new API, interlaced PNG fits kTopDown. Also remove > updateCurrScanline(), which was only used by the old implementation for > interlaced PNG. > > DMSrcSink: > - In CodecSrc::kScanline_Mode, use the new method for scanline decoding > for the supported formats (just PNG and PNG-in-ICO for now). > > fuzz.cpp: > - Remove reference to kNone_ScanlineOrder > > SkCodec: > - Add new APIs: > - startIncrementalDecode > - incrementalDecode > - Remove kNone_SkScanlineOrder and updateCurrScanline() > > SkPngCodec: > - Implement new APIs > - Switch from sk_read_fn/png_read_row etc to png_process_data > - Expand AutoCleanPng's role to decode the header and create the > SkPngCodec > - Make the interlaced PNG decoder report how many lines were > initialized during an incomplete decode > - Make initializeSwizzler return a bool instead of an SkCodec::Result > (It only returned kSuccess or kInvalidInput anyway) > > SkIcoCodec: > - Implement the new APIs; supported for PNG in ICO > > SkSampledCodec: > - Call the new method for decoding scanlines, and fall back to the old > method if the new version is unimplemented > - Remove references to kNone_SkScanlineOrder > > tests/CodecPartial: > - Add a test which decodes part of an image, then finishes the decode, > and compares it to the straightforward method > > tests/CodecTest: > - Add a test which decodes all scanlines using the new method > - Repurpose the Codec_stripes test to decode using the new method in > sections rather than all at once > - In the method check(), add a parameter for whether the image supports > the new method of scanline decoding, and be explicit about whether an > image supports incomplete > - Test incomplete PNG decodes. We should have been doing it anyway for > non-interlaced (except for an image that is too small - one row), but > the new method supports interlaced incomplete as well > - Make test_invalid_parameters test the new method > - Add a test to ensure that it's safe to fall back to scanline decoding without > rewinding > > BUG=skia:4211 > > The new version was generally faster than the old version (but not significantly so). > > Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/ > > Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/ > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003 > > Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e > > Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965 TBR=reed@google.com,msarett@google.com,scroggo@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4211 Review-Url: https://codereview.chromium.org/2026383002
* Add SkPathPriv::IsSimpleClosedRectGravatar bsalomon2016-06-01
| | | | | | | | This function looks for "simple" rect paths. Simple here means begins and ends at a corner and is closed (either manually or with a close verb). Unlike SkPath::isRect this returns the starting point index (using the same start indexing scheme as SkPath::addRect). GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2017313002 Review-Url: https://codereview.chromium.org/2017313002
* Add offset to memory allocationsGravatar jvanverth2016-06-01
| | | | | | | | | | | This is setting up for suballocations within one large allocation BUG=skia:5031 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018933004 TBR=bsalomon@google.com Review-Url: https://codereview.chromium.org/2018933004