Commit Graph

30 Commits

Author SHA1 Message Date
Robert Phillips
e78b7259c3 Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 3)
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.

This is a re-reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)

Change-Id: Icfb9dd223418dd460405efd2bfd9d1c356beed1a
Reviewed-on: https://skia-review.googlesource.com/11412
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-06 12:45:02 +00:00
Robert Phillips
1b35256f11 Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)"
This reverts commit aaee31f18c.

Reason for revert: possible valgrind leak

Original change's description:
> Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)
> 
> This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.
> 
> This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)
> 
> Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148
> Reviewed-on: https://skia-review.googlesource.com/11326
> 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: Ia0b92bf6402cb5f9607310d356f43bff2e3e75eb
Reviewed-on: https://skia-review.googlesource.com/11361
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 18:56:33 +00:00
Robert Phillips
aaee31f18c Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.

This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)

Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148
Reviewed-on: https://skia-review.googlesource.com/11326
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 17:00:10 +00:00
Robert Phillips
171cc5fc87 Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv"
This reverts commit fb0bd98a43.

Reason for revert: ANGLE failures

Original change's description:
> Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv
> 
> This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.
> 
> Change-Id: If57a7de47edc0853dae7bc61337d9acdc03d63b0
> Reviewed-on: https://skia-review.googlesource.com/11200
> 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: I7241070dc1f9df47181061e07adab141f9857974
Reviewed-on: https://skia-review.googlesource.com/11324
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 12:46:02 +00:00
Robert Phillips
fb0bd98a43 Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.

Change-Id: If57a7de47edc0853dae7bc61337d9acdc03d63b0
Reviewed-on: https://skia-review.googlesource.com/11200
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 11:55:35 +00:00
Brian Salomon
e14bd80db0 Move GrPipelineBuilder into GrRenderTargetContext::addLegacyDrawOp
This makes the legacy code use GrProcessorSet::Analysis in the same manner as the non-GrLegacyMeshDrawOps which enables changes to how analysis works.

Change-Id: I8171e285ac8930beb3ac33cd3c4ee88f217b9e40
Reviewed-on: https://skia-review.googlesource.com/11205
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-04-04 19:46:18 +00:00
Brian Salomon
d3ccb0a37f Move pipeline handling out of GrMeshDrawOp.
The monolithic GrPipeline is moved to a subclass GrLegacyDrawMeshOp.

The pipeline used to record a GrMesh draw in a GrMeshDrawOp must now be passed rather than implicitly using the op's pipeline.

Change-Id: I50d77e4dcc8d91a523fa7566ce43a9a291174706
Reviewed-on: https://skia-review.googlesource.com/11002
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-03 15:13:48 +00:00
Brian Osman
c35a2d4a34 Add nondeterministic seed option for ProcessorOptimization test
BUG=skia:

Change-Id: Ie1dad1ab164eb36635095595e3200ae16e328832
Reviewed-on: https://skia-review.googlesource.com/9830
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-17 17:38:01 +00:00
Brian Osman
2f3865b508 Fix formatting error in test output
BUG=skia:

Change-Id: I36824a4a3fcae3a75157706b769047a82cb3c289
Reviewed-on: https://skia-review.googlesource.com/9728
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-15 18:06:33 +00:00
Brian Osman
bd1f76fecf Emit dumpInfo string when processor opt test fails
Add missing implementation for ComposeTwo, and provide more information in
ComposeOne.

BUG=skia:

Change-Id: Id2406bcb51a6419a763ff9e6e572f5c6c70c4c76
Reviewed-on: https://skia-review.googlesource.com/9699
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-03-15 16:29:53 +00:00
Robert Phillips
296b1ccf9b Retract GrContext from src/gpu/effects
Change-Id: Iceb7263098286bafb2605ef17d1fe6bb25d71e97
Reviewed-on: https://skia-review.googlesource.com/9693
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-15 15:20:40 +00:00
Robert Phillips
26c90e0479 Add GrRenderTargetContext::resourceProvider & GrResourceProvider::caps
and retract GrSurfaceContextPriv a bit

