This CL is interesting bc the AAHairlineOp is the first one that requires multiple programInfos.
Correspondingly, it is also the first one that shares a pipeline between said multiple programInfos.
Bug: skia:9455
Change-Id: I2369abbdeaf4eac2bc9547ad36631beba29bd641
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277203
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 1c3bea4593.
Reason for revert: breaking ios build
Original change's description:
> Set up eGPU/discrete support for MacOS.
>
> Pulled out of https://skia-review.googlesource.com/c/skia/+/271319.
>
> For Metal, will default to an eGPU or discrete GPU if one is available.
> For GL, will attempt to use a Radeon eGPU, and will fallback
> if one can't be found.
>
> Change-Id: I0a1efb3afca612ac75be56f633d811dda68f9d10
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277516
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
Change-Id: I84c64793cc305a415f54ff0496d4ec410a94687f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277579
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Pulled out of https://skia-review.googlesource.com/c/skia/+/271319.
For Metal, will default to an eGPU or discrete GPU if one is available.
For GL, will attempt to use a Radeon eGPU, and will fallback
if one can't be found.
Change-Id: I0a1efb3afca612ac75be56f633d811dda68f9d10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277516
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Everyone is responsible to set up their own scissor and textures now.
Change-Id: Ic3547f00c0e7908409631951de4b7237b9bce23b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277177
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Add a version tag at the start, reject any cache blobs without it
Bug: chromium:1062018
Change-Id: I18bb668e6b836e1247640e9286a69a3e745babfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277376
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The biggest mismatch between these and SkTHash{Map,Set,Table}
is the old ones provide Iter and ConstIter, the new ones foreach().
This CL,
- adds foreach() methods to the old types,
- replaces all uses of ConstIter with foreach(),
- replaces most uses of Iter with foreach(),
I'm leaving one spot using Iter to walk the table and remove its
elements for its own CL... it'll be a little more complicated to get
that right.
From there it should be straightforward to turn SkTDynamicHash
into a thin wrapper over an SkTHashTable.
Bugs: skia:9703
Change-Id: Ia6ba87c35b89585c42b5b9f118f4cbf3abd04f0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277098
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This CL moves the boiler-plate implementation of onPrePrepareDraws up to GrMeshDrawOp. This, unfortunately, required the addition of a 'programInfo' virtual but that may go away in the future.
The only GrMeshDrawOp-derived classes left are:
AAHairlineOp - which has 3 programInfos
AAFlatteningConvexPathOp - which has >=1 mesh (but just 1 programInfo)
GrAtlasTextOp - which has inline uploads
SmallPathOp - which, maybe, has inline uploads
TextureOp - which has chaining
Bug: skia:9455
Change-Id: Id10f70e764054134751545ad38b99f0a0778de76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This CL:
Renames the existing createProgramInfo method to onCreateProgramInfo and makes it a virtual on GrMeshDrawOp
Moves the non-virtual createProgramInfo (helper) calls to GrMeshDrawOp
Changes onCreateProgramInfo to not return a ProgramInfo*. This is setting up to handle ops that create >1 programInfo (e.g., AAHairlineOp)
This CL leaves the following 8 ops in need of an onCreateProgramInfo implementation:
AAHairlineOp
AAFlatteningConvexPathOp
GrAtlasTextOp
GrShadowRRectOp
SmallPathOp
GrTextureOp
PrimitiveProcessorTest::Op
VertexColorSpaceBench::Op
Bug: skia:9455
Change-Id: Id7e2b8a40cac86ede6bf3c0e544da5500ff47d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276403
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
- used for debug lock tracking in SkFont*
- used for debug logging in SkPathOps
- genuine use in GLTestContext_cmd_buf?
switched that to thread_local
- keep empty SkTLS_{pthread,win}.cpp until
references to them can be cleaned up
Bug: skia:10006
Change-Id: I195a94c95d3f1a1918ee8c9bc4a15fa5b4344fbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit e5a06ce678.
Reason for revert: Need to make change in google3 first
Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
>
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
>
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This CL also incidentally adds:
1) a GrMeshDrawOp::Target 'outputView' virtual and switches GrOpFlushState over to overriding it.
2) a createProgramInfo helper to GrSimpleMeshDrawOpHelper
Bug: skia:9455
Change-Id: I88ce51c585b1458ee79a9aaa7024190e9f19198c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274506
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit d3606518fa.
Reason for revert: DDL3 bots are red
Original change's description:
> Add onPrePrepareDraws & createProgramInfo methods to GrDrawVerticesOp
>
> This CL also incidentally adds:
>
> 1) a GrMeshDrawOp::Target 'outputView' virtual and switches GrOpFlushState over to overriding it.
>
> 2) a createProgramInfo helper to GrSimpleMeshDrawOpHelper
>
> Bug: skia:9455
> Change-Id: Iecd712d3ac76038651bd2e0512134e310930d527
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274551
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: I6e44ba3bc47df27479af9344af946e27f0a2e937
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274505
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This CL also incidentally adds:
1) a GrMeshDrawOp::Target 'outputView' virtual and switches GrOpFlushState over to overriding it.
2) a createProgramInfo helper to GrSimpleMeshDrawOpHelper
Bug: skia:9455
Change-Id: Iecd712d3ac76038651bd2e0512134e310930d527
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274551
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Each such op now has a base createProgramInfo method along with a helper version that just takes a flushState.
This CL also makes GrSimpleMeshDrawOpHelper::CreateProgramInfo a chokepoint for programInfo allocation.
Bug: skia:9455
Change-Id: Ibbf0e9cd6f24453e1b87a5e072a30248811a1237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274054
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This helper method can be used by the MeshDrawOps to (pre-)create their GrProgramInfos.
Bug: skia:9455
Change-Id: I41b7c2aefc0f633a1d32996c7f0cce3d11f8fcb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273815
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is just a simple clean up from a CL request.
Change-Id: Ibc09e19aeb8a160e4e4e03573fcf56cb1d58525b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273983
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This CL also adds helper functions (i.e., createPipeline and createPipelineWithStencil) to better encapsulate pipeline creation.
This is a first step towards making GrSimpleMeshDrawOpHelper surface its GrProgramInfos.
Bug: skia:9455
Change-Id: Ic6cc7a01383e42436305358a9b193958d862786c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273556
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:9935
Change-Id: Id8b851afdd97f8405dbb405e3f142f86dbe1de31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273003
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This is a reland of 29dc430f43
Original change's description:
> Create D3D device and queue
>
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:9935
Change-Id: I1c8797e09cdeb3694ea7f47b2236ab7d91d9519f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This also allows us to remove all the one off Fence code that we
implemented in all the backend TestContexts
Change-Id: I9ff7ba4690cf3f19a180f51fc510991a112bb62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272456
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 29dc430f43.
Reason for revert: This is breaking the Google3 autoroller due to header file d3d12.h not being available on google3.
Original change's description:
> Create D3D device and queue
>
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
Change-Id: I3857444cae52cc2338258c46b974ae5496bbaedc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272726
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
Bug: skia:9935
Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This CL has a complicated back story, but it's concrete change is
simple, just turning the warning on and converting a bunch of
return foo;
to
return std::move(foo);
These changes are exclusively in places where RVO and NRVO do not apply,
so it should not conflict with warnings like -Wpessimizing-move.
Since C++11, when you return a named local and its type doesn't match
the declared return type exactly, there's an implicit std::move()
wrapped around the value (what I'm making explicit here) so the move
constructor gets an opportunity to take precedence over the copy
constructor. You can read about this implicit move here under the
section "automatic move from local variables and parameters":
https://en.cppreference.com/w/cpp/language/return#Notes.
This situation comes up for us with smart pointers: a function declares
its return type as std::unique_ptr<Base> or sk_sp<Base>, and we return a
std::unique_ptr<Impl> or sk_sp<Impl>. Those types don't match exactly,
so RVO and NRVO don't come into play. They've always been going through
move constructors, and that's not changed here, just made explicit.
There was apparently once a bug in the C++11 standard and compilers
implementing that which made these copy instead of move, and then this
sort of code would do a little unnecessary ref/unref dance for sk_sp,
and would entirely fail to compile for uncopyable std::unique_ptr.
These explicit moves ostensibly will make our code more compatible with
those older compilers.
That compatibility alone is, I think, a terrible reason to land this CL.
Like, actively bad. But... to balance that out, I think the explicit
std::move()s here actually help remind us that RVO/NRVO are not in play,
and remind us we're going to call the move constructor. So that C++11
standard bug becomes kind of useful for us, in that Clang added this
warning to catch it, and its fix improves readability.
So really read this all as, "warn about implicit std::move() on return".
In the end I think it's just about readability. I don't really hold any
hope out that we'll become compatible with those older compilers.
Bug: skia:9909
Change-Id: Id596e9261188b6f10e759906af6c95fe303f6ffe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: Id24ed653adb80fe9b2ad597a34e459eb91ca53ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
I find this useful for managing which context is active on threads.
Change-Id: I655955a2351f273751681f080190ca684d29db4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@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>
Use std::min and std::max everywhere.
SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.
Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Will be used for YUV420 readback on ANGLE ES 2 contexts in Chrome.
Marks the functions as required as Chrome now adds inits these on
GrGLInterface.
Bug: 1040643
Change-Id: I5504d4c9209874991592c9f86aaf7987c316aa40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265602
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Also add macro for ALL_COMPLETED
We plan to use this with ANGLE ES2 contexts.
Change-Id: I6c967fa9b9aefc41c31cd806aece8533f846f940
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265756
Reviewed-by: Brian Osman <brianosman@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>
There are devices that advertise this extension but don't actually
provide the GL entrypoints. This is causing live crashes.
Bug: flutter:47164
Bug: flutter:47804
Change-Id: Idded47e8dbd4462463ad91a62b06b0df3245f0c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263809
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Implements tessellation support at the Ganesh level, and adds back
door methods for supplying raw GLSL strings directly to the OpenGL
driver. Adds a new gm to verify tessellation is works in GL.
Change-Id: Idfc285b955cbe5e8e6bf0475be8b518b0cc6ed2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261196
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This CL updates all callers that ending up in GrDrawingManager::makeSurfaceContext
to use the new factory or directly call ctors.
A follow on change will get the rest of the calls which go to
GrDrawingManager::makeRenderTargetContext
Change-Id: I662da654a1ec8b8972c50fe9ce45a9185d4c3dc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260901
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 5b9c7ba313.
Reason for revert: Looks to still be breaking chrome
Original change's description:
> Revert "Revert "Remove most of GrConfig.h""
>
> This reverts commit b0047b57b7.
>
> Change-Id: I0c6df9e9d5c3984987398d2b7f675005828ab3de
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260697
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com
Change-Id: Ia9860b39c562368f8a2f84283c52f55593333075
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is a first step towards pulling the creation of the GrProgramInfos explicitly into the Ops' onExecute methods. We need this behavior so programInfo creation can be moved forward to onPrePrepare.
For now, pipeline creation is a static member on GrSimpleMeshDrawOpHelper so GrPipeline creation can be bottle-neckedOps for Ops that don't use the helper. In some future world CreatePipeline could become non-static to reduce some of the duplicate code.
Bug: skia:9455
Change-Id: I2d35dd223db824e84616f5df0f1dca34c1b6e412
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258003
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>