aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkShader.h
Commit message (Collapse)AuthorAge
* SkShader::asACompose is android-onlyGravatar Mike Reed2017-06-09
| | | | | | | | Bug: skia: Change-Id: Ib99a7ee4984544f342699fa6b20797c55be7d5a0 Reviewed-on: https://skia-review.googlesource.com/19268 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Extend composeshader to support a lerp parameterGravatar Mike Reed2017-06-09
| | | | | | | | Bug: skia: Change-Id: I3bbb2cb8d0a84fca0309654498548ebc94d8938f Reviewed-on: https://skia-review.googlesource.com/18460 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Hide ctors of SkShader, SkImage & SkColorSpaceGravatar Florin Malita2017-05-26
| | | | | | | | | To prevent external clients from subclassing. Change-Id: I60a3833bf64019aea2f537850ca2a1ae38bb8767 Reviewed-on: https://skia-review.googlesource.com/18038 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Reland of SkShaderBaseGravatar Florin Malita2017-05-25
| | | | | | | | | | Introduce a private base class (SkShaderBase), to hide implementation details from the public interface (SkShader). Change-Id: Ib1d76cde880bd51868b97408710f8bb38128e536 Reviewed-on: https://skia-review.googlesource.com/17925 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert "SkShaderBase"Gravatar Florin Malita2017-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 58a756435ca3700d9766a4580bb0771a9774f603. Reason for revert: g3, Android borkage. Original change's description: > SkShaderBase > > Introduce a private base class (SkShaderBase), to hide > implementation details from the public interface (SkShader). > > Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176 > Reviewed-on: https://skia-review.googlesource.com/17241 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I32b012ee466dd006c074593f211f43ed602f1078 Reviewed-on: https://skia-review.googlesource.com/17845 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* SkShaderBaseGravatar Florin Malita2017-05-24
| | | | | | | | | | Introduce a private base class (SkShaderBase), to hide implementation details from the public interface (SkShader). Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176 Reviewed-on: https://skia-review.googlesource.com/17241 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Always use raster pipeline for SkSweepGradientGravatar Florin Malita2017-05-16
| | | | | | | | | | | | | Add an opt-in mechanism (SkShader::isRasterPipelineOnly) and switch SkSweepGradient to always-RP. This also repurposes the existing SK_LEGACY_SWEEP_GRADIENT guard. Change-Id: Iabf0a701eda56f009d331120f0c987f96bd35d27 Reviewed-on: https://skia-review.googlesource.com/16912 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Make SkCreateRasterPipelineBlitter() not fail.Gravatar Mike Klein2017-05-10
| | | | | | | | | | | | | | Mostly this is about extending the fallback in SkShader::appendStages() to cover more cases, and making sure subclasses call appendStages() so they can get the fallback, not onAppendStages() directly. We still need to watch for SkShader::makeContext() failing in the fallback itself, so sadly SkShader::appendStages() may still fail. Change-Id: I2314b234a24bdcecac401a385ce050d7fdf0a83e Reviewed-on: https://skia-review.googlesource.com/16369 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* clean up SkShader friendsGravatar Mike Klein2017-05-10
| | | | | | | | | | | | | | | Many SkShader subclasses are only friends to use makeColorSpace(). Our usual solution to this is to add a method on SkColorSpaceXformer that calls makeColorSpace() for us, so that only SkColorSpaceXformer needs to be a friend. Just a refactor. No image diffs. Change-Id: Icf952b739edf45f2fb8c0c35e353ef2866f4c5cc Reviewed-on: https://skia-review.googlesource.com/16370 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Minimize computeTotalInverse()'s inputsGravatar Florin Malita2017-05-08
| | | | | | | | | The helper doesn't need a full context rec - it only looks at the CTM and external local matrix. Pass these explicitly instead. Change-Id: I6a5884f65cd383c2df0e8d83c9086789bd96f345 Reviewed-on: https://skia-review.googlesource.com/15870 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* makeColorSpace() for SkColorFilterShader and SkLightingShaderGravatar Matt Sarett2017-04-21
| | | | | | | | | | Fixes 4 gms in gbr-8888 config. Bug: skia:6516 Change-Id: I9da839eb0211910989be35db0e13c0e1bbfa185d Reviewed-on: https://skia-review.googlesource.com/13964 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* SkColorSpaceXformer: Add SkShader::makeColorSpace()Gravatar Matt Sarett2017-04-19
| | | | | | | | | | | | | | | Just a refactor - reimplements the shader xforms with makeColorSpace(). 11 gms have diffs. Some are down to floating precision. The old implementation would go float->fixed->float in some cases. Others are due to improvements with gradient shaders inside local matrix shaders. Bug: skia:6516 Change-Id: I424406990c5c58a47833cf4c9ef146cd3ea6c37e Reviewed-on: https://skia-review.googlesource.com/13769 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Mark overridden destructors with 'override' and remove 'virtual'Gravatar Brian Salomon2017-03-22
| | | | | | | | | This silences a new warning in clang 5.0 Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8 Reviewed-on: https://skia-review.googlesource.com/10006 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Revert "More non-invertible shader local matrix guards"Gravatar Robert Phillips2017-02-11
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 368af4605db18f7197ed3289d2ebdc93bbb5879b. Reason for revert: checking to see if this is breaking the Chrome DEPS roll Original change's description: > More non-invertible shader local matrix guards > > Change-Id: Ida9a300420ff1d883e617cdaadb80e88c99ad226 > Reviewed-on: https://skia-review.googlesource.com/8333 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Florin Malita <fmalita@chromium.org> > TBR=brianosman@google.com,fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Id0a771342b9be27c85d91f511d814297b8c3e0b8 Reviewed-on: https://skia-review.googlesource.com/8345 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* More non-invertible shader local matrix guardsGravatar Florin Malita2017-02-10
| | | | | | | Change-Id: Ida9a300420ff1d883e617cdaadb80e88c99ad226 Reviewed-on: https://skia-review.googlesource.com/8333 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Use SkArenaAlloc in the SkAutoBlitterChoose code.Gravatar Herb Derby2017-02-07
| | | | | | | | | | | | | | | | | | | - Added default implementation of onMakeContext to support use in android. Searches for uses: "public SkShader" package:^chromium$ -file:^src/third_party/skia package:^aosp.* "public SkShader" -file:external/skia -file:.*third_party/skia package:^android$ "public SkShader" -file:external/skia -file:.*third_party/skia ... shows that no subclass overrides onCreateContext. TBR=reed@google.com TBR=mtklein@google.com Change-Id: I8bd5f57a79534574e344b165d31dccee41c31767 Reviewed-on: https://skia-review.googlesource.com/8140 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Revert "Use SkArenaAlloc instead of SkSmallAllocator in the ↵Gravatar Robert Phillips2017-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkAutoBlitterChoose code." This reverts commit 2b57b7f7a7fc97db57f190b5a8ebcf68e177ee2d. Reason for revert: Android compile failing Original change's description: > Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code. > > > TBR=reed@google.com > Change-Id: Iefb044bf7657fbf982f23aa91a3f4d013ce2c626 > Reviewed-on: https://skia-review.googlesource.com/7786 > Reviewed-by: Mike Klein <mtklein@chromium.org> > Reviewed-by: Herb Derby <herb@google.com> > Commit-Queue: Herb Derby <herb@google.com> > TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Id09c35377dddae0811d998b7d0c34c422325a5bc Reviewed-on: https://skia-review.googlesource.com/8129 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code.Gravatar Herb Derby2017-02-07
| | | | | | | | | TBR=reed@google.com Change-Id: Iefb044bf7657fbf982f23aa91a3f4d013ce2c626 Reviewed-on: https://skia-review.googlesource.com/7786 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* SkRasterPipeline shader adapterGravatar Florin Malita2017-01-31
| | | | | | | | | | | | | Reland of https://skia-review.googlesource.com/c/7615. (lifted from https://skia-review.googlesource.com/c/7088/) CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I797a2f0ae80209c8637875418e08d2fa03249672 Reviewed-on: https://skia-review.googlesource.com/7731 Commit-Queue: Florin Malita <fmalita@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "SkRasterPipeline shader adapter"Gravatar Florin Malita2017-01-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6d11ed2951fadc281433606a8edc6774bed39735. Build failure: https://chromium-swarm.appspot.com/task?id=3403da0cdee8c210&refresh=10 ../../../src/core/SkOpts.cpp -o obj/src/core/libskia.SkOpts.o In file included from ../../../src/core/SkOpts.cpp:46: ../../../src/opts/SkRasterPipeline_opts.h:1093:11: error: no member named 'Load4' in '(anonymous namespace)::SkNx<8, float>' SkNf::Load4(buf, &r, &g, &b, &a); ~~~~~~^ 1 error generated. Leak: https://chromium-swarm.appspot.com/task?id=3403df55fd5eaa10&refresh=10 Original change's description: > SkRasterPipeline shader adapter > > (lifted from https://skia-review.googlesource.com/c/7088/) > > R=​mtklein@google.com,herb@google.com,reed@google.com > > CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD > > Change-Id: Idddb84069423c5fc535bea0a65a5b21a4d07084d > Reviewed-on: https://skia-review.googlesource.com/7615 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Mike Klein <mtklein@chromium.org> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I68c0be3398bde93cd0842baf25b025c5fe1c3df7 Reviewed-on: https://skia-review.googlesource.com/7730 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* SkRasterPipeline shader adapterGravatar Florin Malita2017-01-29
| | | | | | | | | | | | | | (lifted from https://skia-review.googlesource.com/c/7088/) R=mtklein@google.com,herb@google.com,reed@google.com CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Idddb84069423c5fc535bea0a65a5b21a4d07084d Reviewed-on: https://skia-review.googlesource.com/7615 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Raster pipeline support for SkLocalMatrixShader compositionGravatar Florin Malita2017-01-27
| | | | | | | | | | Plumb a local matrix arg to onAppendStages, similar to onCreateContext's ContextRec::fLocalMatrix. Change-Id: I6db3706918733b35eb7a3ae2cc65503223d0cf2d Reviewed-on: https://skia-review.googlesource.com/7653 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Remove unused asACustomShader function from SkShaderGravatar Greg Daniel2017-01-20
| | | | | | | | | | | | I recentely removed the only call site of this so it should be safe to delete now. BUG=skia: Change-Id: Id7fa94b9af5d73c4f7bb5e5a657d6fc6728923b5 Reviewed-on: https://skia-review.googlesource.com/7330 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Remove SkFallbackAlloc and SkFixedAlloc.Gravatar Herb Derby2017-01-16
| | | | | | | | | | | CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN;skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN TBR=reed@google.com Change-Id: I1000dc9ed8ad65b249798759d9af99f47fc237d2 Reviewed-on: https://skia-review.googlesource.com/6809 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* cleanup after 95e3c05Gravatar Hal Canary2017-01-12
| | | | | | | | | Change-Id: Ifd194fd009196b8bee2dd83328bbe698586d72f4 Reviewed-on: https://skia-review.googlesource.com/6965 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'" This reverts commit c456b73fef9589bbdc5eb83eaa83e53c357bb3da. Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab Reviewed-on: https://skia-review.googlesource.com/6886 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Plumb dst color space in many places, rather than "mode"Gravatar Brian Osman2016-12-09
| | | | | | | | | | | | | | | | | This is less to type in most cases, and gives us more information (for things like picture-backed images, where we need to know all about the destination surface). Additionally, strip out the plumbing entirely for bitmap sources, where we don't need to know anything. BUG=skia: Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da Reviewed-on: https://skia-review.googlesource.com/5748 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@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>
* support a8Gravatar Mike Klein2016-11-29
| | | | | | | | | | | Most of this is plumbing through the full paint to shaders instead of just the filter quality. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I6afde07566afa3a4391c24dca7017a9a4f5ec700 Reviewed-on: https://skia-review.googlesource.com/5317 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Plumb filter quality into SkShader::appendStages().Gravatar Mike Klein2016-11-17
| | | | | | | | | | | | | We of course need this to know whether or not to bilerp. TBR=herb@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4932 Change-Id: I5fe6d93c1d36d0d53f566f722960fcafb0d8bc3c Reviewed-on: https://skia-review.googlesource.com/4932 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Ignore ctm param of SkShader::onAppendStages()Gravatar Florin Malita2016-11-15
| | | | | | | | | | | | | | | | | | Clang 3.8.0: ../../include/core/SkShader.h:513:49: error: unused parameter 'ctm' [-Werror,-Wunused-parameter] const SkMatrix& ctm) const { R=mtklein@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4867 Change-Id: I242180cb33ad099b28b06654934029690da195ee Reviewed-on: https://skia-review.googlesource.com/4867 Commit-Queue: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* More shader preliminaries / refactoringGravatar Mike Klein2016-11-15
| | | | | | | | | | | | | | | | - thread through ctm - make blitter handle paint modulation instead of each shader TBR=herb@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4830 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I8161e6b3864c4e48e4d47d5ad40a56a13c02fee8 Reviewed-on: https://skia-review.googlesource.com/4830 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Start hooking shaders into SkRasterPipelineBlitter.Gravatar Mike Klein2016-11-14
| | | | | | | | | | | | | Here first just the simplest, constant-color shaders. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4743 Change-Id: I92c6523660e21a1e2aa353524570230282ba5dfe Reviewed-on: https://skia-review.googlesource.com/4743 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove use of xfermode* in procsGravatar Mike Reed2016-11-09
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4592 Change-Id: I99f35924ff5325dfac527bb573a86d2d0366e0b3 Reviewed-on: https://skia-review.googlesource.com/4592 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Rename SkSourceGammaTreatment to SkDestinationSurfaceColorModeGravatar Brian Osman2016-11-09
| | | | | | | | | | | | | | | This is much more explicit about what that type represents (are we in legacy mode or not), which also makes it suitable for other (upcoming) usage. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4529 Change-Id: Iacb397c34e7765f1ca86c0195bc622b2be4d9acf Reviewed-on: https://skia-review.googlesource.com/4529 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAMGravatar Mike Reed2016-11-03
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4384 Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0 Reviewed-on: https://skia-review.googlesource.com/4384 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove SK_SUPPORT_LEGACY_SHADER_ASALOCALMATRIXSHADERGravatar Ben Wagner2016-11-02
| | | | | | | | | This is no longer used and can be removed. Change-Id: I6aab1cf243aa1f09bdcd26517a392bbcf11c9444 Reviewed-on: https://skia-review.googlesource.com/4360 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@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>
* SkShader* refAs... to sk_sp<SkShader> makeAs...Gravatar Ben Wagner2016-10-24
| | | | | | | | | | | There appear to be no existing overriders of the refAs.. method outside Skia. Change-Id: Iab174e83023093b4d7fc0bd8907666b66ddb1eea Reviewed-on: https://skia-review.googlesource.com/3746 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* remove 4 legacy flags (clients already updated)Gravatar Mike Reed2016-10-20
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3785 Change-Id: I187e50e09ed7a3316719fae51af770259928fdf9 Reviewed-on: https://skia-review.googlesource.com/3785 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Add helper to create random AsFPArgs for Ganesh unit testsGravatar Brian Osman2016-10-19
| | | | | | | | | | | | | | Reduces copy-paste and eases maintenance. I'll be adding another field to AsFPArgs soon, and this is going to streamline that change. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3639 Change-Id: I6372ed5dce50a5ba9d73039bd4714e34502a1f75 Reviewed-on: https://skia-review.googlesource.com/3639 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* isABitmap is deprecated, use isAImageGravatar Mike Reed2016-09-28
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2748 Change-Id: I7006a3231ff0e9e39b187deae550364bc97f49d6 Reviewed-on: https://skia-review.googlesource.com/2748 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Always return ImageShader, even from SkShader::MakeBitmapShaderGravatar reed2016-08-02
| | | | | | | | | | | | | | | Lessons learned 1. ImageShader (correctly) always compresses (typically via PNG) during serialization. This has the surprise results of - if the image was marked opaque, but has some non-opaque pixels (i.e. bug in blitter or caller), then compressing may "fix" those pixels, making the deserialized version draw differently. bug filed. - 565 compressess/decompresses to 8888 (at least on Mac), which draws differently (esp. under some filters). bug filed. 2. BitmapShader did not enforce a copy for mutable bitmaps, but ImageShader does (since it creates an Image). Thus the former would see subsequent changes to the pixels after shader creation, while the latter does not, hence the change to the BlitRow test to avoid this modify-after-create pattern. I sure hope this prev. behavior was a bug/undefined-behavior, since this CL changes that. BUG=skia:5595 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2195893002 Review-Url: https://codereview.chromium.org/2195893002
* implement isABitmap for imageshader, return localmatrix for bitmap's implGravatar reed2016-08-01
| | | | | | | | | For imageshader, I only return true if the image is explicitly raster-backed. I do not return true for texture, nor for generator (i.e. lazy/picture) backed. Is that ok? BUG=skia:5592 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2197323002 Review-Url: https://codereview.chromium.org/2197323002
* Add destination color space to AsFPArgs. Eliminates last XFORMTODO.Gravatar brianosman2016-07-25
| | | | | | | | | | | | This is going to be needed in many more places as I finish connecting the dots. Even better - I'd like to switch to a world where SkColorSpace != nullptr is the only signal we use for gamma-correct rendering, so I can eliminate SkSourceGammaTreatment and SkSurfaceProps::isGammaCorrect. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2180503002 Review-Url: https://codereview.chromium.org/2180503002
* Bundle SkShader::asFragmentProcessor arguments in a structGravatar brianosman2016-07-22
| | | | | | | | | | The signature of this thing keeps changing (and is about to change again). This just makes maintenance much easier. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2175563003 Review-Url: https://codereview.chromium.org/2175563003
* sk_sp for Ganesh.Gravatar bungeman2016-06-09
| | | | | | | | | | Convert use of GrFragmentProcessor, GrGeometryProcessor, and GrXPFactory to sk_sp. This clarifies ownership and should reduce reference count churn by moving ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004 Review-Url: https://codereview.chromium.org/2041113004
* Add new SkSourceGammaTreatment enum, used in situations like mipmap ↵Gravatar brianosman2016-06-06
| | | | | | | | | construction, where we need to know if we should respect (vs. ignore) the gamma encoding of sRGB tagged images. Plumb that extensively. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2037413002 Review-Url: https://codereview.chromium.org/2037413002
* move colorshader into its own .cpp, add color4f variantGravatar reed2016-05-04
| | | | | | | | | | | | | Implemented as a different subclass for SkColorShader (which is also private) partly to make the CL clearer/simpler, and partly for flatten/unflatten compatibility. Later I'm sure we could combine these if that proves useful. Lots of TODOs at the moment, but still valuable to get reviewed. Note: this ignores the question (for the moment) about how to interpret SkColor in the larger world. That needs to happen, but this CL is more focused on what *else* to do besides handle the old-style input (and old-style pipeline). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1934313002 Review-Url: https://codereview.chromium.org/1934313002
* Revert of Delete SkFlattenable::Type (patchset #2 id:20001 of ↵Gravatar mtklein2016-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1834303003/ ) Reason for revert: Used by Chrome. c:\b\build\slave\workdir\build\src\cc\playback\compositing_display_item.cc(53): error C2039: 'GetFlattenableType': is not a member of 'SkColorFilter' c:\b\build\slave\workdir\build\src\third_party\skia\include\core\skshader.h(19): note: see declaration of 'SkColorFilter' c:\b\build\slave\workdir\build\src\cc\playback\compositing_display_item.cc(53): error C3861: 'GetFlattenableType': identifier not found Original issue's description: > Delete SkFlattenable::Type > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1834303003 > > Committed: https://skia.googlesource.com/skia/+/99d9231f6a4cb6b85b8637e9d8ae32f8bd7c466f TBR=reed@google.com,msarett@google.com # 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/1853383002