Skip to content

Commit

Permalink
Enforce IWYU on src/gpu/ganesh/effects
Browse files Browse the repository at this point in the history
Bug: skia:13052
Change-Id: Ia0f3045c587a9ab52f20c60e3f53e94e354efb51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/681417
Reviewed-by: Michael Ludwig <[email protected]>
Commit-Queue: Kevin Lubick <[email protected]>
  • Loading branch information
kjlubick authored and SkCQ committed Apr 28, 2023
1 parent 04c8a65 commit 5fa6c88
Show file tree
Hide file tree
Showing 43 changed files with 455 additions and 105 deletions.
2 changes: 2 additions & 0 deletions src/gpu/ganesh/GrFragmentProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "src/gpu/ganesh/GrFragmentProcessor.h"

#include "include/core/SkM44.h"
#include "src/base/SkVx.h"
#include "src/core/SkRuntimeEffectPriv.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrPipeline.h"
Expand Down
2 changes: 2 additions & 0 deletions src/gpu/ganesh/GrProcessorAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include "include/private/SkColorData.h"

#include <memory>

class GrCaps;
class GrDrawOp;
class GrFragmentProcessor;
Expand Down
8 changes: 7 additions & 1 deletion src/gpu/ganesh/effects/GrBezierEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@

#include "src/gpu/ganesh/effects/GrBezierEffect.h"

#include "include/core/SkColor.h"
#include "src/base/SkRandom.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/gpu/ganesh/GrColor.h"
#include "src/gpu/ganesh/GrShaderVar.h"
#include "src/gpu/ganesh/GrTestUtils.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include "src/gpu/ganesh/glsl/GrGLSLVarying.h"
#include "src/gpu/ganesh/glsl/GrGLSLVertexGeoBuilder.h"

#include <iterator>

