Commit Graph

25 Commits

Author SHA1 Message Date
Aditya Kushwah
a080f9d6e9 Label intermediate texture.
Label temprory offscreen textures for draws. In this CL, we will
label texture for a part of blur from SkGpuBlurUtils..

Bug: chromium:1164111
Change-Id: Ibfe1c16efa57b6a134a763bc918411108e286704
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549057
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-06-14 18:13:54 +00:00
Robert Phillips
59ba27bc6a Move Ganesh specific headers into include/private/gpu/ganesh
Change-Id: Ia799cdff5288efe5d5d53e8d8f77cf32f3343371
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529131
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-04-12 17:30:07 +00:00
Greg Daniel
719239cd69 Move all Ganesh source files into ganesh subdirectory.
Change-Id: I238d29ba0250224fa593845ae65192653f58faff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528156
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-04-07 21:06:50 +00:00
Kevin Lubick
08ece0c9a0 [includes] Enforce IWYU on sksl code
PS1 regenerates the Bazel files. Use it as the base change when
    comparing patchsets.

IWYU seems to do a good job of working with MyFile.cpp and
MyFile.h, but if there is just a MyHeader.h, it doesn't always
seem to throw errors if the includes aren't correct. This was
observed with include/sksl/DSL.h This might be due to the fact
that headers are not compiled on their own, so they are never
sent directly to the IWYU binary.

This change sets enforce_iwyu_on_package() on the all sksl
packages and then fixes the includes until all those checks
are happy. There were a few files that needed fixes outside
of the sksl folder. Examples include:
 - src/gpu/effects/GrConvexPolyEffect.cpp
 - tests/SkSLDSLTest.cpp

To really enforce this, we need to add a CI/CQ job that runs
bazel build //example:hello_world_gl --config=clang \
  --sandbox_base=/dev/shm --features skia_enforce_iwyu

If that failed, a dev could make the changes described in
the logs and/or run the command locally to see those
prescribed fixes.

I had to add several entries to toolchain/IWYU_mapping.imp
in order to fix some private includes and other atypical
choices. I tried adding a rule there to allow inclusion of
SkTypes.h to make sure defines like SK_SUPPORT_GPU, but
could not get it to work for all cases, so I deferred to
using the IWYU pragma: keep (e.g. SkSLPipelineStageCodeGenerator.h)

Change-Id: I4c3e536d8e69ff7ff2d26fe61a525a6c2e80db06
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522256
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-03-21 12:43:02 +00:00
Robert Phillips
1042c00130 [graphite] Replace GrSLType with SkSLType
This is mostly mechanical. The only interesting bit is that GrSLType was in include/private while SkSLType is in src/core so some #include patterns changed.

Bug: skia:12701
Change-Id: I80bd86ee93796b145f86ded9b4cbf52f24fa59e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497607
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-26 17:30:12 +00:00
Greg Daniel
cdeb092655 [graphite] Move GrProcessorKeyBuilder to generic skgpu::KeyBuilder class.
This also allows the KeyBuilder class to be used in Graphite. In Graphite
I plan to use it for other keys besides building up shaders/processors
so I dropped that from the name. There was nothing special abouts its
implementation that made it specific to Processors anyways.

Bug: skia:12754
Change-Id: I1b25730b061f9342b61e3b2e4ac43328b8074d59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-12-20 20:41:17 +00:00
Brian Osman
fde20db7ca Rename SkSL's 2D cross product builtin function
Note that the 2D cross product isn't defined. There are at least two
possible interpretations of what that might mean. This name makes it
clearer that we're asking for the length of the resulting vector, if
we computed the 3D cross product (assuming Z == 0 for both vectors).

It also eliminates name overlap between builtin functions and actual
intrinsics.

Change-Id: I24e8bc0ab2ec91aaace20f0dd3e8565c10bd44a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484440
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-14 22:00:26 +00:00
Brian Salomon
4895946078 Move ProgramImpl definitions into Processor subclass headers.
Move ProgramImpl function definitions into Processor subclass cpp files.

