aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GrPorterDuffTest.cpp
Commit message (Collapse)AuthorAge
* Remove clamping of kPlus with F16 configsGravatar Brian Osman2018-07-11
| | | | | | | | | | | | | | | | | The most common use-case for F16 is to draw things that are explicitly outside of [0,1]. We can't prevent out-of-range values in general, users could just draw out-of-range content in src mode. We've decided that it's best to avoid surprising behavior, and trust the user in these situations. This effectively reverts https://skia-review.googlesource.com/c/skia/+/48183 Bug: skia: Change-Id: I71c2dd925c567e2862d96ab70c752f19245a69c4 Reviewed-on: https://skia-review.googlesource.com/140500 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* 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>
* 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>
* Make GrGpu::deleteTestingOnlyBackendTexture() take const GrBackendTexture&Gravatar Brian Salomon2018-03-09
| | | | | | | Change-Id: Ibd00d0dc6d8c73628f26851e102defdbafab149b Reviewed-on: https://skia-review.googlesource.com/113164 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Rename wrap backend tex/rt methods on GrProxyProviderGravatar Brian Salomon2018-03-07
| | | | | | | | | This makes them more consistent with similar methods on GrResourceProvider. Change-Id: Ice7e5dbe8100481781015b386445e9b7101bd75e Reviewed-on: https://skia-review.googlesource.com/112821 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Move more internal methods from GrContext to GrContextPriv (take 3)Gravatar Robert Phillips2018-01-22
| | | | | | | | Change-Id: Ied630e61cf95780bf85032867e6ce663e1ef9c2f Reviewed-on: https://skia-review.googlesource.com/98000 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Move more internal methods from GrContext to GrContextPriv (take 2)"Gravatar Leon Scroggins2018-01-20
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c22e50bd317fe3658445c04e18a6e319d746c510. Reason for revert: Speculative fix for Android roll Original change's description: > Move more internal methods from GrContext to GrContextPriv (take 2) > > Change-Id: I47108910517d61edeb52f82793d384fdb5605d45 > Reviewed-on: https://skia-review.googlesource.com/97241 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I3a77ac33c5f48529357cf9c683d5f4cacaa2379f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/97582 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Move more internal methods from GrContext to GrContextPriv (take 2)Gravatar Robert Phillips2018-01-19
| | | | | | | Change-Id: I47108910517d61edeb52f82793d384fdb5605d45 Reviewed-on: https://skia-review.googlesource.com/97241 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Move more internal methods from GrContext to GrContextPriv"Gravatar Hal Canary2018-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f440cecbfdf1910104f36aedd0e963da2ae8b6a8. Reason for revert: breaking android builds. Original change's description: > Move more internal methods from GrContext to GrContextPriv > > TBR=bsalomon@google.com > Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe > Reviewed-on: https://skia-review.googlesource.com/97080 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: If263f8161f0fbe3fc6ee8f34bb09e237705c3694 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/97200 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Move more internal methods from GrContext to GrContextPrivGravatar Robert Phillips2018-01-19
| | | | | | | | TBR=bsalomon@google.com Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe Reviewed-on: https://skia-review.googlesource.com/97080 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Funnel most proxy creation through GrProxyProviderGravatar Robert Phillips2018-01-16
| | | | | | | | | This is to provide a choke point for DDL to create Lazy Proxies. Change-Id: If178da13bc6447b31b7601810236d34502d9efbd Reviewed-on: https://skia-review.googlesource.com/93303 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove GrBackendObject from tests (except image_from_yuv_textures)Gravatar Robert Phillips2017-12-12
| | | | | | | | | This sets the stage for landing https://skia-review.googlesource.com/c/skia/+/82823 (Update SkImage::MakeFromYUVTexturesCopy to GrBackendTexture) Change-Id: I2c62f23dc447b9ad55c0b5f06bcd6d7ca0ec4d2b Reviewed-on: https://skia-review.googlesource.com/83920 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Use GrContextFactories that produce a single GrContext in unit tests.Gravatar Brian Salomon2017-11-15
| | | | | | | | | | | | | | | | | | | | | This is to alleviate problems due to the command buffer getting bent out of shape when the current OpenGL context is switched out from under it (because we ran a test with a native GL context). This, however is not a full solution. More changes will be required to ensure that after running each command buffer or native test we bind the null context. This does allow us to take a step in that direction without breaking anything too badly. Moreover, there is no real benefit to reusing a GrContextFactory. Modifies DEF_GPUTEST to take GrContextOptions rather than a factory to use. Tests were already using their own factories anyway. In tests that use GrContextFactory the factory instance is moved to the inner loop. Modifies gpucts and skia_test to not use persistent GrContextFactories. Change-Id: Ie7a36793545c775f2f30653ead6fec93a3d22717 Reviewed-on: https://skia-review.googlesource.com/71861 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add flag on GrBackendTexture to say whether texture is mipped or notGravatar Greg Daniel2017-10-12
| | | | | | | | Bug: skia: Change-Id: Ia684e3daf779ec2feaaec64c04dabf5cb03cd07a Reviewed-on: https://skia-review.googlesource.com/57821 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Use shader based blending to clamp kPlus mode w/F16Gravatar Brian Osman2017-09-20
| | | | | | | | Bug: skia:6173 Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908 Reviewed-on: https://skia-review.googlesource.com/48183 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Replace SkFAIL with SK_ABORT.Gravatar Ben Wagner2017-08-16
| | | | | | | | | | | | SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically changes uses of SkFAIL to SK_ABORT in preparation for its removal. The related sk_throw macro will be changed independently, due to needing to actually clean up its users. Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb Reviewed-on: https://skia-review.googlesource.com/35284 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Clean up GrResourceProvider usageGravatar Robert Phillips2017-06-15
| | | | | | | | | | | | | The only substantive changes are the removal of GrProxy instantiation in: SkGpuBlurUtils::GaussianBlur GrSimpleTextureEffect::Make* Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc Reviewed-on: https://skia-review.googlesource.com/19965 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Go back to using dual source blending for lcd src-over even ↵Gravatar Greg Daniel2017-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with non-opaque color"" This reverts commit 7d6fe0b9964d139de64ca88c46d87eba41c7f84e. Reason for revert: Relanding with fix Original change's description: > Revert "Go back to using dual source blending for lcd src-over even with non-opaque color" > > This reverts commit b54bdef86eb5cf63b94588afaa9197f49374a5f5. > > Reason for revert: breaking some bots > Original change's description: > > Go back to using dual source blending for lcd src-over even with non-opaque color > > > > This is change is currently still safe since earlier in Skia we are still requiring > > the dst to be opaque. The change is a workaround to spots where trying to read the > > dst to do in shader blending is failing for some reason. This also should give back > > a little performance since doing dual source blending should be better than shader > > blends. > > > > Bug: chromium:732341 > > Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29 > > Reviewed-on: https://skia-review.googlesource.com/19703 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,bsalomon@google.com > > Change-Id: Ibb9bc1ef4ec5967dabcd62c81f62c0989c14fbb8 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: chromium:732341 > Reviewed-on: https://skia-review.googlesource.com/19815 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com Bug: chromium:732341 Change-Id: I7481755a9aa64364371d8149af4458fc2c15c8aa Reviewed-on: https://skia-review.googlesource.com/19840 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Go back to using dual source blending for lcd src-over even with ↵Gravatar Greg Daniel2017-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-opaque color" This reverts commit b54bdef86eb5cf63b94588afaa9197f49374a5f5. Reason for revert: breaking some bots Original change's description: > Go back to using dual source blending for lcd src-over even with non-opaque color > > This is change is currently still safe since earlier in Skia we are still requiring > the dst to be opaque. The change is a workaround to spots where trying to read the > dst to do in shader blending is failing for some reason. This also should give back > a little performance since doing dual source blending should be better than shader > blends. > > Bug: chromium:732341 > Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29 > Reviewed-on: https://skia-review.googlesource.com/19703 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Ibb9bc1ef4ec5967dabcd62c81f62c0989c14fbb8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:732341 Reviewed-on: https://skia-review.googlesource.com/19815 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Go back to using dual source blending for lcd src-over even with non-opaque ↵Gravatar Greg Daniel2017-06-14
| | | | | | | | | | | | | | | | color This is change is currently still safe since earlier in Skia we are still requiring the dst to be opaque. The change is a workaround to spots where trying to read the dst to do in shader blending is failing for some reason. This also should give back a little performance since doing dual source blending should be better than shader blends. Bug: chromium:732341 Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29 Reviewed-on: https://skia-review.googlesource.com/19703 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Make GrSimpleMeshDrawOpHelper record whether coverage can be implemented as ↵Gravatar Brian Salomon2017-06-05
| | | | | | | | | | alpha This also makes the blend table entry for opaque src over indicate a blend of (1, ISA) rather than (1, 0) to match the actual implementation of the global src-over XP. Change-Id: I1b1f64d2546e4f0cf03c0239ce674d1baad655f6 Reviewed-on: https://skia-review.googlesource.com/18521 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Convert DstTexture to DstProxy (take 2)Gravatar Robert Phillips2017-05-29
| | | | | | | | | | | | | The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed Reland of: https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy) Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler)) Change-Id: I3a497b6a950fad899f23882c0a9552894ef640f8 Reviewed-on: https://skia-review.googlesource.com/17205 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix to lcd blending in ganeshGravatar Greg Daniel2017-05-22
| | | | | | | | | | | | This fixes the bug where a src color may originally be opaque but after blending it is no longer opaque. We need to know the opacity after the blend so this restricts us on which blend modes even work this way. Bug: skia: Change-Id: Ib3208887d718e5f25272ed7b0bf44683d04884d7 Reviewed-on: https://skia-review.googlesource.com/17488 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix gpu lcd blending to semi-correctly handle alpha coverageGravatar Greg Daniel2017-05-19
| | | | | | | | Bug: skia:6606 Change-Id: I16ccd97f5d047eb7fddfed5310bf669e7435ccdd Reviewed-on: https://skia-review.googlesource.com/17370 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Convert DstTexture to DstProxy"Gravatar Robert Phillips2017-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 87f7f1c3ce519115141b40f1d8faede437c8f357. Reason for revert: grumble, grumble Original change's description: > Convert DstTexture to DstProxy > > The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed > > Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler)) > > Change-Id: Ic1435177d8b5d9bd3fc38b4903c9baae8205cfb0 > Reviewed-on: https://skia-review.googlesource.com/16908 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=egdaniel@google.com,robertphillips@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I9af52bb222bd2d8cc696250a9efb62afb80edba1 Reviewed-on: https://skia-review.googlesource.com/17203 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Convert DstTexture to DstProxyGravatar Robert Phillips2017-05-17
| | | | | | | | | | | The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler)) Change-Id: Ic1435177d8b5d9bd3fc38b4903c9baae8205cfb0 Reviewed-on: https://skia-review.googlesource.com/16908 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Plumb GrBackendTexture throughout skia.""Gravatar Greg Daniel2017-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6. Reason for revert: Relanding this change now that other fixes have landed. Original change's description: > Revert "Plumb GrBackendTexture throughout skia." > > This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12. > > Reason for revert: fix android roll > > Original change's description: > > Plumb GrBackendTexture throughout skia. > > > > Bug: skia: > > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875 > > Reviewed-on: https://skia-review.googlesource.com/13645 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89 > Reviewed-on: https://skia-review.googlesource.com/13773 > Reviewed-by: Stan Iliev <stani@google.com> > Commit-Queue: Stan Iliev <stani@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2 Reviewed-on: https://skia-review.googlesource.com/13975 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Plumb GrBackendTexture throughout skia."Gravatar Stan Iliev2017-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12. Reason for revert: fix android roll Original change's description: > Plumb GrBackendTexture throughout skia. > > Bug: skia: > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875 > Reviewed-on: https://skia-review.googlesource.com/13645 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89 Reviewed-on: https://skia-review.googlesource.com/13773 Reviewed-by: Stan Iliev <stani@google.com> Commit-Queue: Stan Iliev <stani@google.com>
* Plumb GrBackendTexture throughout skia.Gravatar Greg Daniel2017-04-18
| | | | | | | | Bug: skia: Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875 Reviewed-on: https://skia-review.googlesource.com/13645 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Move ref counting out of GrProcessor and into subclasses.Gravatar Brian Salomon2017-04-10
| | | | | | | | | | | | | This will allow different subclasses to use different models for lifetime management. GrXferProcessor moves to simple ref counting since they don't own GrGpuResources. This also constifies GrXferProcessor factories. Change-Id: I6bea0ea8de718874063224232f9da50887868b16 Reviewed-on: https://skia-review.googlesource.com/11792 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Revert "Revert "Create GrXferProcessor while doing GrProcessorSet analysis.""Gravatar Brian Salomon2017-04-08
| | | | | | | | | | This reverts commit 5dac9b3b5bf7e9c06c207cb92e257535c7d9ec95. Bug: skia: Change-Id: I3db2ec6776eb10c1f863b3992a2c8048c54b130f Reviewed-on: https://skia-review.googlesource.com/12620 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Create GrXferProcessor while doing GrProcessorSet analysis."Gravatar Brian Salomon2017-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0ae0e23696f2ef08503040f8c02765eb58b26ddf. Reason for revert: static assert failure on ios build Original change's description: > Create GrXferProcessor while doing GrProcessorSet analysis. > > > Bug: skia: > Change-Id: I62a628f9c0536ffb05c8f9d0c9ded5657f93b48e > Reviewed-on: https://skia-review.googlesource.com/11482 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ifd57367b0326dd2b53c622705a868e246645d589 Reviewed-on: https://skia-review.googlesource.com/12104 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Create GrXferProcessor while doing GrProcessorSet analysis.Gravatar Brian Salomon2017-04-08
| | | | | | | | Bug: skia: Change-Id: I62a628f9c0536ffb05c8f9d0c9ded5657f93b48e Reviewed-on: https://skia-review.googlesource.com/11482 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Use sk_sp with GrXferProcessor and use a static factory to handle the ↵Gravatar Brian Salomon2017-04-04
| | | | | | | | | | nullptr==srcover case. Bug: skia: Change-Id: I9c07069fc2aae24fc2884c18939e3a649afc27e7 Reviewed-on: https://skia-review.googlesource.com/11282 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Store the dst texture used by an XP in GrPipeline rather than in the XP.Gravatar Brian Salomon2017-04-03
| | | | | | | | | This will allow the XP to be created before the dst texture. Change-Id: I3e5bdfa8e5d47e58a3560792ce5cf3899d30a024 Reviewed-on: https://skia-review.googlesource.com/11011 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Renames of processor analysis-related classes and method.Gravatar Brian Salomon2017-03-30
| | | | | | | | | | | | GrProcesserSet::FragmentProcessorAnalysis->GrProcessorSet::Analysis GrPipelineAnalysisColor->GrProcessorAnalysisColor GrPipelineAnalysisCoverage->GrProcessorAnalysisCoverage GrMeshDrawOp::getFragmentProcessorAnalysisInputs->GrMeshDrawOp::getProcessorAnalysisInputs Change-Id: I28ad19dfab5f4ac1788c4eacdec5e1af2a701dd0 Reviewed-on: https://skia-review.googlesource.com/10747 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Make analysis optional to GrPipeline::init().Gravatar Brian Salomon2017-03-29
| | | | | | | | | | | GrXPFactory::createXferProcessor now takes GrPipelineAnalysisColor and GrPipelineAnalysisCoverage rather than GrProcessorSet::FragmentProcessorAnalysis. This will make it so ops do not have to retain the analysis or rerun it to create pipelines at flush time. Change-Id: Ib28ba65de425b20c2647329275f209aec168c3df Reviewed-on: https://skia-review.googlesource.com/10474 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove GrPipelineOptimizations computation from GrPipeline::init and nest in ↵Gravatar Brian Salomon2017-03-29
| | | | | | | | | GrMeshDrawOp. Change-Id: I4a702c83857606c1cb050294c408922eef5769ea Reviewed-on: https://skia-review.googlesource.com/10414 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove GrXferProcessor::getOptimizations.Gravatar Brian Salomon2017-03-29
| | | | | | | | | | This replaces GrXferProcessor::getOptimizations with a new function on GrXPFactory. The results are made available via FragmentProcessorAnalysis. Bug: skia: Change-Id: I535985458c9d13ad858cac94e957e2fdbe332036 Reviewed-on: https://skia-review.googlesource.com/10218 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Split GrPipelineInput into separate color and coverage types, the latter of ↵Gravatar Brian Salomon2017-03-27
| | | | | | | | | | | | | | | which is just an enum. Assign names that indicate that they aren't just for the input phase since I plan to use them at the boundary between FPs and XPs as well. Renamed GrProcOptInfo to GrColorFragmentProcessorAnalysis. This is now only used on the color side and the new name seems clearer to me. Change GrMeshDrawOp::getFragmentProcessorAnalysisInputs to use the new color/coverage types directly rather than a class that has been reduced to simply bundling them together. Change-Id: If93bae74c9d590486eecdf63f302418c96deab65 Reviewed-on: https://skia-review.googlesource.com/10161 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Remove GrPipeline from GrDrawOp.""Gravatar Brian Salomon2017-03-21
| | | | | | | | | This reverts commit c48af934608bbb65650641f66adb51f2102d4274. Change-Id: I4ba78fd7e5a7d406b88223ca6f7245c029b60f76 Reviewed-on: https://skia-review.googlesource.com/9981 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Remove GrPipeline from GrDrawOp."Gravatar Brian Salomon2017-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2bf4b3a97b770811d9e0558dbbfbdb57cfafbdb7. Reason for revert: nanobench assertion Original change's description: > Remove GrPipeline from GrDrawOp. > > GrDrawOp subclasses are now free to construct their pipelines at flush time and now in theory could use multiple GrPipelines for multipass rendering. > > GrProcessorSet may be used to retain the processors from a GrPaint with "pending execution" style refs. > > NVPR and Instanced rendering are updated to create their pipelines at flush time without a GrPipelineBuilder. > > The monolithic pipeline creation/management that was on GrDrawOp is moved to GrMeshDrawOp. However, this is temporary and will be removed in coming changes. > > Change-Id: I124282e3cea5d070970b5460c8a679fcaf7a8eff > Reviewed-on: https://skia-review.googlesource.com/7279 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I1bc64f6cbbd5f482417637a034342c2b5371dc5c Reviewed-on: https://skia-review.googlesource.com/9817 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Remove GrPipeline from GrDrawOp.Gravatar Brian Salomon2017-03-16
| | | | | | | | | | | | | | | GrDrawOp subclasses are now free to construct their pipelines at flush time and now in theory could use multiple GrPipelines for multipass rendering. GrProcessorSet may be used to retain the processors from a GrPaint with "pending execution" style refs. NVPR and Instanced rendering are updated to create their pipelines at flush time without a GrPipelineBuilder. The monolithic pipeline creation/management that was on GrDrawOp is moved to GrMeshDrawOp. However, this is temporary and will be removed in coming changes. Change-Id: I124282e3cea5d070970b5460c8a679fcaf7a8eff Reviewed-on: https://skia-review.googlesource.com/7279 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Compute clipped draw bounds outside GrAppliedClip.Gravatar Brian Salomon2017-03-14
| | | | | | | | | | | | We will be storing GrAppliedClips alongside ops. The op already stores the clipped bounds. If GrAppliedClip has draw bounds then as ops combine the GrAppliedClip's bounds should be merged to be consistent. However, we won't actually ever use those bounds again so it would be wasteful to merge them. Change-Id: I4ef3010dc04761e256120a2e0e074bc3c6ff6ca1 Reviewed-on: https://skia-review.googlesource.com/9642 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
* Changes to GrProcessorSet::FragmentProcessorAnalysis to prepare for deferred ↵Gravatar Brian Salomon2017-03-13
| | | | | | | | | | | | | | | pipeline creation. This compacts the object so that it is more efficient for ops to store it. It also adds a new constructor and query that will allow ops to use the analysis to also store the GrPaint's color. This has the side effect of limiting the number of color processors on a GrProcessorSet to 64K which is just under 64K more than should ever be needed. Change-Id: I4e6bc8e3f81bb2ff6a73af685beb6fb928a3de67 Reviewed-on: https://skia-review.googlesource.com/8972 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Remove XP override color.Gravatar Brian Salomon2017-03-06
| | | | | | | | | | | The only use case for this was using the blend constant for LCD text. Now instead of overriding the op's color with an alpha we upload the alpha as a uniform. This also removes two unused parameters from GrXferProcessor::getOptimizations. Change-Id: I8268da9904a5d26649c6ae81a5705b0930893904 Reviewed-on: https://skia-review.googlesource.com/9221 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Rebase and fix chromiumGravatar Brian Osman2017-03-04
| | | | | | | | | | | | | | Combine texture provider and resource provider Largely mechanical. Only three places that were calling createApprox via texture provider (ie without flags), so that was simple. BUG=skia: Change-Id: I876367bcdc6a8db736deedab1028de1972015509 Reviewed-on: https://skia-review.googlesource.com/9176 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove the skip-draw xp optimizationGravatar Brian Salomon2017-02-24
| | | | | | | | | This seems like extra complexity for a impractical case. Also, if this is important a lot more work could be saved by catching this upstack (e.g. SkCanvas or SkPaintToGrPaint). Change-Id: Ib47be9f3cdc8ce9e5b12d9e9eac5266f04c337a9 Reviewed-on: https://skia-review.googlesource.com/8949 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Make GrPipelineAnalysis a nested class of GrProcessorSet.Gravatar Brian Salomon2017-02-22
| | | | | | | | | | | | | | | | It is renamed to FragmentProcessorAnalysis since it represents the outputs of the final FPs. It now stores the analysis results that are subsequently needed rather than exposing GrProcOptInfo. GrProcOptInfo is now only used on color FPs (not coverage). Miscellaneous related renamings. Change-Id: I95c518a7a76df6dc294a9fa67c611f8f653247bc Reviewed-on: https://skia-review.googlesource.com/8534 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Simplify GrPaint::isConstantBlendedColor to avoid FP analysis and XP virtual ↵Gravatar Brian Salomon2017-02-21
| | | | | | | | | | | calls This was the only non-test user of GrXPFactory::isConstantPreCoverageBlendedColor which is now removed. Change-Id: Ic1c130d30a44e1a955b89f8912433a3c9df2e61e Reviewed-on: https://skia-review.googlesource.com/8776 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>