aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* Make SkCodec support peek() and read()Gravatar scroggo2015-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Update SkCodec's dox to point out that some of the data must be read twice in order to decode - Add an accessor that reports how much is needed for reading twice - Make SkCodec default to use peek() If an input stream supports peek()ing, peek() instead of reading. This way the stream need not implement rewind() - Make SkCodec use read() + rewind() as a backup So that streams without peek() implemented can still function properly (assuming they can rewind). - read everything we may need to determine the format once In SkCodec::NewFromStream, peek()/read() 14 bytes, which is enough to read all of the types we support. Pass the buffer to each subtype, which will have enough info to determine whether it is the right type. This simplifies the code and results in less reading and rewinding. - NOTE: SkWbmpCodec needs the following number of bytes for the header + 1 (type) + 1 (reserved) + 3 (width - bytes needed to support up to 0xFFFF) + 3 (height - bytes needed to support up to 0xFFFF) = 8 - in SkWebpCodec, support using read + rewind as a backup if peek does not work. A change in Android will add peek() to JavaInputStreamAdapter. BUG=skia:3257 Review URL: https://codereview.chromium.org/1472123002
* Move texture drawing utility method to SkGpuDeviceGravatar jvanverth2015-12-08
| | | | | | BUG=skia:4542 Review URL: https://codereview.chromium.org/1506203002
* Add RTTI to all sanitizers.Gravatar herb2015-12-08
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1510843003
* Remove staging for SkImageDecoder::PeekerGravatar scroggo2015-12-08
| | | | | | | | | | Will no longer be needed once ag/817367 lands - Android will be inheriting directly from SkPngChunkReader, so no need for the intermediate. BUG=skia:4574 Review URL: https://codereview.chromium.org/1470913004
* Disable sanitizers with a blacklist.Gravatar mtklein2015-12-08
| | | | | | | | | | | | We think this might be more flexible. It allows, e.g, function-level blacklisting, and here an easy one-stop-shop blacklist for all of third_party/externals. BUG=skia: CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot NOTREECHECKS=true Review URL: https://codereview.chromium.org/1509733003
* Add sk_careful_memcpy to catch undefined behavior in memcpy.Gravatar mtklein2015-12-08
| | | | | | | | | | | | | | | | | | It's undefined behavior to pass null as src or dst to memcpy, even if len is 0. This currently triggers -fsanitize=attribute-nonnull warnings, but also can lead to very unexpected code generation with GCC. sk_careful_memcpy() checks len first before calling memcpy(), which prevents that weird undefined situation. This allows me to mark all sanitizers as no-recover, i.e. make-the-bots-red fatal. CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot BUG=skia:4641 NOTREECHECKS=true Review URL: https://codereview.chromium.org/1510683002
* Revert of default SkPixelSerializer (patchset #1 id:1 of ↵Gravatar reed2015-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1507123002/ ) Reason for revert: Breaking DEPS roll (linker error) Original issue's description: > default SkPixelSerializer > > Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. > > Add SkImageEncoder::CreatePixelSerializer() to return a > PixelSerializer that calls into SkImageEncoder::EncodeData. > > SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. > > Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b TBR=scroggo@google.com,halcanary@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1505203003
* Stop wrapping images backed by generators as bitmaps in SkGpuDevice (except ↵Gravatar bsalomon2015-12-08
| | | | | | when tiling) Review URL: https://codereview.chromium.org/1510903002
* spin off remaining integer overflow fixesGravatar mtklein2015-12-08
| | | | | | | | | | | - Carmack rsqrt uses an int where it wants a uint32_t. - turn off all santizers (including signed-integer-overflow) in third_party/externals/sftntly. CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot BUG=skia:4635 Review URL: https://codereview.chromium.org/1511643002
* Improve nvpr glyph batchingGravatar cdalton2015-12-08
| | | | | | | | | | Batches together path range draws whose view matrices differ by a simple translation by pre-translating the individual path transforms during the copy. BUG=skia: Review URL: https://codereview.chromium.org/1507203002
* Allow LCD text to batch across colorchanges. This will always useGravatar joshualitt2015-12-08
| | | | | | | | color vertices, even when we can't batch across color changes BUG=skia: Review URL: https://codereview.chromium.org/1502253003
* default SkPixelSerializerGravatar halcanary2015-12-08
| | | | | | | | | | | Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. Add SkImageEncoder::CreatePixelSerializer() to return a PixelSerializer that calls into SkImageEncoder::EncodeData. SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. Review URL: https://codereview.chromium.org/1507123002
* Remove drawPathsFromRange from GrDrawContextGravatar cdalton2015-12-08
| | | | | | | | | | Replaces drawPathsFromRange with a more general drawPathBatch method. While this still isn't perfect, it's a step in the right direction that removes the need for path range draws to fit in a public API. BUG=skia: Review URL: https://codereview.chromium.org/1506823004
* simplify the way we disable sanitizers for yasmGravatar mtklein2015-12-08
| | | | | | | | | | seems to work fine CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot BUG=skia: Review URL: https://codereview.chromium.org/1505013003
* Enable gpudft on GalaxyS3Gravatar joshualitt2015-12-08
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1509193002
* Loosen check for zero vectors in GrPathUtils::convert_noninflect_cubic_to_quadsGravatar robertphillips2015-12-08
| | | | | | | | In the repro case the conic in question has a replicated control point at the end. These points end up being slightly different by the time they get to convert_noninflect_cubic_to_quads so the initial checks for a zero vector don't fire. The following checks, in the constrainWithinTangents path, do fire however leading to a premature termination of conversion to quads. BUG=skia:4611 Review URL: https://codereview.chromium.org/1504983003
* Zero length lines may have caps, but do not need joins.Gravatar caryclark2015-12-08
| | | | | | | | | | Check to see if the point is preceeded or followed by a line with a computable tangent before adding the join. R=reed@google.com BUG=566075 Review URL: https://codereview.chromium.org/1504043002
* Make NVPR a GL context option instead of a GL contextGravatar kkinnunen2015-12-08
| | | | | | | | | | | | | | | Make NVPR a GL context option instead of a GL context. This may enable NVPR to be run with command buffer interface. No functionality change in DM or nanobench. NVPR can only be run with normal GL APIs. BUG=skia:2992 Committed: https://skia.googlesource.com/skia/+/eeebdb538d476c1bfc8b63a946094ca1b505ecd1 Review URL: https://codereview.chromium.org/1448883002
* Use correct fill type and bounds for NVPR paths that are stroked with SkiaGravatar kkinnunen2015-12-07
| | | | | | | | | | | | When using NVPR, sometimes paths must be stroked by Skia and then drawn with fill using NVPR. In these cases, use the fill type and bounds of the stroked path, not the original path. Fixes degeneratesegments for nvprmsaa backends. BUG=skia:4608 Review URL: https://codereview.chromium.org/1504753003
* SkPNGImageEncoder encodes all SkColorTypesGravatar halcanary2015-12-07
| | | | Review URL: https://codereview.chromium.org/1506663002
* Remove SK_IGNORE_GL_TEXTURE_TARGET from skia_for_chromium_defines.gypiGravatar bsalomon2015-12-07
| | | | | | This has been added to Chrome's SkUserConfig.h Review URL: https://codereview.chromium.org/1503173003
* fix funky formatting in SkNVRefCntGravatar mtklein2015-12-07
| | | | | | | | BUG=skia: TBR=reed@google.com No API change. Review URL: https://codereview.chromium.org/1505023002
* When was SkPDiff last used?Gravatar mtklein2015-12-07
| | | | | | BUG=skia:1451,skia:1463,skia:1798,skia:1859,skia:2710,skia:2711,skia:2712,skia:2713 Review URL: https://codereview.chromium.org/1502173003
* Make GrAtlasTextBlob non-virtualGravatar joshualitt2015-12-07
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1503213003
* Minor code cleanups in SkCanvas.Gravatar senorblanco2015-12-07
| | | | | | | | | | | Since the SK_SAVE_LAYER_BOUNDS_ARE_FILTERED path is long gone from SkCanvas, remove or localize some temporary variables. Cleanup only; no user-visible changes. BUG=skia: Review URL: https://codereview.chromium.org/1508823002
* SkPixelSerializer: support indexed pixelsGravatar halcanary2015-12-07
| | | | | | By taking a SkPixmap, SkPixelSerializer::encode() can now handle colortables. Review URL: https://codereview.chromium.org/1501303002
* add signed-integer-overflow to yasm exceptionsGravatar mtklein2015-12-07
| | | | | | | | BUG=skia:4635 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot Review URL: https://codereview.chromium.org/1509613002
* A small cleanup of GrAtlasTextContextGravatar joshualitt2015-12-07
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1502323002
* fix coincident fuzzerGravatar caryclark2015-12-07
| | | | | | | | | | | This fuzzer has very large Y values that cause the points to sort incorrectly by t. Exit out as soon as this is detected. TBR=reed@google.com BUG=561121 Review URL: https://codereview.chromium.org/1507803002
* Simplify D1G so that it can inline DrawOneGlyph, and fix a bug in codegenGravatar herb2015-12-07
| | | | | | that only happens on ARM64 using GCC 4.9. Review URL: https://codereview.chromium.org/1507633004
* SkImageShaderFactoryToName SkAlphaThresholdFilterFactoryToNameGravatar halcanary2015-12-07
| | | | | | | | | | https://gold.skia.org/diff?test=image-shader&left=8807a80c69a5d565821432fe6a7b74ec&top=80222191bf0768b0fc62c8e05b58fb5f https://gold.skia.org/diff?test=imagealphathreshold&left=fc3fbbfbd1b1e7ec1c33c00c6c22b9a8&top=493096aac6f44b91cd6522c6049d5a56 BUG=skia:4613 Review URL: https://codereview.chromium.org/1499443002
* Allow SkStream::peek() to partially succeedGravatar scroggo2015-12-07
| | | | | | | | | | | | | | | | | | | | If the stream can peek less than requested, peek that amount. Return the number of bytes peeked. This simplifies crrev.com/1472123002. For a stream that is smaller than 14 bytes, it can successfully peek, meaning the client will not need to fall back to read() + rewind(), which may fail if the stream can peek but not rewind. This CL revives code from patch set 3 of crrev.com/1044953002, where I initially introduced peek() (including tests). Add a test for SkFrontBufferedStream that verifies that peeking does not make rewind() fail (i.e. by reading past the internal buffer). BUG=skia:3257 Review URL: https://codereview.chromium.org/1490923005
* Start objectifying GrAtlasTextBlobGravatar joshualitt2015-12-07
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1503193002
* clang/win: Let SK_TRACEHR not produce -Wunused-value warnings in release builds.Gravatar thakis2015-12-07
| | | | | | | | | | | | | | | | | Fixes warnings like: ..\..\third_party\skia\include\utils\win\SkHRESULT.h(51,23) : note: expanded from macro 'HRNM' ^~~~~~~~~~~~~~~~~~~~~~~~~ ..\..\third_party\skia\include\utils\win\SkHRESULT.h(26,20) : note: expanded from macro 'HR_GENERAL' SK_TRACEHR(_hr, _msg);\ ^~~ ..\..\third_party\skia\include\utils\win\SkHRESULT.h(20,31) : note: expanded from macro 'SK_TRACEHR' ^~~ BUG=chromium:505318 TBR=reed This is a trivial implementation change. Review URL: https://codereview.chromium.org/1503463004
* Fix up signed-integer-overflow warningsGravatar tomhudson2015-12-07
| | | | | | | | | | | | | | | | | When checking whether a matrix was a pure scale, we subtracted 0x3f800000 from the diagonals; if the diagonal value was already very negative, we'd underflow. Replace subtraction with XOR. When dealing with repeating tiled bitmaps, when the bitmap was very large, we'd multiply an offset by 65535, possibly causing underflow. Throw in a cast to long (casting to unsigned also silences the warning and wouldn't involve extension, but I can't convince myself that it's correct). BUG=skia:4635 R=mtklein@google.com Review URL: https://codereview.chromium.org/1504933002
* Add SkTileImageFilter sample to filterfastbounds GM.Gravatar senorblanco2015-12-07
| | | | | | | | NOTE: will affect pixel results for filterfastbounds GM. BUG=skia:3194 Review URL: https://codereview.chromium.org/1500373004
* Always use high precision on NDS transformGravatar joel.liang2015-12-07
| | | | | | | | | To fix the Chrome fillRect issue on Galaxy S6. We should use high precision for position related calculation. BUG=chromium:552999 Review URL: https://codereview.chromium.org/1500393002
* SkAlphaThresholdFilter.h allow flatteningGravatar halcanary2015-12-07
| | | | | | | | | | | | | Motivation: allows this: #include "SkAlphaThresholdFilter.h" void init() { SkAlphaThresholdFilter::InitializeFlattenables(); } BUG=skia:4613 Review URL: https://codereview.chromium.org/1500373003
* Pin result in SkATan2_255Gravatar robertphillips2015-12-07
| | | | | | BUG=555544 Review URL: https://codereview.chromium.org/1506913002
* add gm to exercise large sigmasGravatar reed2015-12-07
| | | | | | | BUG=skia:4437 TBR= Review URL: https://codereview.chromium.org/1503143002
* better NEON div255Gravatar mtklein2015-12-07
| | | | | | | | | | | | | | | | | | | | | | | We were doing (x+127)/255 = ((x+128) + (x+128)>>8)>>8 in three instructions: 1) x += 128 2) shift x right 8 bits 3) add x and x>>8 together, then shift right more 8 bits Now do it as two instructions: 1) shift (x+128) right 8 bits 2) add x and (x+128)>>8 and 128 all together, then shift right 8 more bits On ARM this will be a 5-10% speedup for SrcATop, DstATop, Xor, Multiply, Difference, HardLight, Darken, and Lighten xfermodes. When we have a mask (e.g. text), *all* xfermodes except Plus will get a similar boost. This should mean now that (a*b).div255() is the same speed as a.approxMulDiv255(b) on both x86 and ARM, and of course it's perfect instead of approximate. So we should eliminate approxMulDiv255(), but I'll leave it to another CL, as it'll need Blink rebaselines. This CL should not change GMs or Blink. https://gold.skia.org/search2?issue=1502843002&unt=true&query=source_type%3Dgm&master=false BUG=skia: CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;client.skia.android:Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot,Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot Review URL: https://codereview.chromium.org/1502843002
* Matrix convolution bounds fix; affectsTransparentBlack fixes.Gravatar senorblanco2015-12-07
| | | | | | | | | | | | | | | | | | | | | Because the convolution kernel is (currently) applied in device space, there's no way to know which object-space pixels will be touched. So return false from canComputeFastBounds(). The results from the matrixconvolution GM were actually wrong, since they were showing edge differences on the clip boundaries, where they should really only show on crop boundaries. I added a crop to the GM to keep the results the same (which are useful to test the different convolution tile modes). While I was at it, SkImageFilter::affectsTransparentBlack() was inapplicable on most things except color filters, and its use on leaf nodes was confusing. So I removed it, and made SkImageFilter::canComputeFastBounds() virtual instead. BUG=skia:4630 Review URL: https://codereview.chromium.org/1500923004
* Add transfer buffer to GLCapsGravatar jvanverth2015-12-07
| | | | | | | | | Adds a check for PBO/transfer buffer support to GrGLCaps, and uses that to pick the correct buffer type. BUG=skia:4604 Review URL: https://codereview.chromium.org/1503593002
* Update SKP versionGravatar update-skps2015-12-06
| | | | | | | | | Automatic commit by the RecreateSKPs bot. TBR= NO_MERGE_BUILDS Review URL: https://codereview.chromium.org/1502893002
* detect when we can filter bitmaps/images directly, w/o a tmp layerGravatar reed2015-12-05
| | | | | | | | | | | | | | | | visual bench run on Mac Pro curr/maxrss loops min median mean max stddev samples config bench 100/100 MB 16 412µs 413µs 413µs 414µs 0% ▄▁▇▄▄▄▄█▄▃▅ gpu warmupbench 101/102 MB 32 547µs 548µs 611µs 1.24ms 34% █▁▁▁▁▁▁▁▁▁▁ gpu image-filter-sprite-draw-image 102/103 MB 32 547µs 548µs 721µs 1.23ms 41% █▁▇▁▁█▁▁▁▁▁ gpu image-filter-sprite-draw-bitmap 103/103 MB 64 546µs 546µs 546µs 547µs 0% ▆▄▂▁▇█▅▇▅▇▃ gpu image-filter-sprite-draw-sprite Should have no effect on Chrome while SK_SUPPORT_LEGACY_LAYER_BITMAP_IMAGEFILTERS is defined (which it is in chrome) BUG=skia:1073 Review URL: https://codereview.chromium.org/1491293002
* Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. ↵Gravatar senorblanco2015-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ ) Reason for revert: Introduced memory leak; pixel changes in Chrome. Original issue's description: > Matrix convolution bounds fix; affectsTransparentBlack fixes. > > Because the convolution kernel is (currently) applied in device space, > there's no way to know which object-space pixels will be touched. So > return false from canComputeFastBounds(). > > The results from the matrixconvolution GM were actually wrong, since > they were showing edge differences on the clip boundaries, where they > should really only show on crop boundaries. I added a crop to the GM > to keep the results the same (which are useful to test the different > convolution tile modes). > > While I was at it, SkImageFilter::affectsTransparentBlack() was > inapplicable on most things except color filters, and its use on > leaf nodes was confusing. So I removed it, and made > SkImageFilter::canComputeFastBounds() virtual instead. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec TBR=reed@google.com,reed@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1497083005
* report back colorfilters in luaGravatar reed2015-12-04
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1498293002
* Matrix convolution bounds fix; affectsTransparentBlack fixes.Gravatar senorblanco2015-12-04
| | | | | | | | | | | | | | | | | | | | | Because the convolution kernel is (currently) applied in device space, there's no way to know which object-space pixels will be touched. So return false from canComputeFastBounds(). The results from the matrixconvolution GM were actually wrong, since they were showing edge differences on the clip boundaries, where they should really only show on crop boundaries. I added a crop to the GM to keep the results the same (which are useful to test the different convolution tile modes). While I was at it, SkImageFilter::affectsTransparentBlack() was inapplicable on most things except color filters, and its use on leaf nodes was confusing. So I removed it, and made SkImageFilter::canComputeFastBounds() virtual instead. BUG=skia: Review URL: https://codereview.chromium.org/1500923004
* clarify diff manually, showing black where they differGravatar reed2015-12-04
| | | | | | | BUG=skia: TBR=robertphilips@google.com Review URL: https://codereview.chromium.org/1498243002
* use RawIter in hairpath (simplifies)Gravatar reed2015-12-04
| | | | | | | | no impact on nanobench BUG=skia: Review URL: https://codereview.chromium.org/1497283002