aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* Reland "Remove antialiasing control from GrPaint."Gravatar Brian Salomon2016-12-09
| | | | | | | | | | | | | This contains fixes for GLPrograms test and mixed samples rendering. This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4. BUG=skia: Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87 Reviewed-on: https://skia-review.googlesource.com/5763 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove SkImage::makeTextureImageGravatar Brian Osman2016-12-09
| | | | | | | | | | | | | | No one (other than test code) was using this API, and it lacks the context to do the right thing. Specifically, if this forces a decode of an encoded image, we don't know the intended use (re: color spaces) to determine how we should decode. BUG=skia: Change-Id: I6ff700b3a5adce8257f35c5e3dd5ba557b2a3219 Reviewed-on: https://skia-review.googlesource.com/5614 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Different approach to fixing gpu blurs on platforms that "useDrawInsteadOfClear"Gravatar Robert Phillips2016-12-09
| | | | | | | | | | | This CL reverts https://skia-review.googlesource.com/c/5148/ (Fix gpu blurring on platforms that "useDrawInsteadOfClear") (all the worstCaseWidth/Height stuff) and adds a new GrRenderTargetContext entry point (absClear) to specify clears that can't be discarded or altered. BUG=skia: Change-Id: I18b1373ecf4a153ca8c0f290ab8b1d00770426da Reviewed-on: https://skia-review.googlesource.com/5484 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make command buffer sRGB mip-mapping more predictableGravatar Brian Osman2016-12-09
| | | | | | | | | BUG=chrome:655247 Change-Id: I1c987939ac224075cdd385c879dd091fb0efd82a Reviewed-on: https://skia-review.googlesource.com/5753 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Do not create SkGifCodec if true size is not knownGravatar Leon Scroggins III2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is enough data in the stream to read the reported canvas size, but not enough to read the first image's header, we do not know the true canvas size, since we may expand it to fit the first frame. In that case, return nullptr from NewFromStream. Add a test. SkGifCodec.cpp: Correct a comment - parse returns false if there is a fatal error. parse() returning true does not guarantee that the size was found. Instead of checking the width and height, check to see whether the first frame exists and has its header defined. If not, we do not yet know the true canvas size. Assert that the canvas size is non-zero, which is a fatal error from parse. SkGifImageReader.cpp: Move the code to set the header defined before the SkGIFSizeQuery exit condition. This allows SkGifCodec to check the first frame's header to determine whether the size is known. GifTest.cpp: Add a test which truncates the file just before the image header (and after the global header). Prior to the other changes, this would create an SkCodec. For an image that needs its canvas size expanded, the SkCodec would have an incorrect size. CodecPartialTest.cpp: randPixels.gif now needs more than half of its data to create an SkCodec, so set a minimum for test_partial. Change-Id: I40482f524128b2f1fe59b8f27dd64c7cbe793079 Reviewed-on: https://skia-review.googlesource.com/5701 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Revert "Revert "Add antialiasing to SkDropShadowImageFilter's shadow draw""Gravatar Robert Phillips2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 45aac57ac6195880930441656a0988453f16c3db. Reason for revert: Pixel test suppression has landed in Chrome: https://codereview.chromium.org/2559213002 (Add suppression for GPU Pixel test in preparation for Skia CL) Original change's description: > Revert "Add antialiasing to SkDropShadowImageFilter's shadow draw" > > This reverts commit 78e8165ec3a408a88c394095bfbc43df2051449d. > > Reason for revert: Chrome pixel test > > Original change's description: > > Add antialiasing to SkDropShadowImageFilter's shadow draw > > > > A BW draw in the SkDropShadowImageFilter can lead to unexpected popping of the shadow when the dest rect lies on half pixel boundaries. > > > > Change-Id: Ibc59dacc79bca8955981ec2889e79facd7d2de83 > > Reviewed-on: https://skia-review.googlesource.com/5669 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I0b0073cd8d9f1502daaa452c2153af029c11e52a > Reviewed-on: https://skia-review.googlesource.com/5652 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I7d844c486fd6db57d3df60a32c12699f2d85ad16 Reviewed-on: https://skia-review.googlesource.com/5747 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"Gravatar Mike Reed2016-12-09
| | | | | | | | | | | This reverts commit a129dfef2aaab0b5995cdf1ab7b2cdd41c29cf72. BUG=skia: Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91 Reviewed-on: https://skia-review.googlesource.com/5722 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* Revert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"Gravatar Mike Reed2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8e7432b7f98dd592e529a0c8bb038d73ebfb0478. Reason for revert: <INSERT REASONING HERE> external/skia/bench/../tools/android/SkAndroidSDKCanvas.h:103:36: error: C++ requires a type specifier for all declarations void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override; Original change's description: > remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS > > > switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone > > BUG=skia: > > Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d > Reviewed-on: https://skia-review.googlesource.com/5714 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: If26ea91d7464615e43c1d3d2f726e337ff56b55c Reviewed-on: https://skia-review.googlesource.com/5721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* fix fuzzersGravatar Cary Clark2016-12-08
| | | | | | | | | | | | | | Two crashes and a hang. Abort and return false in these cases. TBR=kjlubick@google.com BUG=skia:5983 Change-Id: I41ac3e56d47ee423b634b2f4886085b9caada76b Reviewed-on: https://skia-review.googlesource.com/5716 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove SK_SUPPORT_LEGACY_CLIP_REGIONOPSGravatar Mike Reed2016-12-08
| | | | | | | | | | | switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone BUG=skia: Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d Reviewed-on: https://skia-review.googlesource.com/5714 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* simplify bugGravatar Cary Clark2016-12-08
| | | | | | | | | | | | | | | | | | | | | | | The path contains a cubic with a very tight curve. Split the cubic into pieces so that the individual curves are better behaved. Use both inflections and max curvature to potentially split cubics. Since this may require a bit of work, preflight to ignore cubics that monotonically change in x and y. Only one of the three tests referred to by the bug below repro'd. Use path.dumpHex() instead of path.dump() to capture the crashing data. TBR=reed@google.com BUG=skia:6041 Change-Id: I29a264f87242cacc7c421e7685b90aca81621c74 Reviewed-on: https://skia-review.googlesource.com/5702 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX flagGravatar Mike Reed2016-12-08
| | | | | | | | | BUG=skia: Change-Id: I51b7778db8b596b2633b6be9488af984cee2af70 Reviewed-on: https://skia-review.googlesource.com/5713 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Removed non-Identity matrix in non-PCSXYZ Input check for ICC profilesGravatar raftias2016-12-08
| | | | | | | | | | | | | The presence seems to be disallowed in the specs (10.8/10.9), but two test images on the ICC website have them, and fail if we abort. Replaced the failure with a print warning. BUG=skia: Change-Id: I463f1a8861eaa0eb62081c3213017dba9012c890 Reviewed-on: https://skia-review.googlesource.com/5658 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Revert "Remove antialiasing control from GrPaint."Gravatar Brian Salomon2016-12-08
| | | | | | | | | | | This reverts commit 9f549358b3ac9f61e78b194e39d6ac6eb322e35e. Reason for revert: hitting asserts Change-Id: I542d34edc05ecf72b7646263f25736a0950c78e7 Reviewed-on: https://skia-review.googlesource.com/5707 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove antialiasing control from GrPaint.Gravatar Brian Salomon2016-12-08
| | | | | | | | | | | | | This adds an additional param (of new enum type GrAA) to draws that can antialias and a new enum GrAAType to indicate the AA technique (none, fragment shader computed coverage, msaa). Some GMs change due to this: 1) In some places we weren't disabling MSAA when the draw was supposed to be unantialiased. 2) Some bounding rect draws that use GrFragmentProcessors were unnecessarily turning on antialiasing, by disabling it a very small number of pixel LSBs change. Change-Id: I7d8d8793dda70bcd373d09055beb9949c1a8a4d0 Reviewed-on: https://skia-review.googlesource.com/5608 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Added some named gamma recognition to lutnType ICC profile parsingGravatar raftias2016-12-08
| | | | | | | | | | | | | | Most CMYK images I tested had linear gamma specified as tables, which is easily recognized and when present allows an entire SkRasterPipeline stage to be avoided for every single channel. This is likely due to the fact that gamma tables are required in lutntype A2B0 profiles. BUG=skia: Change-Id: I82b65848c4099035d61098abb66e9afe0b080930 Reviewed-on: https://skia-review.googlesource.com/5388 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Added clamps in SkRasterPipeline's gamma stages.Gravatar raftias2016-12-08
| | | | | | | | | | | | | | Clamping stages were also removed from SkColorSpace_A2B as they are now not needed. BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I24e2e411e12b463854e980cb10c0e6bafb4a7c42 Reviewed-on: https://skia-review.googlesource.com/5546 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Make sure all the convolve functions are defined.Gravatar Mike Klein2016-12-08
| | | | | | | | | | CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-GCC-x86_64-Release-Fast,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I5ae1fdee957f796d8051bbb0eca9e037aef9b2c9 Reviewed-on: https://skia-review.googlesource.com/5655 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add AVX2 version of ConvolveVerticallyGravatar xiangze.zhang2016-12-07
| | | | | | | | | | | | | | | | ConvolveVertically time is reduced about 60% using haswell cpu. Nanobench results: before after bitmap_scale_filter_64_256 611us 302us bitmap_scale_filter_80_90 101us 64.9us bitmap_scale_filter_30_90 82.3us 51.4us bitmap_scale_filter_10_90 73.6us 42.4us BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2526733002 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Review-Url: https://codereview.chromium.org/2526733002
* Revert "Add antialiasing to SkDropShadowImageFilter's shadow draw"Gravatar Robert Phillips2016-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 78e8165ec3a408a88c394095bfbc43df2051449d. Reason for revert: Chrome pixel test Original change's description: > Add antialiasing to SkDropShadowImageFilter's shadow draw > > A BW draw in the SkDropShadowImageFilter can lead to unexpected popping of the shadow when the dest rect lies on half pixel boundaries. > > Change-Id: Ibc59dacc79bca8955981ec2889e79facd7d2de83 > Reviewed-on: https://skia-review.googlesource.com/5669 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I0b0073cd8d9f1502daaa452c2153af029c11e52a Reviewed-on: https://skia-review.googlesource.com/5652 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Rename GrBatchFlushState to GrOpFlushStateGravatar Brian Salomon2016-12-07
| | | | | | | Change-Id: I1a8052c61d7624929caf45ba44e2a465cd0dc1c2 Reviewed-on: https://skia-review.googlesource.com/5649 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Rename GrRTC::drawBatch to addDrawOp and local vars in GrRTC.cppGravatar Brian Salomon2016-12-07
| | | | | | | Change-Id: Ic8b896d7779844de5f82f9f0e630508578a8f61d Reviewed-on: https://skia-review.googlesource.com/5647 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* no need for SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT anymoreGravatar Mike Reed2016-12-07
| | | | | | | | | BUG=skia: Change-Id: If0aa01beb8be9bd7d9a3a5b23c795223b02f02d3 Reviewed-on: https://skia-review.googlesource.com/5690 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* SkBitmap::ComputeIsOpaque -> SkPixmap::computeIsOpaqueGravatar Hal Canary2016-12-07
| | | | | | | | | | | | | | Motivation: Twice internal Skia clients have to do something awkward like this: bool ComputeIsOpaque(const SkPixmap& pixmap) { SkBitmap bm; return bm.installPixels(pixmap) && SkBitmap::ComputeIsOpaque(bm); } Change-Id: I7263c06f754c1305ecb07c4c005d9cfb9d1f523d Reviewed-on: https://skia-review.googlesource.com/5684 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "Fix SDF generation for pixel-aligned paths"Gravatar Jim Van Verth2016-12-07
| | | | | | | | | | | This reverts commit 92964124c5ff61729357a51dc212ca5938093e89. Reason for revert: Causing roll failure. Need to find images to rebaseline Change-Id: I09cad4c3a48fefcfc669fb1045613336c88cb33a Reviewed-on: https://skia-review.googlesource.com/5686 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
* SkBitmap::ComputeIsOpaque and SkBitmap::eraseColor support F16Gravatar Hal Canary2016-12-07
| | | | | | | | | Also add a unit test. Change-Id: I9b6635ce9dd504788ca36b3246eaac2b37c2f3a6 Reviewed-on: https://skia-review.googlesource.com/5443 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Rename batch->op in GrOpList and subclassesGravatar Brian Salomon2016-12-07
| | | | | | | Change-Id: I9c82483c4ac0dc140fb1e5e3650d6ff1e5917e99 Reviewed-on: https://skia-review.googlesource.com/5646 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Rework GrRenderTargetOpList::setupDstReadIfNecessary.Gravatar Brian Salomon2016-12-07
| | | | | | | | | | | | | Move the necessary check to the caller. This removes the GrPipelineBuilder param which makes this useable with future GrDrawOps that can be recorded without one. Rename to setupDstTexture(). This only is involved in the texture method of getting the destination color to the XP. Change-Id: I1b781da3d42586534470a23a572805ec939cb730 Reviewed-on: https://skia-review.googlesource.com/5645 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* hide emboss from everyone (except android for now)Gravatar Mike Reed2016-12-07
| | | | | | | | | BUG=skia: Change-Id: Ibd453b0a63948e3e4950f02459d7bc01a6ed26c5 Reviewed-on: https://skia-review.googlesource.com/5671 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* Skip the sRGB mip-map testing on command bufferGravatar brianosman2016-12-07
| | | | | | | | | Chromium command buffer now has the sRGB decode extension, but it doesn't make any guarantees about the interaction with glGenerateMipmap. BUG=skia: Review-Url: https://codereview.chromium.org/2557603006
* Add antialiasing to SkDropShadowImageFilter's shadow drawGravatar Robert Phillips2016-12-07
| | | | | | | | | A BW draw in the SkDropShadowImageFilter can lead to unexpected popping of the shadow when the dest rect lies on half pixel boundaries. Change-Id: Ibc59dacc79bca8955981ec2889e79facd7d2de83 Reviewed-on: https://skia-review.googlesource.com/5669 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix SDF generation for pixel-aligned pathsGravatar Jim Van Verth2016-12-07
| | | | | | | | | BUG=668550 Change-Id: Ib496db82c7391aca61b31afaeb5445260170cc49 Reviewed-on: https://skia-review.googlesource.com/5549 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Tighten up when a line requires aa in SkGpuDevice.Gravatar Brian Salomon2016-12-07
| | | | | | | | | For some reason this was dropping AA on horizontal/vertical lines at integers rather than half-integers. Change-Id: I291652778d9dfc46072edcb2a557b8aea332afff Reviewed-on: https://skia-review.googlesource.com/5633 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Rewrite GrRenderTargetContext::drawRegion antialias logic.Gravatar Brian Salomon2016-12-06
| | | | | | | | | This will hopefully make a later change that refactors how aa is passed to GrRenderTargetContext a little easier to review. Change-Id: Ie750d237714a0407ec1e5604c0daa080da32519b Reviewed-on: https://skia-review.googlesource.com/5630 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add comment explaining the derivation of our Mitchell coefficientsGravatar Brian Osman2016-12-06
| | | | | | | | | BUG=skia: Change-Id: I8866df425ee9837e75f0b2f76777f7e5d68fb21d Reviewed-on: https://skia-review.googlesource.com/5624 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Refactor bilerp a little.Gravatar Mike Klein2016-12-06
| | | | | | | | | | | | | | | | | | | 1) rename to bilerp_xy, for x,y in {n[egative], p[ositive}; 2) pull out a save_xy stage to save off the original x,y; 3) also calculate the fractional x,y fx,fy once instead of 4 times. 1) is a pure refactor; 2) adds a stage but otherwise is nothing different; 3) changes images a little bit (fractional parts can vary a bit around powers of two). This extends naturally to naive bicubic using 16 bicubic_xy stages. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I666de5c21e978abb4feb6e3225e5b5920ba6c5b9 Reviewed-on: https://skia-review.googlesource.com/5550 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Apply linear gradient premul in 4fGravatar fmalita2016-12-06
| | | | | | | | | | | | | | | | | | | | | | | | (spotted by reed@) Instead of converting to SkPMColor first, apply the premul in 4f and then just store. A modified bench shows a significant speedup: 17/17 MB 1 690µs 695µs 695µs 700µs 0% █▅▁▄▆▅▁▅▆▃ 8888 gradient_linear_clamp_3color 17/17 MB 1 832µs 837µs 839µs 870µs 1% █▁▁▂▂▂▂▂▂▂ 8888 gradient_linear_clamp_hicolor 17/17 MB 1 651µs 659µs 665µs 701µs 3% ▆█▅▁▂▂▁▁▂▂ 8888 gradient_linear_clamp vs. 17/17 MB 1 1.03ms 1.03ms 1.04ms 1.08ms 2% ██▇▁▁▁▁▁▁▁ 8888 gradient_linear_clamp_3color 17/17 MB 1 1.17ms 1.18ms 1.18ms 1.22ms 1% █▄▂▁▁▁▁▁▁▁ 8888 gradient_linear_clamp_hicolor 17/17 MB 1 1.1ms 1.15ms 1.14ms 1.16ms 2% ▇▇▇▇▇▇██▁▁ 8888 gradient_linear_clamp R=reed@google.com,brianosman@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2409583003 Review-Url: https://codereview.chromium.org/2409583003
* Remove dest surface color mode from bitmap controllerGravatar Brian Osman2016-12-06
| | | | | | | | | | | This is already on the bitmap provider - no need to plumb it here. BUG=skia: Change-Id: Ie8c5aef8ea443c58d59598aa66e357ad4c212b25 Reviewed-on: https://skia-review.googlesource.com/5621 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* fStages.data() should always be defined, but UBSAN says NOGravatar Mike Klein2016-12-06
| | | | | | | | | | CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I6aef3ec2bcb85d6ad4830c759a1234ef2e31f32d Reviewed-on: https://skia-review.googlesource.com/5552 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* remove upper limit on number of pipeline stagesGravatar Mike Klein2016-12-06
| | | | | | | | | | | Bicubic is going to blow right past 48. At this point the fixed preallocation strategy is starting to look naive... at 64 we'd allocate just over 1K for every pipeline (and every compiled pipeline). CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Ib2944ead1217123aba2b6347fd9d5315217540c9 Reviewed-on: https://skia-review.googlesource.com/5551 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Use FT_LOAD_BITMAP_METRICS_ONLY flagGravatar Seigo Nonaka2016-12-05
| | | | | | | | | | | | FT_LOAD_BITMAP_METRICS_ONLY flag was introduced for retrieving font metrics without decoding or allocating bitmaps. BUG=skia: Change-Id: I901531501111f24d8b670305379e04c0bc688e6f Reviewed-on: https://skia-review.googlesource.com/5580 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Add destination color space to shader ContextRecGravatar Brian Osman2016-12-05
| | | | | | | | | BUG=skia: Change-Id: Ib1920fffd5735ad54a5b785bbc2676ea240bdbfa Reviewed-on: https://skia-review.googlesource.com/5611 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Make flag values in GrResourceProvider and GrTextureProvider consistentGravatar Brian Salomon2016-12-05
| | | | | | | | | | | BUG=chromium:665673 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5602 Change-Id: I41522aa24cd4b4a7e085132dd9bcbfdd66bd9617 Reviewed-on: https://skia-review.googlesource.com/5602 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Color-correct Gray JPEG image decoding via ICC profiles.Gravatar raftias2016-12-05
| | | | | | | | | | | | | | | | | | SkColorSpace::MakeICC now parses Gray ICC profiles and SkColorSpaceXform_A2B can now render color spaces from Gray ICC profiles. This is not enabled for SkPngCodec as of right now as we don't have any Gray PNG test images currently. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5214 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Iea7136d1c163cd17cf0818af57f93efdbcb577e7 Reviewed-on: https://skia-review.googlesource.com/5214 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Manual byte -> float conversion.Gravatar Mike Klein2016-12-05
| | | | | | | | | | | | | | | | | | | This is a follow-up to reviews.skia.org/5540, which did float -> byte. We use the same trick here exploiting 32768.0f / 0x47000000. The benefit here is smaller than the other CL, but still measurable. The exchange here is: before: int->float, multiply after: OR, FMA The cost of an FMA is the same as a multiply, so we're basically just replacing int->float conversion with a bitwise OR. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Ieac2247664afa3ff415aec2b48c21505905bee23 Reviewed-on: https://skia-review.googlesource.com/5542 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Remove use of makeDeferredRenderTargetContextWithFallback"Gravatar Robert Phillips2016-12-05
| | | | | | | | | | | | | This reverts commit 155b29224d64b5c12bf7fc789edb5c257b6281c8. Reason for revert: https://skia-review.googlesource.com/c/5541/ (Second part of piecemeal revert) seems to have zeroed in on the change that caused the perf regression. Let's see if the changes reverted in this CL are acceptable. Change-Id: I477fe23d84a9c14f87a431ec2b495f617ff410be Reviewed-on: https://skia-review.googlesource.com/5573 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Fix max/min errorGravatar Matt Sarett2016-12-04
| | | | | | | | | BUG=skia: Change-Id: I6a690e843476e31077a90a8312f6335d8ef230f4 Reviewed-on: https://skia-review.googlesource.com/5544 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Do not create an SkRawCodec with zero dimensionsGravatar Leon Scroggins III2016-12-02
| | | | | | | | | | | | Add a test BUG=skia:3534 BUG=b/33300701 Change-Id: Ifb3a824a36998c5e626c4ad58466845f49d18ebf Reviewed-on: https://skia-review.googlesource.com/5568 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Second part of piecemeal revertGravatar Robert Phillips2016-12-02
| | | | | | | | | | | | | This is a partial revert of https://codereview.chromium.org/2514543002 (Defer more renderTargetContexts in the GPU image filter paths - take 2) I have been unable to reproduce the performance regression in crbug.com/668179 locally so intend to revert the above CL piecemeal. BUG=668179 Change-Id: Iee9d0164f85ae33ff8dfa9b3eb01c07fd825f017 Reviewed-on: https://skia-review.googlesource.com/5541 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Tricky float -> byte conversion in store_8888.Gravatar Mike Klein2016-12-02
| | | | | | | | | | | | | | | | | | | | | In IEEE, for each byte BB, the float 0x470000BB equals 32768.0f + BB*(1/256.0f). So to turn a [0,1] float into a byte, we can - multiply by (255/256.0f) to get into [0,255/256.0f] range, - add 32768.0f to get into [32768.0f, 32768.0f + 255/256.0f] range, - look at the low byte. Those first two of course are an FMA. Using this trick here makes store_8888 measurably faster. Instead of a FMA then float->int trunc, we do an FMA then a bitwise AND. Overall the math goes from 4 FMA + 4 trunc + 3 shift to 4 FMA + 3 AND + 3 shift (we can skip the shift for red and the AND for alpha). As you might guess, AND is cheaper than trunc, so this is a net win. I should be able to follow up with the same trick in reverse in from_8888(). CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I42c8f4a6ea0b6c22160517cf5f9c048f01c9a330 Reviewed-on: https://skia-review.googlesource.com/5540 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>