aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageFilterTest.cpp
Commit message (Collapse)AuthorAge
* Add color type to the image filter DAG's OutputPropertiesGravatar Brian Osman2018-07-06
| | | | | | | | | | | | Don't try to guess the pixel config to use for intermediates. Instead, just make the intermediates in the same color type (and space) as the final destination. This removes some no-longer-correct logic that was using sRGB configs, resulting in linear blending and precision loss. Change-Id: I627c47193a9f2889c3dc121170ff3e7d5d315fa0 Reviewed-on: https://skia-review.googlesource.com/139547 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* rebaseGravatar Cary Clark2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia Additionally some bookmaker changes take into account recent additions of typedef comments and the generated header comment. Original change's description: > Revert "remove toString" > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > Reason for revert: broke flutter > > Original change's description: > > remove toString > > > > toString may have been used by obsolete debugger only > > find out if that is so > > > > R=​brianosman@google.com,bsalomon@google.com > > > > Docs-Preview: https://skia.org/?cl=119894 > > Bug:830651 > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > Reviewed-on: https://skia-review.googlesource.com/119894 > > Commit-Queue: Cary Clark <caryclark@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c TBR=bsalomon@google.com,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Reviewed-on: https://skia-review.googlesource.com/129623 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@google.com> Docs-Preview: https://skia.org/?cl=133583 Bug: 830651 Change-Id: If8499e796be63580ad419e150e94d43e8b89de1b Reviewed-on: https://skia-review.googlesource.com/133583 Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
* Remove SK_SUPPORT_GPU checks in tool-only codeGravatar Brian Osman2018-05-31
| | | | | | | | | | | | | | | | Most of this is (obviously) not necessary to do, but once I started, I figured I'd just get it all. Tools (nanobench, DM, skiaserve), all GMs, benches, and unit tests, plus support code (command line parsing and config stuff). This is almost entirely mechanical. Bug: skia: Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb Reviewed-on: https://skia-review.googlesource.com/131153 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Reland "remove toString""Gravatar Cary Clark2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 92e37b6d79f12ccfaaf7671413316952d182267d. Reason for revert: toString still used by flutter Original change's description: > Reland "remove toString" > > This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. > > Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia > > Original change's description: > > Revert "remove toString" > > > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > > > Reason for revert: broke flutter > > > > Original change's description: > > > remove toString > > > > > > toString may have been used by obsolete debugger only > > > find out if that is so > > > > > > R=​brianosman@google.com,bsalomon@google.com > > > > > > Docs-Preview: https://skia.org/?cl=119894 > > > Bug:830651 > > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > > Reviewed-on: https://skia-review.googlesource.com/119894 > > > Commit-Queue: Cary Clark <caryclark@google.com> > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: 830651 > > Reviewed-on: https://skia-review.googlesource.com/129340 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Cary Clark <caryclark@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: 830651 > Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34 > Reviewed-on: https://skia-review.googlesource.com/129623 > Reviewed-by: Cary Clark <caryclark@skia.org> > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: Iafc59ffc1b3db67c520ba31bf12d68e1b46c0ea2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/131082 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Reland "remove toString"Gravatar Cary Clark2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia Original change's description: > Revert "remove toString" > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > Reason for revert: broke flutter > > Original change's description: > > remove toString > > > > toString may have been used by obsolete debugger only > > find out if that is so > > > > R=​brianosman@google.com,bsalomon@google.com > > > > Docs-Preview: https://skia.org/?cl=119894 > > Bug:830651 > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > Reviewed-on: https://skia-review.googlesource.com/119894 > > Commit-Queue: Cary Clark <caryclark@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 830651 > Reviewed-on: https://skia-review.googlesource.com/129340 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 830651 Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34 Reviewed-on: https://skia-review.googlesource.com/129623 Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Revert "remove toString"Gravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. Reason for revert: broke flutter Original change's description: > remove toString > > toString may have been used by obsolete debugger only > find out if that is so > > R=​brianosman@google.com,bsalomon@google.com > > Docs-Preview: https://skia.org/?cl=119894 > Bug:830651 > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > Reviewed-on: https://skia-review.googlesource.com/119894 > Commit-Queue: Cary Clark <caryclark@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/129340 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove toStringGravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | toString may have been used by obsolete debugger only find out if that is so R=brianosman@google.com,bsalomon@google.com Docs-Preview: https://skia.org/?cl=119894 Bug:830651 Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd Reviewed-on: https://skia-review.googlesource.com/119894 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix srcBounds computation in SkMatrixConvolutionImageFilterGravatar Robert Phillips2018-05-17
| | | | | | | | | | | Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output. BUG= skia:7766 Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a Reviewed-on: https://skia-review.googlesource.com/127338 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Minor refactoring to image filtersGravatar Robert Phillips2018-05-14
| | | | | | | | | | This pulls the boring parts out of: https://skia-review.googlesource.com/c/skia/+/127338 (Fix srcBounds computation in SkMatrixConvolutionImageFilter) TBR=bsalomon@google.com Change-Id: Iade788fcc96c4c16989d13e7592030a6a1d3f170 Reviewed-on: https://skia-review.googlesource.com/127573 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Make GrCaps and GrShaderCaps private.Gravatar Brian Salomon2018-05-11
| | | | | | | | | Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps(). Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866 Reviewed-on: https://skia-review.googlesource.com/127389 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* remove SK_IGNORE_TO_STRINGGravatar Cary Clark2018-04-05
| | | | | | | | | | | | | | | | | | | SK_IGNORE_TO_STRING is not defined anywhere. The same effect can be had by using a modern linker. Removing it simplifies bookmaker and makes our includes easier to understand. R=robertphillips@google.com TBR=reed@google.com Bug: skia:6898 Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f Reviewed-on: https://skia-review.googlesource.com/118963 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Allow printf style var args for messages in REPORTER_ASSERT.Gravatar Brian Salomon2018-01-29
| | | | | | | | | Remove REPORTER_ASSERT_MESSAGE. Change-Id: I6d00715901159c93e22d182fe24aac92b5fdbcf4 Reviewed-on: https://skia-review.googlesource.com/100361 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* remove unneeded SkFlattenableSerializationGravatar Mike Reed2018-01-23
| | | | | | | | | Bug: skia: Change-Id: I5cf40b88b05dcd8e83383f6271b046eac8d55e35 Reviewed-on: https://skia-review.googlesource.com/98642 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* remove code from old picture serial guardGravatar Mike Reed2018-01-19
| | | | | | | | Bug: skia: Change-Id: If50a76c7f570d6e88f6583d381d0354568398039 Reviewed-on: https://skia-review.googlesource.com/97060 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* upgrade SkReadBuffer to always validateGravatar Mike Reed2017-12-06
| | | | | | | | Bug: skia: Change-Id: I054560b66c6cde346d939015326d8547879d2c4b Reviewed-on: https://skia-review.googlesource.com/81160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* create imagepriv and name paramsGravatar Cary Clark2017-11-03
| | | | | | | | | | | | | | Named all parameters and made the names consistent for documentation. Moved SK_IMAGEFILTER_UNFLATTEN_COMMON to private file. TBR=reed@google.com Bug: skia:6898 Change-Id: I1343d2b16d4217088fa3bc9c40f1f4177fa32740 Reviewed-on: https://skia-review.googlesource.com/66521 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Consistently round fOffset in SkOffsetImageFilterGravatar Fredrik Söderquist2017-10-26
| | | | | | | | | | | | Since SkScalarRoundToInt rounds differently depending on the sign of the value, care must be taken to perform rounding before any potential change to the sign - like in SkOffsetImageFilter::onFilterNodeBounds. Bug: chromium:778204 Change-Id: I3debff7565f45022c7b8566662927149850b1bea Reviewed-on: https://skia-review.googlesource.com/64020 Reviewed-by: Stephen White <senorblanco@chromium.org> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Remove some blur tests on google3 until the flag is removed."Gravatar Mike Klein2017-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a0020f987e73630592a3e5fb3117830a5b2017a4. Reason for revert: don't need this Original change's description: > Remove some blur tests on google3 until the flag is removed. > > Change 52771 is causing google3 to fail because some tests changed > and were not guarded by a legacy flag. > > Change-Id: I7ad5b83315bba98744f89860dd03fffc66a88248 > Reviewed-on: https://skia-review.googlesource.com/60740 > 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: Ib4f102442f6b11c276e020406808bd88344657a5 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/61321 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Revert "Use combined three pass code for image blur."Gravatar Herb Derby2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d4a0fc7383546d106db2216515b3753937398ece. Reason for revert: Too naive about bounds Original change's description: > Use combined three pass code for image blur. > > This changes more closely matches the GL output, and the runtimes are similar or > faster for the common cases. > > x86_64 times: > benchmark old-Us new-Us old/new > blur_image_filter_large_80.00_80.00 4842.04 2626.10 1.84381 > blur_image_filter_small_80.00_80.00 3297.72 854.97 3.85712 > blur_image_filter_large_10.00_10.00 930.44 720.50 1.29138 > blur_image_filter_small_10.00_10.00 69.96 42.15 1.65979 > blur_image_filter_large_1.00_1.00 682.66 521.78 1.30833 > blur_image_filter_small_1.00_1.00 19.21 14.43 1.33125 > blur_image_filter_large_0.50_0.50 696.17 64.14 10.8539 > blur_image_filter_small_0.50_0.50 16.26 5.02 3.23904 > > arm64 times: > benchmark old-Us new-Us old/new > blur_image_filter_large_80.00_80.00 42144.53 14128.42 2.98296 > blur_image_filter_small_80.00_80.00 24840.58 4392.58 5.65512 > blur_image_filter_large_10.00_10.00 3556.40 3793.70 0.937449 > blur_image_filter_small_10.00_10.00 282.53 220.62 1.28062 > blur_image_filter_large_1.00_1.00 2502.20 2937.99 0.851671 > blur_image_filter_small_1.00_1.00 83.32 81.93 1.01697 > blur_image_filter_large_0.50_0.50 5643.80 272.83 20.6861 > blur_image_filter_small_0.50_0.50 141.02 38.29 3.68295 > > Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD > Change-Id: Ic53b3186607d5485477b92e4ca7b092bf1366c52 > Reviewed-on: https://skia-review.googlesource.com/52771 > Commit-Queue: Herb Derby <herb@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,herb@google.com,senorblanco@chromium.org Change-Id: Idf679a8fc6d777625ad9527b843aa1614d878cba No-Presubmit: true No-Tree-Checks: true No-Try: true Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Reviewed-on: https://skia-review.googlesource.com/60900 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Remove some blur tests on google3 until the flag is removed.Gravatar Herb Derby2017-10-17
| | | | | | | | | | Change 52771 is causing google3 to fail because some tests changed and were not guarded by a legacy flag. Change-Id: I7ad5b83315bba98744f89860dd03fffc66a88248 Reviewed-on: https://skia-review.googlesource.com/60740 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Use combined three pass code for image blur.Gravatar Herb Derby2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes more closely matches the GL output, and the runtimes are similar or faster for the common cases. x86_64 times: benchmark old-Us new-Us old/new blur_image_filter_large_80.00_80.00 4842.04 2626.10 1.84381 blur_image_filter_small_80.00_80.00 3297.72 854.97 3.85712 blur_image_filter_large_10.00_10.00 930.44 720.50 1.29138 blur_image_filter_small_10.00_10.00 69.96 42.15 1.65979 blur_image_filter_large_1.00_1.00 682.66 521.78 1.30833 blur_image_filter_small_1.00_1.00 19.21 14.43 1.33125 blur_image_filter_large_0.50_0.50 696.17 64.14 10.8539 blur_image_filter_small_0.50_0.50 16.26 5.02 3.23904 arm64 times: benchmark old-Us new-Us old/new blur_image_filter_large_80.00_80.00 42144.53 14128.42 2.98296 blur_image_filter_small_80.00_80.00 24840.58 4392.58 5.65512 blur_image_filter_large_10.00_10.00 3556.40 3793.70 0.937449 blur_image_filter_small_10.00_10.00 282.53 220.62 1.28062 blur_image_filter_large_1.00_1.00 2502.20 2937.99 0.851671 blur_image_filter_small_1.00_1.00 83.32 81.93 1.01697 blur_image_filter_large_0.50_0.50 5643.80 272.83 20.6861 blur_image_filter_small_0.50_0.50 141.02 38.29 3.68295 Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: Ic53b3186607d5485477b92e4ca7b092bf1366c52 Reviewed-on: https://skia-review.googlesource.com/52771 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* 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>
* Reland "Fix SkImageSource::filterBounds()" againGravatar Xianzhu Wang2017-09-25
| | | | | | | | | | | | | | | | | | | | | | | This relands commit cb4d58766668b003fea67798027fc25d84acd059 which was reverted by commit b6d2be1330f16fe05f1eed5abda927c0fbb50055 because the original CL broke some blink layout tests, and the first reland was reverted by commit because it broke filterfastbounds gm. This reland let SkImageSource::onFilterNodeBounds() return the dst rect with ctm applied when mapping forward or otherwise the default value. Original description: > Previously SkImageSource::filterBounds() uses the default > SkImageFilter::onFilterNodeBounds() which returns the input rect. > > Now override onFilterNodeBounds() in SkImageSource to return src > or dst rect (with transform applied). Change-Id: I4548981142b9a96beda8339d394cf9943c9f4c0f Reviewed-on: https://skia-review.googlesource.com/50420 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "Reland "Fix SkImageSource::filterBounds()""Gravatar Florin Malita2017-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bf12c079707a89f683ad0a6c989127fa20d9d202. Reason for revert: broke the filterfastbounds GM (2nd column, 5th & 7th rows) Original change's description: > Reland "Fix SkImageSource::filterBounds()" > > This relands commit cb4d58766668b003fea67798027fc25d84acd059 > which was reverted by commit b6d2be1330f16fe05f1eed5abda927c0fbb50055 > because the original CL broke some blink layout tests. > > This reland let SkImageSource::filterBounds() return the dst rect with > ctm applied regardless of direction. > > Original description: > > > Previously SkImageSource::filterBounds() uses the default > > SkImageFilter::onFilterNodeBounds() which returns the input rect. > > > > Now override onFilterNodeBounds() in SkImageSource to return src > > or dst rect (with transform applied). > > Change-Id: I915b7889ff59829ddbc4479cd66d75a0bb581e54 > Reviewed-on: https://skia-review.googlesource.com/47501 > Commit-Queue: Stephen White <senorblanco@chromium.org> > Reviewed-by: Stephen White <senorblanco@chromium.org> TBR=senorblanco@chromium.org,reed@google.com,wangxianzhu@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I698433de66cf3de145b9319e09cb9ec9e30d2fa9 Reviewed-on: https://skia-review.googlesource.com/48160 Reviewed-by: Florin Malita <fmalita@chromium.org>
* Reland "Fix SkImageSource::filterBounds()"Gravatar Xianzhu Wang2017-09-16
| | | | | | | | | | | | | | | | | | | | | | This relands commit cb4d58766668b003fea67798027fc25d84acd059 which was reverted by commit b6d2be1330f16fe05f1eed5abda927c0fbb50055 because the original CL broke some blink layout tests. This reland let SkImageSource::filterBounds() return the dst rect with ctm applied regardless of direction. Original description: > Previously SkImageSource::filterBounds() uses the default > SkImageFilter::onFilterNodeBounds() which returns the input rect. > > Now override onFilterNodeBounds() in SkImageSource to return src > or dst rect (with transform applied). Change-Id: I915b7889ff59829ddbc4479cd66d75a0bb581e54 Reviewed-on: https://skia-review.googlesource.com/47501 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org>
* Revert "Fix SkImageSource::filterBounds()"Gravatar Mike Reed2017-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cb4d58766668b003fea67798027fc25d84acd059. Reason for revert: speculative fix for broken layout tests https://storage.googleapis.com/chromium-layout-test-archives/linux_chromium_rel_ng/547101/layout-test-results/results.html +fast/css/transformed-mask.html images diff image pass +svg/W3C-SVG-1.1-SE/filters-image-03-f.svg images diff image pass +svg/W3C-SVG-1.1-SE/filters-image-05-f.svg images diff image pass +svg/W3C-SVG-1.1/filters-displace-01-f.svg images diff image pass +svg/filters/feImage-preserveAspectRatio-all.svg images diff image pass +svg/filters/feImage-preserveAspectratio.svg images diff image pass Original change's description: > Fix SkImageSource::filterBounds() > > Previously SkImageSource::filterBounds() uses the default > SkImageFilter::onFilterNodeBounds() which returns the input rect. > > Now override onFilterNodeBounds() in SkImageSource to return src > or dst rect (with transform applied). > > Change-Id: I6681e1ba97affb09ef1ca5bc03b3d0f66c10f149 > Reviewed-on: https://skia-review.googlesource.com/46741 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Mike Reed <reed@google.com> TBR=senorblanco@chromium.org,reed@google.com,wangxianzhu@chromium.org Change-Id: Ib335f8e2ccbadc2335d23bc5f122fc5de53a8740 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/47342 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Fix SkImageSource::filterBounds()Gravatar Xianzhu Wang2017-09-15
| | | | | | | | | | | | | Previously SkImageSource::filterBounds() uses the default SkImageFilter::onFilterNodeBounds() which returns the input rect. Now override onFilterNodeBounds() in SkImageSource to return src or dst rect (with transform applied). Change-Id: I6681e1ba97affb09ef1ca5bc03b3d0f66c10f149 Reviewed-on: https://skia-review.googlesource.com/46741 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Optimize filterBounds() of SkArithmeticImageFilter/SkXfermodeImageFilterGravatar Xianzhu Wang2017-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | This brings the optimization in blink's FEComposit::MapRect() [1] into skia. Previously for these classes we used the default SkImageFilter:: onFilterBounds() which returns the union of the bounds of input filters. However, this was not optimized if some input filters don't contribute to the output. When we switch blink SPv2 paint invalidation from using blink's FilterOperations to cc/skia's filter classes, the non- optimization caused over-raster-invalidations. Now override SkImageFilter::onFilterBounds() in these classes to make their filterBounds() return the same results as the blink counterparts. Also fix a bug of SkArithmeticImageFilter when k4 is non-zero by overriding affectsTransparentBlack() to return true in the case, so that we will use the crop as the final bounds. [1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp?l=115 Change-Id: I91d4cadc267e6262ee3f050a0ddac90154419775 Reviewed-on: https://skia-review.googlesource.com/38921 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Stephen White <senorblanco@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>
* add tool_util to compare imagesGravatar Mike Reed2017-08-08
| | | | | | | | Bug: skia: Change-Id: I826190aa15cf42a3ca7f3c7d5271ead5b514c116 Reviewed-on: https://skia-review.googlesource.com/32220 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* don't rely on canvas->readPixelsGravatar Mike Reed2017-07-21
| | | | | | | | Bug: skia:3216 Change-Id: I01a8d0083c79c0fe71fbc4d8cfdde4fa6e48b636 Reviewed-on: https://skia-review.googlesource.com/25741 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Add an SkColorSpaceXformer image filter cacheGravatar Florin Malita2017-07-06
| | | | | | | | | | | | The cache is scoped with the SkColorSpaceXformer object. This ensures we're not transforming nodes with a degree > 1 multiple times, and preserves the DAG topology. Change-Id: I0b072cdac95f9f1c34e0565ed4f258aba986e1ae Reviewed-on: https://skia-review.googlesource.com/21726 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Image filter DAG test for makeColorSpace()Gravatar Florin Malita2017-07-06
| | | | | | | Change-Id: I8aa3a8c701fdfe215cae639bc9c7082340c756d4 Reviewed-on: https://skia-review.googlesource.com/21721 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Use RGBA rather than N32 for GPU testsGravatar Brian Salomon2017-07-05
| | | | | | | | | This is to support a Mock backend that passes non-rendering context unit tests and has minimal config support. Change-Id: I57c3ad2d347659d14382a8a7cf53424633bd86c6 Reviewed-on: https://skia-review.googlesource.com/21534 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* remove unused mode parameter from SkMergeImageFilterGravatar Mike Reed2017-06-19
| | | | | | | | Bug: skia: Change-Id: Iaa46aaef130a337987c3528685f59c56387d4a7d Reviewed-on: https://skia-review.googlesource.com/20210 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* add drawString helper to canvasGravatar Cary Clark2017-04-28
| | | | | | | | | | | | | | | | | | Many tests and examples use drawText with a guess of how long the text is in bytes, or a call to strlen(). Add a helper to SkCanvas to simplify these examples. Add another helper for SkString. R=reed@google.com Change-Id: I0204a31e938f065606f08ee7cd9a6b36db791ee2 Reviewed-on: https://skia-review.googlesource.com/13642 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@skia.org>
* calculate cull rects for SkMiniPicturesGravatar Mike Klein2017-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | This is the other half of https://skia-review.googlesource.com/c/7874/, adding the cull-shrinking feature of SkBigPictures to SkMiniPictures. Like SkBigPictures, shrink only when we're asked to build an R-tree. (We don't actually build a tree for one rect, of course.) We could do unconditionally, but SkPictureImageFilter uses the cull rect as its crop. It's unclear to me what this image filter unit test I've changed here was intending... had it had two draws we would have shrunk its cull, but because it was hitting the 1-draw SkMiniPicture path it kept the larger user-supplied cull. As the test doesn't appear to have been written with cull shrinking in mind, I've removed its SkRTreeFactory to keep that feature explicitly disabled there. BUG=skia:5974 Change-Id: I4118d2e85f2a69adef2e7a7fa9b9b8c17607a94f Reviewed-on: https://skia-review.googlesource.com/12624 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Finish overriding onMakeColorSpace() for SkImageFiltersGravatar Matt Sarett2017-04-17
| | | | | | | | | | Fixes 3 gms in gbr-8888. Breaks 0 gms in gbr-8888. Bug: skia: Change-Id: I3365390b16353821ef6057a7bb68020887e36f72 Reviewed-on: https://skia-review.googlesource.com/13323 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* hide lockpixels api behind flagGravatar Mike Reed2017-04-17
| | | | | | | | | | | | | | guarded by SK_SUPPORT_OBSOLETE_LOCKPIXELS needs https://codereview.chromium.org/2820873002/# to land first Bug: skia:6481 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Reviewed-on: https://skia-review.googlesource.com/13580 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Replace SkSpecialImage::makeTightSubset with asImage (take 2)Gravatar Robert Phillips2017-02-18
| | | | | | | | | | | | | | | This is a reland of https://skia-review.googlesource.com/c/8498/ (Replace SkSpecialImage::makeTightSubset with asImage) It must wait on https://codereview.chromium.org/2702703002/ (Add suppressions for upcoming Skia DEPS roll) due to minor layout test changes This should allow the relanding of: https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)) Change-Id: I7086a419869dbeb62d9b9e9714c796d54e75ee49 Reviewed-on: https://skia-review.googlesource.com/8701 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Replace SkSpecialImage::makeTightSubset with asImage"Gravatar Robert Phillips2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5df6db15dc04ea7f8c8fa7a7b58ecb881d7a70fe. Reason for revert: Possibly blocking Chrome DEPS roll Original change's description: > Replace SkSpecialImage::makeTightSubset with asImage > > This should allow the relanding of: > > https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)) > > Change-Id: I517af11036e3f44a280bbe6b9275f6c38f4a86a4 > Reviewed-on: https://skia-review.googlesource.com/8498 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ib5bebda78b2323e65a73504a61af918872ad231f Reviewed-on: https://skia-review.googlesource.com/8607 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Replace SkSpecialImage::makeTightSubset with asImageGravatar Robert Phillips2017-02-16
| | | | | | | | | | | This should allow the relanding of: https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)) Change-Id: I517af11036e3f44a280bbe6b9275f6c38f4a86a4 Reviewed-on: https://skia-review.googlesource.com/8498 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Set analytic AA as default.Gravatar liyuqian2016-11-14
| | | | | | | | | | | We'll use https://codereview.chromium.org/2471123002/ to keep Chrome from using analytic AA until we fix all the Chrome tests. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2471133002 Committed: https://skia.googlesource.com/skia/+/dca4f6530013cf43a2557ccb07f5cb4fd916b8e8 Review-Url: https://codereview.chromium.org/2471133002
* Revert of Set analytic AA as default. (patchset #8 id:140001 of ↵Gravatar liyuqian2016-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2471133002/ ) Reason for revert: SkASSERT triggered in some perf tests. Roll back. Original issue's description: > Set analytic AA as default. > > We'll use https://codereview.chromium.org/2471123002/ to keep Chrome from using > analytic AA until we fix all the Chrome tests. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2471133002 > > Committed: https://skia.googlesource.com/skia/+/dca4f6530013cf43a2557ccb07f5cb4fd916b8e8 TBR=fmalita@chromium.org,msarett@google.com,mtklein@google.com,reed@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/2499723002
* Set analytic AA as default.Gravatar liyuqian2016-11-11
| | | | | | | | | | We'll use https://codereview.chromium.org/2471123002/ to keep Chrome from using analytic AA until we fix all the Chrome tests. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2471133002 Review-Url: https://codereview.chromium.org/2471133002
* hide setImageFilter(ptr)Gravatar Mike Reed2016-11-01
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4184 Change-Id: Iad792cfdf54087ad4c424fd268559c162a9a5f5c Reviewed-on: https://skia-review.googlesource.com/4184 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* remove xfermode from public apiGravatar Mike Reed2016-10-28
| | | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4020 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac Reviewed-on: https://skia-review.googlesource.com/4020 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove many uses of kSkia8888 and kSkiaGamma8888Gravatar Brian Osman2016-10-14
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3405 Change-Id: Ie920f4bcbb3dd28114a66f2363643bb10009b840 Reviewed-on: https://skia-review.googlesource.com/3405 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints"Gravatar reed2016-10-05
| | | | | | | | | | | This reverts commit c245574ba3d0e2ade6c94b2812de3baa383bf4c4. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2396953002 TBR= Review-Url: https://codereview.chromium.org/2396953002
* Revert[7] "replace SkXfermode obj with SkBlendMode enum in paints"Gravatar Mike Reed2016-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8. Reason for revert: new assert from 100K bot Original change's description: > Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints" > > - perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter > This reverts commit 3ed485f4249e17abb4b11f5018d03175fd1afb44. > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2992 > > Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8 > Reviewed-on: https://skia-review.googlesource.com/2992 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I848e5a69c5cd67f2c14889f4f0a346652578c4ff Reviewed-on: https://skia-review.googlesource.com/3023 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>