Delete separate h/cpp files.

Modify GrGLSLVaryingHandler::addPassThroughAttribute to break #include
cycle. It now takes a ShaderVar rather than a GP::Attribute, making
it slightly more flexible as the input can be any variable defined
in the vertex shader.

Bug: skia:11358
Change-Id: I94ee8cd44d29e194216592ecae5fd28de785c975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438596
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-11 19:45:56 +00:00
Brian Salomon
b25560a1e1 Consistency among GrFP::ProgramImpl subclasses
Remove GL or GLSL from names of subclasses. Make nearly all subclasses
nested either in FP class or its onMakeProgramImpl() function.

Make onSetData private rather than protected.

Remove unused INHERITED typedefs.

Embrace idea that Impl is part of FP private implementation:
direct member access rather than getters and no GenKey pattern.

Other random consistency updates, modernatizations, stylistic changes.

Bug: skia:11358
Change-Id: I0d94e00a146abdd38e094ca550fc3b9608bd433d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438056
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-11 13:59:46 +00:00
Brian Salomon
3176e868c4 Rename GrGLSLFragmentProcessor to GrFragmentProcessor::ProgramImpl
Bug: skia:11358

Change-Id: Ic179ddd9d52dca3fc0bd85b61db49097390b7f58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437681
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-09 17:43:59 +00:00
Brian Salomon
13b287386a Remove GLSL from name of functions that builds GrProcessor keys.
Bug: skia:11358
Change-Id: Ie70e45b18c12126c8e86700ad1040bc319be385a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436998
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-09 14:01:13 +00:00
Robert Phillips
4dca83162b Rename GrSurfaceDrawContext to skgpu::v1::SurfaceDrawContext
This CL is mostly mechanical. It:

replaces "src/gpu/GrSurfaceDrawContext.h" #includes with
         "src/gpu/v1/SurfaceDrawContext_v1.h" and reorders

replaces "class GrSurfaceDrawContext;" with
         "namespace skgpu { namespace v1 { class SurfaceDrawContext; }}"

replaces "GrSurfaceDrawContext*" with "auto" where possible
replaces "rtc" with "sdc"
replaces "surfaceDrawContext" with "sdc"
replaces GrSurfaceDrawContext with skgpu::v1::SurfaceDrawContext
reflows parameters as needed

This CL does not try to:

make skgpu::v1::SurfaceDrawContext V1-only
minimize the skgpu and/or skgpu::v1 prefixes

Those two tasks will be accomplished in follow up CLs. This CL is just trying to get the bulk of the mechanical changes comprehensibly landed.

Bug: skia:11837
Change-Id: I6fe59080249d585df8f5d27c6b67569cdc35842f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433156
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-28 20:12:10 +00:00
Robert Phillips
550de7f872 Depower GrPipeline.h
This is mainly to get GrTextureEffect.h out of this header. Its distribution keeps gumming up efforts to make more classes V1-only.

Bug: skia:11837
Change-Id: I6d5aae20bb20cfe3fb4d93c526efe8cf7e5e0c52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425017
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-07 13:56:23 +00:00
Chris Dalton
f5b87f9b11 Make SkSurfaceProps non-optional for SDCs and SkSpecialImages
This ensures we don't lose the original SkSurfaceProps when creating
image filters, etc.

Bug: skia:11396
Change-Id: I6b412361c1005138278a1396faa7f7e069ec7eb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397291
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-04-20 16:22:46 +00:00
Brian Salomon
18ab2030e3 Make GrGLSLFragmentProcessors be created as std::unique_ptr.
Rename factory function from createGLSLInstance() to makeProgramImpl()

Bug: b/180759848
Bug: skia:11358
Change-Id: I095bdf1f26db5a8192fa8ab59000db4a1d561d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373738
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-02-23 19:31:01 +00:00
Brian Salomon
dd4087d1e8 GrSurfaceContext::read/writePixels takes GrPixmap
Change readPixels contract to allow unknown->unknown AT reads, but
fail if one side is unknown and the other isn't (and update GPU read
pixels test accordingly).

