aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
Commit message (Collapse)AuthorAge
* Back out new SkColorSpaceXform pipeline.Gravatar Mike Klein2017-10-13
| | | | | | | | | Gonna do this bigger and better elsewhere. Change-Id: I13e843e86e9e02d303e6f6645e3e2310845f5342 Reviewed-on: https://skia-review.googlesource.com/59440 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "move SkMatrix anonymous affine enum to private"Gravatar Mike Reed2017-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 708ec81d7a9bba12cd7e574b5c5ae80b2ad77919. Reason for revert: broke android frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp:153:54: error: no member named 'kAScaleX' in 'SkMatrix'; did you mean 'kMScaleX'? FS_MATRIX transform = {transformValues[SkMatrix::kAScaleX], transformValues[SkMatrix::kASkewY], ~~~~~~~~~~^~~~~~~~ Original change's description: > move SkMatrix anonymous affine enum to private > > enum members aren't used by SkMatrix.h or by > clients outside of Skia. > > R: reed@google.com, bungeman@google.com > Bug: skia:6898 > Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13 > Reviewed-on: https://skia-review.googlesource.com/59160 > Reviewed-by: Mike Reed <reed@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Cary Clark <caryclark@skia.org> TBR=bungeman@google.com,reed@google.com,caryclark@skia.org Change-Id: I7fe80879e8b851c9036fc910a314129c299d82d2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6898 Reviewed-on: https://skia-review.googlesource.com/59460 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* move SkMatrix anonymous affine enum to privateGravatar Cary Clark2017-10-12
| | | | | | | | | | | | | enum members aren't used by SkMatrix.h or by clients outside of Skia. R: reed@google.com, bungeman@google.com Bug: skia:6898 Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13 Reviewed-on: https://skia-review.googlesource.com/59160 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* abort SkRRect::transform() before dst->scaleRadii() assertsGravatar Mike Klein2017-10-12
| | | | | | | | | | | | | | | | If we've got a crazy matrix, we can make dst arbitrarily crazy. This should fix several of Kevin's fuzzes, e.g. Bug: skia:7090 I don't see any uses of SkRRect::transform() that care about the output rrect in case of failure, so I've just removed the guarantee that we don't modify it when failing. Change-Id: I4c81af59a093a984f0a02a0d3dc4bbbb1fb935f2 Reviewed-on: https://skia-review.googlesource.com/58620 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add api for passing mipped hint into ImageGenerator onGenerateTextureGravatar Greg Daniel2017-10-11
| | | | | | | | | | | | This does not actually add any additional functionality to the generators. Once this lands I will enable the generators one at a time to more easily monitor the effects of each one. Bug: skia: Change-Id: I382a1acfaebcbf9ad44c9873b87cdbbe02a13602 Reviewed-on: https://skia-review.googlesource.com/57083 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* remove dead code for returning 0 on overflowGravatar Mike Reed2017-10-11
| | | | | | | | Bug: skia: Change-Id: I6e7aae1b09cf3a1c9728bdaaa4dbf4df4b2ec16d Reviewed-on: https://skia-review.googlesource.com/58341 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Reed <reed@google.com>
* removed dead code behind legacy fontmgr api flagGravatar Mike Reed2017-10-11
| | | | | | | | Bug: skia: Change-Id: I7766b10947df384b0e94a32642d5b4321f2e53bd Reviewed-on: https://skia-review.googlesource.com/58241 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* keep SkRSXforms aligned in SkLiteDLGravatar Mike Klein2017-10-11
| | | | | | | | | | | | | | We've been copying the text first, then the transforms. That's a good way to get the transforms out of alignment. This CL swaps the order of the two. Bug: skia:7133 Change-Id: If8cd402b9ffba1787345dc4b5ffd4ee6abb14f33 Reviewed-on: https://skia-review.googlesource.com/57941 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add mulHi to SkNxGravatar Herb Derby2017-10-11
| | | | | | | | | | | | | Add mulHi to base SkNx, and specialize implementations for Sk4u for neon and sse. Add casts for converting from uint8_t by 4 to uint32_t by 4. Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I29a32e2ad9812a47fff841ceca334e562362836f Reviewed-on: https://skia-review.googlesource.com/57960 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* clone saturating cast code for doublesGravatar Mike Reed2017-10-10
| | | | | | | | Bug: skia: Change-Id: I4f35413995cf73c6f130476d6b36e530120aa7ed Reviewed-on: https://skia-review.googlesource.com/57901 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* SkColorSpaceXform: clamp before table lookupsGravatar Mike Klein2017-10-10
| | | | | | | | | | | | | | | | | | | | | | The fuzzer has built a single test case that causes out-of-bounds reads on both the src and dst tables. I'm glad we have it. Next follow ups may include: - have byte_tables_rgb do its own clamping - replace table_{r,g,b} here with a single stage analogous to byte_tables_rgb that looks up the three float tables safely - maybe replace byte_tables_rgb with that. I'm not really sure why src->XYZ tables are floats but XYZ->dst are bytes. I'm going to try some of these out before attempting to reland in Chrome. As usual, rebaselining Blink makes things a pain. Bug: chromium:772684, skia:7114 Change-Id: Id8759e766330e1c7689c0847bf2cd35d422ebbcd Reviewed-on: https://skia-review.googlesource.com/57760 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Revert "Fix a couple float-cast-overflow in SkScan*.""Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b6abb9b4e088abee8b8dfcce9c9f7eb759518198. Reason for revert: It doesn't make sense that this CL would affect the tests implicated in the perf regression in skia:7143, and the revert had no effect on the perf of those tests. Seems like the perf alert was either noise or due to a different CL. Original change's description: > Revert "Fix a couple float-cast-overflow in SkScan*." > > This reverts commit 3cd0bef0fd9d062bbcc313c329b4f31925e8ded7. > > Reason for revert: https://bugs.chromium.org/p/skia/issues/detail?id=7143 > > Original change's description: > > Fix a couple float-cast-overflow in SkScan*. > > > > Bug: skia:5060 > > Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4 > > Reviewed-on: https://skia-review.googlesource.com/47422 > > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > > Reviewed-by: Mike Reed <reed@google.com> > > TBR=benjaminwagner@google.com,reed@google.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: skia:7143 > Change-Id: I0f19720a7d8344789a375bbb6b9e28bf4f4e55ae > Reviewed-on: https://skia-review.googlesource.com/57240 > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > Reviewed-by: Ben Wagner <benjaminwagner@google.com> TBR=benjaminwagner@google.com,reed@google.com Change-Id: I29ac47d6665e2e52ee2a6500488dc407c8d2af1c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7143 Reviewed-on: https://skia-review.googlesource.com/57440 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* Remove trailing whitespace.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* use unsigned to allow for using all 32bits for approx distanceGravatar Mike Reed2017-10-09
| | | | | | | | | Bug:757146 Change-Id: If783f1b36fc70c443d0808947275acf003a872ee Reviewed-on: https://skia-review.googlesource.com/57109 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* fix include guardGravatar Mike Reed2017-10-09
| | | | | | | | Bug: skia:7136 Change-Id: I4bc7bb932b24deb1e8fc2938ce641ac6677458e0 Reviewed-on: https://skia-review.googlesource.com/57107 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Revert "Fix a couple float-cast-overflow in SkScan*."Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3cd0bef0fd9d062bbcc313c329b4f31925e8ded7. Reason for revert: https://bugs.chromium.org/p/skia/issues/detail?id=7143 Original change's description: > Fix a couple float-cast-overflow in SkScan*. > > Bug: skia:5060 > Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4 > Reviewed-on: https://skia-review.googlesource.com/47422 > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > Reviewed-by: Mike Reed <reed@google.com> TBR=benjaminwagner@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7143 Change-Id: I0f19720a7d8344789a375bbb6b9e28bf4f4e55ae Reviewed-on: https://skia-review.googlesource.com/57240 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
* Revert "Revert "change computeByteSize to return max_size_t on overflow""Gravatar Mike Reed2017-10-09
| | | | | | | | | | | This reverts commit 384f0a7d6626026f21313e85e51890d747171ee8. Bug: skia: Change-Id: I392ef5c1a5172181caf81ae270befeba6e778241 Reviewed-on: https://skia-review.googlesource.com/57084 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* initClassID no longer auto-allocates idsGravatar Ethan Nicholas2017-10-09
| | | | | | | | | | | | | Auto-allocated IDs mean that the IDs depend upon the order in which classes happen to get initialized and are therefore not consistent from run to run. This change paves the way for a persistent shader cache by fixing the IDs in an enum. Bug: skia: Change-Id: I3e923c6c54f41b3b3eb616458abee83e0909c09f Reviewed-on: https://skia-review.googlesource.com/56401 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* add helper to check for overflowGravatar Mike Reed2017-10-09
| | | | | | | | | | pre-CL to aid in changing the convention for when we overflow Bug: skia: Change-Id: I1e34a18fefb80187787a1c0c8ed7ee3516744d24 Reviewed-on: https://skia-review.googlesource.com/57103 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove SkTypeface::Style use in API.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | | | All known callers of SkTypeface::MakeDefault call it with kNormal and the only users specifying kNormal explicitly are in Skia, so remove the parameter. There appear to be no users of SkTypeface::MakeFromTypeface, so remove it. The current alternative is SkFontMgr::matchFaceStyle which can do a better job anyway. Change-Id: I89d94c77f9593407b0a319786848a8b823fcbae4 Reviewed-on: https://skia-review.googlesource.com/56762 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Fix a couple float-cast-overflow in SkScan*.Gravatar Ben Wagner2017-10-07
| | | | | | | | Bug: skia:5060 Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4 Reviewed-on: https://skia-review.googlesource.com/47422 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "change computeByteSize to return max_size_t on overflow"Gravatar Mike Reed2017-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 24295462722fd5a298d108a80b0aacbb0964da53. Reason for revert: broke running dm on google3 Original change's description: > change computeByteSize to return max_size_t on overflow > > Bug: skia:7132 > Change-Id: I41045640ee62b2c988a84370ead5034bbccc6daf > Reviewed-on: https://skia-review.googlesource.com/56620 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=bungeman@google.com,herb@google.com,reed@google.com Change-Id: I5f58ec37241d2fae3ebdb7a3d6b41f9fd6d3c2ee No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7132 Reviewed-on: https://skia-review.googlesource.com/56880 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Add option to create a deferred render target context with mipsGravatar Greg Daniel2017-10-06
| | | | | | | | | | | | | | We need this since we have texture generators that draw the base level but nothing more. Thus we want them to be able to directly draw into a pre allocated mipped target instead of doing a copy later. TBR: bsalomon@google.com Bug: skia: Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e Reviewed-on: https://skia-review.googlesource.com/54100 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* change computeByteSize to return max_size_t on overflowGravatar Mike Reed2017-10-06
| | | | | | | | Bug: skia:7132 Change-Id: I41045640ee62b2c988a84370ead5034bbccc6daf Reviewed-on: https://skia-review.googlesource.com/56620 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* experiments to speed up drawing 32bit images into 565Gravatar Mike Reed2017-10-05
| | | | | | | | | | | | New (legacy style) blitters only coded for shaders (and very restricted blendmodes) Bug: skia: See https://buganizer.corp.google.com/issues/64884885 Change-Id: Ie2546093bfe1e670a825dfd9542d252d53732c40 Reviewed-on: https://skia-review.googlesource.com/54103 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Fewer atomic ops in debug with SkBufferHead.Gravatar Ben Wagner2017-10-05
| | | | | | | | | | | | | | In debug builds an assert would do an atomic load to assert the reference count was greater than zero, then a fetch_add would access the value again to do the reference counting. Instead just assert in debug on the value produced by the reference counting. This both improves debug performance and (more importantly) makes the debug asserts correct instead of mearly opprotunistic. Change-Id: Ic4ce788930d2564b5f86ab0e09fcd66006c8b73d Reviewed-on: https://skia-review.googlesource.com/55880 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* Clean up SkString reference counting a bit.Gravatar Ben Wagner2017-10-05
| | | | | | | | | | | This reverts commit 01f8e41c1368bfd60d3f011cb5aa9cc478799e63, and then works around whatever issues were seen on Ubuntu 14 by continuing the clean up. Change-Id: I3523b12c83e4efef01a8142c00cde4e3e12189fa Reviewed-on: https://skia-review.googlesource.com/55761 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* aggressively refactor pipeline building in SkColorSpaceXformGravatar Mike Klein2017-10-05
| | | | | | | | | | | | | | | | | | | | | | | This rewrites things into 5 distinct phases: 1) load src 2) linearize src 3) gamut transform 4) apply dst transfer function and premul 5) store dst In the existing code, steps 1+2 were really intertwined, and we had all sorts of arbitrary restrictions on input formats and output formats. I've removed most of those. This is guarded by SK_COLOR_SPACE_XFORM_LEGACY_PIPELINE for Blink layout tests. (The 35 diffs all look fine.) Bug: skia:7114 Change-Id: Ib5f15d1ac3240a6ef202ba30acef660152beee82 Reviewed-on: https://skia-review.googlesource.com/55320 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Update SkBufferHead fRefCnt to std::atomic.Gravatar Ben Wagner2017-10-05
| | | | | | | | | This fixes the noisiest bit of a debug tsan build. Change-Id: I5df8cb3003c73640c04bd73e0aad1aefd87f833e Reviewed-on: https://skia-review.googlesource.com/55480 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert "Clean up SkString reference counting a bit."Gravatar Robert Phillips2017-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a910c847e9d04e183e9e610902cbd363c8488196. Reason for revert: Compilation failure on Ubuntu14 bots ../../../../../work/skia/src/core/SkString.cpp:200:55: error: could not convert ‘{0, {0}, 0}’ from ‘<brace-enclosed initializer list>’ to ‘const SkString::Rec’ const SkString::Rec SkString::gEmptyRec = { 0, {0}, 0 }; Original change's description: > Clean up SkString reference counting a bit. > > BUG=skia:7107 > > Change-Id: I47072bf31b902c79dbb850179ff6d35940de3e63 > Reviewed-on: https://skia-review.googlesource.com/54720 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Ben Wagner <bungeman@google.com> TBR=mtklein@google.com,bungeman@google.com,reed@google.com Change-Id: I6ec327511e8e1c1fd7e4c1bd5839c0547d4ab609 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7107 Reviewed-on: https://skia-review.googlesource.com/55640 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* refactor SkColorSpaceXform a bitGravatar Mike Klein2017-10-04
| | | | | | | | | | | | | | | | | I was having trouble reading my way through this code, so I decided it needed a little weedwhacking. The main thrust here is: - remove completely pointless ColorSpaceMatch templating - remove absurdly paranoid public/protected/private/friend relationships This is still about twice as overdesigned as I'd like... Change-Id: I275ddbe028ebb09ed383ed7bfaba394975eea27a Reviewed-on: https://skia-review.googlesource.com/55260 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Clean up SkString reference counting a bit.Gravatar Ben Wagner2017-10-04
| | | | | | | | | BUG=skia:7107 Change-Id: I47072bf31b902c79dbb850179ff6d35940de3e63 Reviewed-on: https://skia-review.googlesource.com/54720 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Avoid overflow computing reserve for aaclipGravatar Mike Reed2017-10-04
| | | | | | | | BUG=chromium:713764 Change-Id: I32c95157d5f2b21e9981a07092558a1f6294a463 Reviewed-on: https://skia-review.googlesource.com/55380 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert[4] "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"Gravatar Mike Reed2017-10-03
| | | | | | | | | | This reverts commit 5a2e50edc51006ce91366e177a9d21a16775d7fd. Bug: skia: Change-Id: I8d28b5c07d90130e5a1653923740eaf189ecb954 Reviewed-on: https://skia-review.googlesource.com/53900 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Make SkString reference counting thread/TSAN safe.Gravatar Ben Wagner2017-10-03
| | | | | | | | | BUG=skia:7107 Change-Id: I8ead98f7694faaed8e6f6f29b1fcd88501d36b66 Reviewed-on: https://skia-review.googlesource.com/54400 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* add _skx stagesGravatar Mike Klein2017-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | This just makes sure all the plumbing is in place to use the Skylake Xeon subset of AVX-512 instructions. So far, - no Windows - no lowp - nothing explicitly making use of AVX-512 registers or instructions This initial pass should run essentially identically to the _hsw AVX2 code we've been using previously. Clang _does_ use AVX-512-only instructions to implement some of the higher-level concepts we've coded, but it's really a pretty subtle difference. Next steps will bump N from 8 to 16 and start threading through an AVX-512-friendly mask instead of tail. I'll also want to take a harder look at how we do blending like if_then_else()... the default codegen here doesn't really take advantage of AVX-512 the way I'd like here. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-Clang-GCE-CPU-AVX512-x86_64-Debug Change-Id: I6c9442488a449ea4770617bb22b2669859cc92e2 Reviewed-on: https://skia-review.googlesource.com/54062 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Fix SkRRect validation for negative typesGravatar Adrienne Walker2017-10-02
| | | | | | | | | | | SkRRect::fType is an int, so needs to be checked to see if it's negative. Bug: chromium: 768149 Change-Id: I6a9a019c736806d35dc1bd627fb4ddc735a0ac86 Reviewed-on: https://skia-review.googlesource.com/54024 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* fix comments in SkColorSpaceXform.cppGravatar Mike Klein2017-10-02
| | | | | | | | | | | No code bugs as far as I can tell. BUG=skia:7095 Change-Id: I56d848b6225d81bf2481235b9294f0c3e7f53f5b Reviewed-on: https://skia-review.googlesource.com/53823 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove SkReadBuffer::validateAvailableGravatar Leon Scroggins III2017-10-02
| | | | | | | | | | | | Follow on to 4cdbf6056de29e8c12c3b1b4c2c2fa286cf68049. readByteArray was the only caller of this method, and no longer uses it. So remove it and its only override. Bug: 769134 Change-Id: I0aaf97717baba1f0195162f3e644708bc101eba4 Reviewed-on: https://skia-review.googlesource.com/53920 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Revert "Revert "Revert "guard old apis for querying byte-size of a ↵Gravatar Mike Reed2017-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap/imageinfo/pixmap""" This reverts commit cd284c532376d16fcc4ed75baf3da65c3e4a2e95. Reason for revert: assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))" google3 thinks it was from surface_rowbytes Original change's description: > Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"" > > This reverts commit 809cbedd4b252be221b2ac3b4269d312fd8f53a0. > > Bug: skia: > Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d > Reviewed-on: https://skia-review.googlesource.com/52665 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=fmalita@chromium.org,reed@google.com Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/53802 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "guard old apis for querying byte-size of a ↵Gravatar Mike Reed2017-10-02
| | | | | | | | | | | | bitmap/imageinfo/pixmap"" This reverts commit 809cbedd4b252be221b2ac3b4269d312fd8f53a0. Bug: skia: Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d Reviewed-on: https://skia-review.googlesource.com/52665 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* fix setPixelRefGravatar Cary Clark2017-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | In setPixelRef() If dx or dy are negative, assert in debug. Pin pixel ref origin to account for dx and dy on right. If colorType is unknown, ignore pr pixelref. Set Bitmap rowbytes to match pixelref rowbytes. In tryAllocPixels() Return true early if colorType is unknown. This assumes that the desired behavior is for Bitmaps set to kUnknown_SkColorType to avoid allocating SkPixelRef while avoiding debug asserts, which is what current gm tests like BitmapCopy_extractSubset test for. R=reed@google.com Change-Id: I0d36032d36a0b7dc111f4aff18c71382874fe1f5 Reviewed-on: https://skia-review.googlesource.com/53420 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* Just add new safe size apisGravatar Mike Reed2017-09-29
| | | | | | | | | | | Update skia (and then hide the older versions) to come later Inspired by https://skia-review.googlesource.com/c/skia/+/52665 Bug: skia: Change-Id: I15c7395557fb49c4163cb3b323b5428abd2c752d Reviewed-on: https://skia-review.googlesource.com/53520 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Reorganize blur filter to insert new implementationGravatar Herb Derby2017-09-28
| | | | | | | Change-Id: Ie9afd2de2bfb9bcd04b5f8b7f319a24025520bef Reviewed-on: https://skia-review.googlesource.com/52400 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Stephen White <senorblanco@chromium.org>
* Avoid uninitialized memory in readByteArrayAsDataGravatar Leon Scroggins III2017-09-28
| | | | | | | | | | | | | | | | | Bug: 769134 readByteArray can fail (due to not having enough available or due to the wrong alignment). If it does, do not return an uninitialized block of memory. Further, drop the initial size check, which is covered by readByteArray. Add a test. Change-Id: Ia101697c5bb1ca3ae3df1795f37a74b2f602797d Reviewed-on: https://skia-review.googlesource.com/52742 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Remove tolerance form SkClassifyCubicGravatar Chris Dalton2017-09-28
| | | | | | | | | | | | It's too inexact as-is. If the caller wants tolerance they can do their own with knowledge of the pixel grid. The homogeneous math is stable with infinities so it's really unnecessary here. Bug: skia:7073 Change-Id: I4dc34ad96b859a138714b6d4f8804fec4f89f17a Reviewed-on: https://skia-review.googlesource.com/51182 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Simplify scan converter's argsGravatar Yuqian Li2017-09-28
| | | | | | | | | | | | | | | All scan converters need an SkIRect clipBounds and a bool containedInClip. However, we previously sent in an SkRegion and a SkIRect*, and convert them into clipBounds and containedInClip all over the places. This CL converts them only once inside do_fill_path and change all args to SkIRect and bool. Bug: skia: Change-Id: I05f1d76322942d8817860fd33991f7f7ce918e7c Reviewed-on: https://skia-review.googlesource.com/52741 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* make SkPath::fConvexity atomicGravatar Mike Klein2017-09-28
| | | | | | | | | | | | | | | | | The TSAN bots fail regularly with races on fConvexity. Very annoying. We used to have this very same problem with SkPath::fFirstDirection until we made it atomic. This does the same to fConvexity. This makes the field as lightly atomic as possible, with all operations using a relaxed memory order. The value of fConvexity isn't guarding any other non-atomic memory or implying any other writes have happened so I don't think we need anything beyond relaxed here. Change-Id: I0da1f892dc2b7072d692ce8b460fb1862aebef77 Reviewed-on: https://skia-review.googlesource.com/52180 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"Gravatar Jim Van Verth2017-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 88757dacd4f532a0f647c02ae0ee596d31ab5c68. Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel. Original change's description: > guard old apis for querying byte-size of a bitmap/imageinfo/pixmap > > Now with legacy behavior for allocpixels > > This was reverted, so the current CL is a "fix" on top of ... > https://skia-review.googlesource.com/c/skia/+/50980 > > Related update to Chrome (in preparation for this change) > https://chromium-review.googlesource.com/c/chromium/src/+/685719 > > Bug: skia: > Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9 > Reviewed-on: https://skia-review.googlesource.com/51341 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Commit-Queue: Mike Reed <reed@google.com> TBR=fmalita@chromium.org,reed@google.com Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/52381 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* guard old apis for querying byte-size of a bitmap/imageinfo/pixmapGravatar Mike Reed2017-09-27
| | | | | | | | | | | | | | | | Now with legacy behavior for allocpixels This was reverted, so the current CL is a "fix" on top of ... https://skia-review.googlesource.com/c/skia/+/50980 Related update to Chrome (in preparation for this change) https://chromium-review.googlesource.com/c/chromium/src/+/685719 Bug: skia: Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9 Reviewed-on: https://skia-review.googlesource.com/51341 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>