class GrConicEffect::Impl : public ProgramImpl {
public:
void setData(const GrGLSLProgramDataManager& pdman,
Expand Down
14 changes: 9 additions & 5 deletions src/gpu/ganesh/effects/GrBezierEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
#ifndef GrBezierEffect_DEFINED
#define GrBezierEffect_DEFINED

#include "include/core/SkMatrix.h"
#include "include/private/SkColorData.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkArenaAlloc.h"
#include "src/core/SkSLTypeShared.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrGeometryProcessor.h"
#include "src/gpu/ganesh/GrProcessor.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/GrShaderCaps.h"

#include <cstdint>
#include <memory>

namespace skgpu { class KeyBuilder; }

/**
* Shader is based off of Loop-Blinn Quadratic GPU Rendering
Expand Down Expand Up @@ -55,8 +63,6 @@
* only one geometry would need to be rendered. However no benches were run comparing
* chopped first order and non chopped 2nd order.
*/
class GrGLConicEffect;

class GrConicEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Make(SkArenaAlloc* arena,
Expand Down Expand Up @@ -117,8 +123,6 @@ class GrConicEffect : public GrGeometryProcessor {
* Coverage for AA is min(0, 1-distance). 3rd & 4th cimponent unused.
* Requires shader derivative instruction support.
*/
class GrGLQuadEffect;

class GrQuadEffect : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Make(SkArenaAlloc* arena,
Expand Down
20 changes: 16 additions & 4 deletions src/gpu/ganesh/effects/GrBicubicEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,29 @@

#include "src/gpu/ganesh/effects/GrBicubicEffect.h"

#include "src/core/SkMatrixPriv.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "include/core/SkString.h"
#include "include/private/SkSLSampleUsage.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkRandom.h"
#include "src/core/SkSLTypeShared.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrTestUtils.h"
#include "src/gpu/ganesh/effects/GrMatrixEffect.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include "src/shaders/SkImageShader.h"
#include "src/sksl/SkSLString.h"

#include <cmath>
#include <cstdint>
#include <string>
#include <utility>

class GrBicubicEffect::Impl : public ProgramImpl {
public:
Expand Down Expand Up @@ -99,8 +113,6 @@ void GrBicubicEffect::Impl::emitCode(EmitArgs& args) {
fragBuilder->codeAppendf("return bicubicColor;");
}

#include "src/shaders/SkImageShader.h"

void GrBicubicEffect::Impl::onSetData(const GrGLSLProgramDataManager& pdm,
const GrFragmentProcessor& fp) {
auto& bicubicEffect = fp.cast<GrBicubicEffect>();
Expand Down
11 changes: 10 additions & 1 deletion src/gpu/ganesh/effects/GrBicubicEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@
#define GrBicubicTextureEffect_DEFINED

#include "include/core/SkSamplingOptions.h"
#include "include/private/SkColorData.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/GrSamplerState.h"

class GrInvariantOutput;
#include <memory>

class GrCaps;
class GrSurfaceProxyView;
class SkMatrix;
enum SkAlphaType : int;
struct GrShaderCaps;
struct SkRect;

namespace skgpu { class KeyBuilder; }

class GrBicubicEffect : public GrFragmentProcessor {
public:
Expand Down
18 changes: 16 additions & 2 deletions src/gpu/ganesh/effects/GrBitmapTextGeoProc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@

#include "src/gpu/ganesh/effects/GrBitmapTextGeoProc.h"

#include "include/core/SkSamplingOptions.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMath.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkRandom.h"
#include "src/core/SkSLTypeShared.h"
#include "src/gpu/AtlasTypes.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrColor.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrShaderVar.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrTestUtils.h"
#include "src/gpu/ganesh/effects/GrAtlasedShaderHelpers.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include "src/gpu/ganesh/glsl/GrGLSLVarying.h"
#include "src/gpu/ganesh/glsl/GrGLSLVertexGeoBuilder.h"

#include <algorithm>

class GrGLSLVertexBuilder;

using MaskFormat = skgpu::MaskFormat;

Expand Down
16 changes: 12 additions & 4 deletions src/gpu/ganesh/effects/GrBitmapTextGeoProc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@
#ifndef GrBitmapTextGeoProc_DEFINED
#define GrBitmapTextGeoProc_DEFINED

#include "include/core/SkMatrix.h"
#include "include/core/SkSize.h"
#include "include/private/SkColorData.h"
#include "src/base/SkArenaAlloc.h"
#include "src/gpu/AtlasTypes.h"
#include "src/gpu/ganesh/GrGeometryProcessor.h"
#include "src/gpu/ganesh/GrProcessor.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/GrSamplerState.h"

#include <memory>

class GrGLBitmapTextGeoProc;
class GrInvariantOutput;
class GrSurfaceProxyView;
struct GrShaderCaps;

namespace skgpu {
class KeyBuilder;
enum class MaskFormat : int;
}

/**
* The output color of this effect is a modulation of the input color and a sample from a texture.
Expand Down
10 changes: 9 additions & 1 deletion src/gpu/ganesh/effects/GrBlendFragmentProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@

#include "src/gpu/ganesh/effects/GrBlendFragmentProcessor.h"

#include "include/core/SkBlendMode.h"
#include "include/core/SkString.h"
#include "include/private/SkColorData.h"
#include "src/base/SkRandom.h"
#include "src/core/SkBlendModePriv.h"
#include "src/gpu/Blend.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/SkGr.h"
#include "src/gpu/ganesh/glsl/GrGLSLBlend.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"

#include <string>

class GrGLSLProgramDataManager;
struct GrShaderCaps;

// Some of the CPU implementations of blend modes differ from the GPU enough that
// we can't use the CPU implementation to implement constantOutputForConstantInput.
static inline bool does_cpu_blend_impl_match_gpu(SkBlendMode mode) {
Expand Down
6 changes: 3 additions & 3 deletions src/gpu/ganesh/effects/GrBlendFragmentProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#ifndef GrBlendFragmentProcessor_DEFINED
#define GrBlendFragmentProcessor_DEFINED

#include "include/core/SkBlendMode.h"
#include "include/core/SkRefCnt.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"

#include <memory>
#include <utility>

class GrFragmentProcessor;
enum class SkBlendMode;

namespace GrBlendFragmentProcessor {

Expand Down
16 changes: 16 additions & 0 deletions src/gpu/ganesh/effects/GrConvexPolyEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,29 @@

#include "src/gpu/ganesh/effects/GrConvexPolyEffect.h"

#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkString.h"
#include "include/private/SkColorData.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkPathEnums.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkRandom.h"
#include "src/core/SkPathPriv.h"
#include "src/core/SkSLTypeShared.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <tuple>

struct GrShaderCaps;

//////////////////////////////////////////////////////////////////////////////

GrFPResult GrConvexPolyEffect::Make(std::unique_ptr<GrFragmentProcessor> inputFP,
Expand Down
14 changes: 10 additions & 4 deletions src/gpu/ganesh/effects/GrConvexPolyEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
#ifndef GrConvexPolyEffect_DEFINED
#define GrConvexPolyEffect_DEFINED

#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "include/core/SkScalar.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrProcessor.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/shaders/SkShaderBase.h"

#include <array>
#include <memory>
#include <utility>

class GrInvariantOutput;
class SkPath;
enum class GrClipEdgeType;
struct GrShaderCaps;

namespace skgpu { class KeyBuilder; }

/**
* An effect that renders a convex polygon. It is intended to be used as a coverage effect.
Expand Down
14 changes: 9 additions & 5 deletions src/gpu/ganesh/effects/GrCoverageSetOpXP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@

#include "src/gpu/ganesh/effects/GrCoverageSetOpXP.h"

#include "include/private/SkColorData.h"
#include "include/private/base/SkAssert.h"
#include "src/base/SkRandom.h"
#include "src/gpu/Blend.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrColor.h"
#include "src/gpu/ganesh/GrPipeline.h"
#include "src/gpu/ganesh/GrXferProcessor.h"
#include "src/gpu/ganesh/glsl/GrGLSLBlend.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"

#include <memory>

enum class GrClampType;
struct GrShaderCaps;

class CoverageSetOpXP : public GrXferProcessor {
public:
Expand Down
6 changes: 5 additions & 1 deletion src/gpu/ganesh/effects/GrCoverageSetOpXP.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
#ifndef GrCoverageSetOpXP_DEFINED
#define GrCoverageSetOpXP_DEFINED

#include "include/core/SkRefCnt.h"
#include "include/core/SkRegion.h"
#include "include/gpu/GrTypes.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrProcessorAnalysis.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/GrXferProcessor.h"

enum class GrClampType;

// See the comment above GrXPFactory's definition about this warning suppression.
#if defined(__GNUC__)
#pragma GCC diagnostic push
Expand Down
16 changes: 12 additions & 4 deletions src/gpu/ganesh/effects/GrCustomXfermode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@

#include "src/gpu/ganesh/effects/GrCustomXfermode.h"

#include "include/core/SkBlendMode.h"
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAssert.h"
#include "src/base/SkRandom.h"
#include "src/gpu/Blend.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrPipeline.h"
#include "src/gpu/ganesh/GrProcessor.h"
#include "src/gpu/ganesh/GrProcessorAnalysis.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/GrShaderCaps.h"
#include "src/gpu/ganesh/GrXferProcessor.h"
#include "src/gpu/ganesh/glsl/GrGLSLBlend.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"

#include <memory>
#include <string>

class GrGLSLProgramDataManager;
enum class GrClampType;

bool GrCustomXfermode::IsSupportedMode(SkBlendMode mode) {
return (int)mode > (int)SkBlendMode::kLastCoeffMode &&
(int)mode <= (int)SkBlendMode::kLastMode;
Expand Down
5 changes: 1 addition & 4 deletions src/gpu/ganesh/effects/GrCustomXfermode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
#ifndef GrCustomXfermode_DEFINED
#define GrCustomXfermode_DEFINED

#include "include/core/SkBlendMode.h"
#include "include/core/SkRefCnt.h"

class GrTexture;
class GrXPFactory;
enum class SkBlendMode;

/**
* Custom Xfer modes are used for blending when the blend mode cannot be represented using blend
Expand Down
Loading

0 comments on commit 5fa6c88

Please sign in to comment.