Also, ProxyUtils::MakeTextureProxyViewFromData takes GrPixmap.

Bug: skia:8862
Change-Id: I771c154833408e666f860413c1a711714696326d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347196
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-29 16:31:56 +00:00
John Stiles
bead7e324a Remove GrFragmentProcessor::usesExplicitReturn.
All fragment processors now use explicit returns; sk_OutColor no longer
exists at all.

Change-Id: Ic5cf566a916c1d616edcc56ba84b6780776f8515
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344300
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 18:06:12 +00:00
John Stiles
d1eab8b52e Replace more instances of sk_OutColor with explicit returns.
Change-Id: Ie6abd063e8954c004c856f555a82937ff4e6c0a8
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344296
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 15:14:09 +00:00
Brian Salomon
eebe735dea GrRenderTargetContext->GrSurfaceDrawContext
Just the class/files. variable names and additional comments to follow.

Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-10 18:51:19 +00:00
Brian Salomon
70fe17e12f Remove GrRenderTargetContextPriv and GrSurfaceContextPriv
I think this is vestigial from some time in the past where RTC was
public.

Also just expose the methods that add ops rather than have so many
friends + testingOnly versions.

Change-Id: I60d9fdff23b2d67039a7b37815da7ff9e73d8999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339158
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-30 20:13:25 +00:00
John Stiles
6f3015a562 Reland "Add sk_Caps.builtinDeterminantSupport and use it in cross()."
This is a reland of 6bbf026b54

Original change's description:
> Add sk_Caps.builtinDeterminantSupport and use it in cross().
>
> This CL partially relands http://review.skia.org/321790.
>
> Change-Id: I26a1aefda8a01167783e6e7fa15a51aa35ee5d82
> Bug: skia:10819, skia:10810
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323784
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Bug: skia:10819
Bug: skia:10810
Change-Id: I7731f93db07bc917707cbbe1daca2e5ce0f763d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324620
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-09 14:45:23 +00:00
Jim Van Verth
2ae1dd93d8 Revert "Add sk_Caps.builtinDeterminantSupport and use it in cross()."
This reverts commit 6bbf026b54.

Reason for revert: Breaking Metal bot.

Original change's description:
> Add sk_Caps.builtinDeterminantSupport and use it in cross().
>
> This CL partially relands http://review.skia.org/321790.
>
> Change-Id: I26a1aefda8a01167783e6e7fa15a51aa35ee5d82
> Bug: skia:10819, skia:10810
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323784
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=csmartdalton@google.com,johnstiles@google.com

Change-Id: I4a6c1a63dc38682dd965f78f0c1da98f35b6dbad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10819
Bug: skia:10810
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324264
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-09 00:12:34 +00:00
John Stiles
6bbf026b54 Add sk_Caps.builtinDeterminantSupport and use it in cross().
This CL partially relands http://review.skia.org/321790.

Change-Id: I26a1aefda8a01167783e6e7fa15a51aa35ee5d82
Bug: skia:10819, skia:10810
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323784
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-08 22:51:15 +00:00
Jim Van Verth
8ffd4d750f Revert "Add a 2d cross product intrinsic to sksl"
This reverts commit 57c37ad0e4.

Reason for revert: Breaking the Mali400 bots.

Original change's description:
> Add a 2d cross product intrinsic to sksl
>
> Change-Id: Iebaf4616665547d6ca4900e1247d5b68e0f3512a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321790
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,csmartdalton@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I3e1aa251e883e3d2a1170b0fc6cdc84ea06e784a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323556
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-07 14:35:51 +00:00
Chris Dalton
57c37ad0e4 Add a 2d cross product intrinsic to sksl
Change-Id: Iebaf4616665547d6ca4900e1247d5b68e0f3512a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321790
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-07 08:38:59 +00:00