Change-Id: Ia2cfbca8982b57399b6681cbb4501c2933ab4df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304576
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
In order to stage the transition from GrContext to GrDirectContext, both
of them will have to have the factories for a while.
This CL also removes all internal uses of the old (GrContext) factories.
Change-Id: Ibe1edd0818ea23a0d54257c55f35f12526047ef3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302263
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Having GrAtlasManager.h in GrContextPriv.h was needlessly propagating dependence on that header.
Change-Id: Idf5836f1e217ecd2da91f751b488a63a884c02ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281739
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
It is also used for writes to surfaces other than fragment shader
output. e.g. clears.
Change-Id: Id1eb79be6d1a8aed936456bffa59dee32661cec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280344
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This makes onPrePrepare match onPrepare & onExecute. Most of the new method bodies will-have-to/should be filled in anyway.
Change-Id: Ifc897feaeb2d8fe6eec3ac3a8e91f99393ad6758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277542
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Replace with SkISize.
Also change some const SkISize& params to just SkISize.
Change-Id: I3c72d961662eefeda545fba17d63e877cd5ca813
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269374
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This whole change is basically work that will all get reverted shortly
when GrSurfaceProxy no longer stores swizzle. But for now this helps
get rid of a use of pixel config.
Bug: skia:6718
Change-Id: If911360a8a9d2c52a58b5795386484634885b3f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265579
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I47ac0b069334cb9702473b1bb923f585712f38ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261087
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I3acf5d5fdb29bfbd3407a8065b7567dff43503a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259427
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit ed58654e39.
Reason for revert: Fix field order in SkDeferredDisplayList to deconstruct
dependent types in the proper order.
Original change's description:
> Revert "Detach op memory pool from recording context"
>
> This reverts commit 6b95516728.
>
> Reason for revert: breaking some Win10 bots
>
> Original change's description:
> > Detach op memory pool from recording context
> >
> > This changes GrOpMemoryPool to no longer extend SkRefCnt, and all usages
> > either are std::unique_ptr for owners, or GrOpMemoryPool* when ownership
> > is held somewhere else. The culmination of this is that DDLs explicitly
> > detach the memory pool from the recording context instead of the GrOpsTask
> > maintaining a strong ref that preserved the memory somewhat sneakily.
> >
> > Change-Id: I33e2caebea70cebe8fd7681207c631feeaf2c703
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259424
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I942ae1e07fdc63d9311f6ee482bd71beca090502
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259696
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
Change-Id: Ia82fa6e42fc8d75b8aa57e5172894e8dfc7e83d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259816
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit 6b95516728.
Reason for revert: breaking some Win10 bots
Original change's description:
> Detach op memory pool from recording context
>
> This changes GrOpMemoryPool to no longer extend SkRefCnt, and all usages
> either are std::unique_ptr for owners, or GrOpMemoryPool* when ownership
> is held somewhere else. The culmination of this is that DDLs explicitly
> detach the memory pool from the recording context instead of the GrOpsTask
> maintaining a strong ref that preserved the memory somewhat sneakily.
>
> Change-Id: I33e2caebea70cebe8fd7681207c631feeaf2c703
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259424
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
Change-Id: I942ae1e07fdc63d9311f6ee482bd71beca090502
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259696
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
This changes GrOpMemoryPool to no longer extend SkRefCnt, and all usages
either are std::unique_ptr for owners, or GrOpMemoryPool* when ownership
is held somewhere else. The culmination of this is that DDLs explicitly
detach the memory pool from the recording context instead of the GrOpsTask
maintaining a strong ref that preserved the memory somewhat sneakily.
Change-Id: I33e2caebea70cebe8fd7681207c631feeaf2c703
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259424
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This CL begins pulling some of the work forward into onPrePrepare.
Change-Id: If049e0662db51b465b8b82aafebeef2323bddfd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249802
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Adds a GrTextureResolveManager class and plumbs it through calls to
generate the drawing manager's dependency DAG. This new class is
currently unimplemented, but it wraps GrDrawingManager and will
eventually give limited access to functionality for making new tasks
that regenerate mipmaps and/or resolve MSAA. We will use this object
to move mipmap generation up to the DAG/proxy level.
Bug: skia:
Change-Id: Ie1deef21e7ae579a0262f2eeb93d451f0740d823
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232633
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This makes calling GrCaps::getBackendFormatFromColorType equivalent to calling GrContext::defaultBackendFormat
Change-Id: Ic402245fa0502920c47c2a29aadc4e559abdc09b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230416
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This leaves just width, height, and GrPixelConfig. Once we remove the
latter we can replace GrSurfaceDesc with SkISize.
Also remove unused GrRenderTarget::overrideResolveRect
Also remove GrSurfaceProxy::Renderable and use GrRenderable instead.
Change-Id: I652fe6169a22ca33d199b144ec6385286ac07b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228570
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is the last surface desc flag, so remove flags from GrSurfaceDesc.
Bug: skia:6718
Change-Id: Id3ed66b161289927b62f40bfb1f6482cf544deda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227858
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is setting up for GrIORefProxy to just become SkRefCnt and GrProxyRef to just become sk_sp.
Change-Id: Ica66565a353de980a7070e0788f1f2b17565baee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220297
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Since explicit allocation is always enabled now, the resource allocator explicitly manages reuse of GrSurfaces and this flag isn't used/needed.
Change-Id: I5703bf4624e21f9aff9da76575f4ef757b1d2589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210140
Reviewed-by: Brian Salomon <bsalomon@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 preparing the ground for having proxies be atomically reffed
Change-Id: Ice48c41120d4ec10a758f696a69028b6363e8a7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207762
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
With explicit resource allocation there should be no explicit instantiating at flush time. There are, however, still several instances where instantiate is called outside of testing (e.g., readSurfacePixels and writeSurfacePixels).
Change-Id: Ic459a550ca85048f66d6a1eb7d601411f83c6e32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Any context that records ops (i.e., direct and/or DDL) will need these two objects.
Change-Id: Ifd3527c23a4015f7d469ad2222563508cccbd339
Reviewed-on: https://skia-review.googlesource.com/c/190307
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Use same cache for CPU-side copy of data when using GPU buffers.
Change-Id: I09f2837211a30aabc50e9897c090f5fbc6d90492
Reviewed-on: https://skia-review.googlesource.com/c/189484
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@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>
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>
It violates painter's order when merging/chaining an op that is already
in a chain.
Improve OpChainTest so that it would have caught painter's order bug.
Bug: skia:8491
Bug: chromium:894015
Change-Id: Ibfec2d377c903abbb40136e16804137c76d1844c
Reviewed-on: https://skia-review.googlesource.com/c/164609
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>