Change-Id: Id47af1052f9bda4fe7c85b3ce46b3ebe37797524
Reviewed-on: https://skia-review.googlesource.com/9647
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-14 21:23:44 +00:00
Brian Salomon
649a3411f9 Add a separate draw function to GrRenderTargetContext for GrMeshDrawOp derived classes.
The first phase of deferring GrPipeline creation until flush will apply only to GrDrawOp subclasses that do not derive from GrMeshDrawOp. This change prepares for that by creating separate draw functions on GrRenderTargetContext for GrMeshDrawOp-derived ops. This is temporary and will incrementally be undone as pipeline-creation deferral rolls out to the GrMeshDrawOps in a later phase of this work.


Change-Id: I0f5b71fe913f3273cfe9e965f7d8bbe7f01ad0ef
Reviewed-on: https://skia-review.googlesource.com/9481
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-03-09 19:26:13 +00:00
Brian Salomon
c65aec9761 Make GrClip.h private
BUG=skia:

Change-Id: I4aa3c2707811ece3a63d161035e316c3bbc1cd15
Reviewed-on: https://skia-review.googlesource.com/9482
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-03-09 14:39:24 +00:00
Brian Osman
32342f032e Rebase and fix chromium
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>
2017-03-04 13:49:47 +00:00
Robert Phillips
2f49314227 Make GrSurface::MakeDeferred return sk_sp<GrTextureProxy>
This should make upcoming changes less tedious

Change-Id: I313ae9df724f109a64cf5708a974e8bfeb963025
Reviewed-on: https://skia-review.googlesource.com/9183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-03 12:35:27 +00:00
Robert Phillips
7928e76872 Disable deferred gpu resources for Chrome branch
Chrome's branch is coming up and it seems unlikely that I will be able to push instantiation all the way to flush time (where failure will be easier to deal with) before then. This CL should silence the P1 bug but could introduce layout test diffs.

Ideally this wouldn't land until after: https://codereview.chromium.org/2718353004/ (Add flag for upcoming Skia change) so the layout test differences will be visible on the DEPS roll

BUG=688811

Change-Id: I86c42ee02e6672834353aa7126b00ed4f3521948
Reviewed-on: https://skia-review.googlesource.com/9064
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-01 12:30:02 +00:00
Robert Phillips
30f9bc69cf Switch GrTextureStripAtlas over to GrTextureProxies
This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

Change-Id: I9f602985b6010fc58b595e2be6d4e67e50179747
Reviewed-on: https://skia-review.googlesource.com/8881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-23 15:01:42 +00:00
Brian Salomon
f3b995b628 Clarify when tweak alpha for coverage optimizaton can occur.
Also refer to it directly rather than using the term "modulate"

Change-Id: Ifa44a4d46e1be11b567943f58ead24e38f10d03b
Reviewed-on: https://skia-review.googlesource.com/8488
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-15 17:27:10 +00:00
Brian Salomon
cb30bb2cb7 Remove GrFragmentProcessor::computeInvariantOutput
Change-Id: If475730103052c6097eb91be06808fb723b70bf8
Reviewed-on: https://skia-review.googlesource.com/8330
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-13 15:32:00 +00:00
Brian Salomon
d1a8bdfbb9 Initialize test textures for ProcessorOptimizationValidationTest.
Ensure the data in the RGBA texture is premul.

Reenable the "modulation" optimization flag on GrAlphaThresholdFragmentProcessor.

Change-Id: I49ef215cee83ea74526c589bcee4bc215bc28ba4
Reviewed-on: https://skia-review.googlesource.com/8323
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-13 15:21:34 +00:00
Brian Salomon
5d4cd9ea88 Re-enable processor optimization test with some fixes.
Enables on GL (for now)

Change-Id: I5f5a38632963dd705f8434e8627eb33446e8f027
Reviewed-on: https://skia-review.googlesource.com/7721
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-09 19:25:21 +00:00
Hal Canary
6f6961ebad make GR_TEST_UTILS=0 work
Change-Id: Icce35140ca08b65217b32e6b1ffc6ad2f38ab37f
Reviewed-on: https://skia-review.googlesource.com/7840
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-02 12:49:17 +00:00
Brian Salomon
587e08f361 Revert "Revert "Start of rewrite of GrFragmentProcessor optimizations.""
This reverts commit 052fd5158f.

