This CL leaves the Ganesh world in a very odd place. In particular it still:
has pendingIO refs on GrSurfaces
forwards the proxy refs on to the backing GrSurface
Removing everything at once only ends in a mess thus, this goofball CL.
Change-Id: If112ff311bcef2e8d65a36c3b53b0ded4041c24e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210040
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
For Skia's testing we always want an initialized backend texture. Except for the
BackendAllocationTests of course.
Change-Id: I47b5e4c9845b3f58ebad5ba052780a69d6cd6954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This will allow us to detect textures that need their mipmap levels
regenerated, and resolve them before executing the command buffer.
Bug: skia:
Change-Id: I65a1cd2b2d5ba2247d1c4a613ce9ba85b8d02377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215142
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
We are planning to start detecting mipmaps and MSAA resolves during
the "gather" step now, so all visits should behave the same at this
point. (And it appears there might not have been any GrOps that
actually changed their behavior based on this flag at the moment.)
Bug: skia:
Change-Id: I7a7a1c9c47cbe03683c42025bf6d0ecb32a57ba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215145
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This initial portion of the API should be ready to go. Follow on CLs will add the other entry points.
Change-Id: Ia9c708046ba08b16f9a71558e2bf2c38279abe5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
To fully switch over we need the entry point that uploads data but most of the old call
sites can be switched over now.
Change-Id: I362b1dfde7d88bf8d3f8f90155f53d9ac442a329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This intended to bring this API more into line with the proposed GrBackendObject API with an eye towards replacing the former with the latter.
TBR=bsalomon@google.com
Change-Id: I4367f03fb10fff788749f21c4843060111a6df1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Current strategy: everything from the top
Things to look at first are the manual changes:
- added tools/rewrite_includes.py
- removed -Idirectives from BUILD.gn
- various compile.sh simplifications
- tweak tools/embed_resources.py
- update gn/find_headers.py to write paths from the top
- update gn/gn_to_bp.py SkUserConfig.h layout
so that #include "include/config/SkUserConfig.h" always
gets the header we want.
No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This is rather ham-fisted but I would like to have a short-term fix for the "always-flush" perf regressions.
Change-Id: I508e2d725ac18f50318baf31bc3243fe932c724b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206697
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
We want GrResourceCache to be able to track which resources are held by
refs (as opposed to pending IOs) so that it can track the affect of
flushing on resource purgeability. Therefore, all cases that can add the
first ref to a GrGpuResource must funnel through GrResourceCache. This
lays the groundwork by restricting initial refs.
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8927
Change-Id: I1213c3db258d2412df6666e3222419211ceaa192
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205482
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
kSynced: Proxy and GrSurface key kept in sync.
kUnsynced: Proxy and GrSurface keys are unrelated.
This will allow cross-context image generators' lazy instantiation
callbacks to use unique keys to find any pre-existing backing GrTexture
rather than keeping an unref'ed bare pointer to the GrTexture.
Bug: skia:8927
Change-Id: Id15e2a64e8d2e56c4ce70b9399eb1d8bcea6ac9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204723
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This is a reland of 8b40ac35b2
Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
>
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
>
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
>
>
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:8800
Change-Id: Ib939fc5c19edf0c6b965c9f6adf0afedd4267703
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 8b40ac35b2.
Reason for revert: breaks viz_unittests
Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
>
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
>
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
>
>
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Iba960efba4290a284294c62d0470ad7e932c174a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts a fraction of b2c5dae65d to
restore the deinstantiate lazy proxy type, supporting implementation,
and tests.
Use them for promise images to avoid thread safety issues for promise
image resources. Makes promise image instantiation callbacks do a thread
safe unref of their fulfilled GrTexture in GrResourceCache. The
GrResourceCache mechanism for receiving unref messages is extended to
allow multiple pending unrefs. All this is new.
Bug: skia:8800
Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Previously, we relied on ops to deduce whether a draw would have
hardware coverage modulation as a result mixed samples. This is
problematic because *any* draw can have mixed samples coverage if
there is a multisampled stencil clip. No ops were checking for stencil
clip, and most just said they never used mixed samples.
Now that the only usecase for mixed samples is the stencil buffer,
this CL makes the processorSet automatically deduce mixed samples
coverage from the stencil settings and fsaaType.
Bug: skia:
Change-Id: Ib69b84bc03b12f6efb8e7d6ed721ae1612785315
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197281
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Now that we never re-fulfill a promise image we no longer need to deinstantiate
promise image proxies. They now can use kSingleUse callback semantics.
This was the only usage of the kDeinstantiate lazy callback type so it is
removed. The DeinstantiateProxyTracker is also no longer required and is
removed.
The GrTexture idle callback mechanism now uses GrReleaseProcHelper, which has
been extended to support chaining multiple callbacks together and an abandon()
method that aborts calling the callback in the destructor. It has been renamed
GrRefCntedCallback to reflect its more general usage.
Bug: skia:8800
Change-Id: I857c9eec57fdf706631a266ec8bea682d6657a7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The path renderers convert paths into Ganesh ops when recording so should also be able to make due with only the GrRecordingContext.
Change-Id: Ie796af73ca5aa2a074ebd037d6d558ec85ff5928
Reviewed-on: https://skia-review.googlesource.com/c/191568
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Mechanical. This makes the priv() accessor the same for all the context types.
Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Make all wrapped resources be kUnbudgetedUncacheable except those
created by AHardwareBuffer image generators and as backings for promise
images.
Make all non-wrapped unbudgeted resources be kUnbudgetedUncacheable.
Update unit tests to mostly use GrWrapCacheable::kNo except where they
are testing the distinction.
Update unit tests for new expectations.
Bug: chromium:922851
Change-Id: I4d3bdaa161ffc76390f26334bcb7e2b47dd9319d
Reviewed-on: https://skia-review.googlesource.com/c/185004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Store budgeted status as a tri-state enum on GrGpuResource:
kBudgeted
kUnbudgetedCacheable
kUnbudgetedUncacheable
Uncacheable vs. Cacheable captures the current distinction between
wrapped resources created with purgeImmediately or !purgeImmediately.
Non-wrapped and unbudgeted resources are all kUnbudgetedCacheable to
match current behavior.
This change just introduces the new types. No behavior is changed.
Bug: chromium:922851
Change-Id: Ic2387bf321cf9b56b4c9ffd9dbef8ade60f9cb98
Reviewed-on: https://skia-review.googlesource.com/c/185003
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Uninstantiated: a state of not being instantiated.
Deinstantiate: transition from instantiated to uninstantiated state.
Change-Id: Id7b6b295267674a9915f95105d73fabfcc3555de
Reviewed-on: https://skia-review.googlesource.com/c/175586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Read only textures and proxies fail writePixels, as copy dsts, and mip
regeneration.
Bug: skia:8509
Change-Id: Iaa0b473cc9a9930fde3ef0e91373d5040650de35
Reviewed-on: https://skia-review.googlesource.com/c/174316
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
GrRenderTargetOpList maintains an array of op chains. When it receives a
new op it tries to add it to an existing chain, working backwards from
the end of the current array. If the op can be added to a chain it
additionally tries to merge the new op with ops already in the chain
before adding it to the tail of the chain.
In forward combining it tries to concatenate chains. If chains can
concatenate it also attempts to merge ops between the two chains.
Now op chaining results reported by Op subclasses must be transitive.
Moreover, if op A is able to merge with B then it must be the case that
any op that can chain with A will either merge or chain with any op that
can chain to B.
Bug: skia:8491
Change-Id: Ib6a2a669acd4257134a37d271289b8b3f247cd3f
Reviewed-on: https://skia-review.googlesource.com/c/170351
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 51b1c12bbc.
Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
Original change's description:
> Have a GrBackendFormat be stored on gpu proxies.
>
> Bug: skia:
> Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> Reviewed-on: https://skia-review.googlesource.com/c/168021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/169835
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
Reviewed-on: https://skia-review.googlesource.com/c/168021
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: I5386e27edbcf39233880d869841a6632ecb9416c
Reviewed-on: https://skia-review.googlesource.com/c/168261
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
are not recyclable.
Change-Id: I5ff9c48b3d7b37531a3f052bd5188a8afcacf3cb
Reviewed-on: https://skia-review.googlesource.com/c/161860
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit fdf05f4ff4.
Reason for revert: Android fixed after removing multitexture support from TextureOp.
Original change's description:
> Revert "Move GrGeometryProcessor's textures out of classes and into"
>
> This reverts commit af87483873.
>
> Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
>
> This reverts commit 607be37e3d.
>
> Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
>
> This reverts commit b948572c78.
>
> Revert "Remove multitexturing support from GrTextureOp."
>
> This reverts commit 986f64c601.
>
> Revert "Make result of GrOp::combineIfPossible be an enum."
>
> This reverts commit 641ac7daa8.
>
> Bug: b/112244393
> Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
> Reviewed-on: https://skia-review.googlesource.com/145646
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com
Change-Id: I1d41c2ecf7862e31fb025a7a00bb07bae9d83a47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/112244393
Reviewed-on: https://skia-review.googlesource.com/145780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit af87483873.
Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
This reverts commit 607be37e3d.
Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
This reverts commit b948572c78.
Revert "Remove multitexturing support from GrTextureOp."
This reverts commit 986f64c601.
Revert "Make result of GrOp::combineIfPossible be an enum."
This reverts commit 641ac7daa8.
Bug: b/112244393
Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
Reviewed-on: https://skia-review.googlesource.com/145646
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is to prepare for a third value that requests that ops be linked
together so that the first op may do the work for multiple linked ops
without actually merging the GrOp objects.
Change-Id: Ib6e012a89be5edd054aee69d8475bea612331852
Reviewed-on: https://skia-review.googlesource.com/145522
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Move peek[Surface|Texture|RenderTarget]() from GrSurfaceProxyPriv to
to GrSurfaceProxy.
Move proxyMipMapped(), textureType(), and hasRestrictedSampling()
from GrTextureProxyPriv to GrTextureProxy.
Change-Id: I259114d0508c4613d55f7f1faccac362fa6fb281
Reviewed-on: https://skia-review.googlesource.com/144641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Fold its functionality into GrPrimitiveProcessor and GrFragmentProcessor.
Make each have its own TextureSampler nested class. Currently the only
difference is that fragment processors lose the ability to inject their
samplers into the vertex shader. However, this facilitates refactoring
GrPrimitiveProcessor's TextureSampler class such that the textures are
specified separately from the TextureSampler.
Bug: skia:
Change-Id: I1e590187e7a6ae79ee3147155d397fcdcf5e4619
Reviewed-on: https://skia-review.googlesource.com/142814
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Instead store sampler count on base class and subclasses implement a
virtual to get the ith sampler.
Change-Id: I13e2447a6467a09761d8615acb4aa360b87b1476
Reviewed-on: https://skia-review.googlesource.com/141563
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Removes flag indicating rectangle or external as its now redundant.
Bug: skia:
Change-Id: Ia475b557390e7a6b0f19f6e189cf8c27090e397c
Reviewed-on: https://skia-review.googlesource.com/144346
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
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>