Disables the test (of unused code) until platform-specific issues are addressed.

Change-Id: I7aa23a07954fccf382aa07d28afcbffb0bebcd6d
Reviewed-on: https://skia-review.googlesource.com/7656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-27 16:43:38 +00:00
Ethan Nicholas
052fd5158f Revert "Start of rewrite of GrFragmentProcessor optimizations."
This reverts commit 85eb4226a4.

Reason for revert: test failures on Windows, e.g. https://chromium-swarm.appspot.com/task?id=33f9527484414110&refresh=10

Original change's description:
> Start of rewrite of GrFragmentProcessor optimizations.
> 
> This adds a replacement for computeInvariantOutput buts does not use it yet. The replacement allows for three types of optimizations:
> 
> * known input color -> known output color for GrFP elimination
> * tracking of whether all color processors modulate their input for the "tweak alpha" optimziation
> * opaqueness tracking
> 
> This loses some of the generality of computInvariantOutput. It does not track the known output status of individual color components (other than opaque alpha). It does not track whether GrFragmentProcessors read their input color. It doesn't allow a processor that will receive non-constant output to advertise that it produces a constant output. These could probably be added back in the unlikely case that they prove valuable.
> 
> Unlike computeInvariantOutput the optimizations are decided at instantiation time and constant colors are expressed as GrColor4f rather than GrColor.
> 
> Change-Id: I684d3f9050693dde2d28154fa695e049ed8cf61a
> Reviewed-on: https://skia-review.googlesource.com/7481
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I2390df257456013fa74137cb5d7b5a93820c291e
Reviewed-on: https://skia-review.googlesource.com/7652
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2017-01-27 15:34:43 +00:00
Brian Salomon
85eb4226a4 Start of rewrite of GrFragmentProcessor optimizations.
This adds a replacement for computeInvariantOutput buts does not use it yet. The replacement allows for three types of optimizations:

* known input color -> known output color for GrFP elimination
* tracking of whether all color processors modulate their input for the "tweak alpha" optimziation
* opaqueness tracking

This loses some of the generality of computInvariantOutput. It does not track the known output status of individual color components (other than opaque alpha). It does not track whether GrFragmentProcessors read their input color. It doesn't allow a processor that will receive non-constant output to advertise that it produces a constant output. These could probably be added back in the unlikely case that they prove valuable.

Unlike computeInvariantOutput the optimizations are decided at instantiation time and constant colors are expressed as GrColor4f rather than GrColor.

Change-Id: I684d3f9050693dde2d28154fa695e049ed8cf61a
Reviewed-on: https://skia-review.googlesource.com/7481
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-27 14:56:48 +00:00
Brian Salomon
5f13fbac19 Stop tracking whether GrFragmentProcessors read their input
Change-Id: Id5338901978b97289798eaef873527597bd8dfd6
Reviewed-on: https://skia-review.googlesource.com/7414
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-01-23 20:17:53 +00:00
Brian Salomon
f046e15347 Fix undefined GrIORef test method on Chrome win bot
Change-Id: Ifc3d7e285a4b1a0b370ec79963127490bd7b1a84
Reviewed-on: https://skia-review.googlesource.com/6896
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-11 21:11:12 +00:00
Brian Salomon
82f4431915 Make GrPaints move their GrProcessor ownership into GrPipelineBuilder.
This makes GrPaints usable only once. In some places we must make copies in order to issue draws with the same paint state.

Change-Id: Ie816e5185ce93a064111cad64c6880e1e21184c2
Reviewed-on: https://skia-review.googlesource.com/6844
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-11 19:56:48 +00:00
Brian Salomon
bc6b99d22e Add test for processor->resource ref/io counts
Change-Id: I63a8cb9f1564bfc15ef98121b77946a647c79f32
Reviewed-on: https://skia-review.googlesource.com/6814
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-01-11 16:01:07 +00:00