Skip to content

Commit

Permalink
Enforce IWYU on more src/gpu and ganesh files
Browse files Browse the repository at this point in the history
These changes are all pretty mechanical.

Change-Id: I0018fe3166c7fba4d3c4e442ba4e0e8eebdbf936
Bug: b/40044159
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/826071
Reviewed-by: Nicolette Prevost <[email protected]>
Commit-Queue: Kevin Lubick <[email protected]>
Auto-Submit: Kevin Lubick <[email protected]>
  • Loading branch information
kjlubick authored and SkCQ committed Mar 18, 2024
1 parent c0bf73e commit 7e207af
Show file tree
Hide file tree
Showing 39 changed files with 327 additions and 98 deletions.
2 changes: 2 additions & 0 deletions bench/TessellateBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
#include "src/core/SkPathPriv.h"
#include "src/core/SkRectPriv.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrPipeline.h"
#include "src/gpu/ganesh/mock/GrMockOpTarget.h"
#include "src/gpu/ganesh/tessellate/PathTessellator.h"
#include "src/gpu/ganesh/tessellate/StrokeTessellator.h"
#include "src/gpu/tessellate/AffineMatrix.h"
#include "src/gpu/tessellate/MiddleOutPolygonTriangulator.h"
#include "src/gpu/tessellate/WangsFormula.h"
#include "tools/ToolUtils.h"

#include <vector>

namespace skgpu::ganesh {
Expand Down
4 changes: 4 additions & 0 deletions src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ generate_cpp_files_for_headers(
"src/gpu/BufferWriter.h",
"src/gpu/GpuRefCnt.h",
"src/gpu/GpuTypesPriv.h",
"src/gpu/KeyBuilder.h",
"src/gpu/MutableTextureStatePriv.h",
"src/gpu/SkRenderEngineAbortf.h",
"src/gpu/SwizzlePriv.h",
"src/gpu/ganesh/GrBackendSemaphorePriv.h",
"src/gpu/ganesh/GrBackendSurfacePriv.h",
"src/gpu/ganesh/GrClip.h",
Expand Down
4 changes: 4 additions & 0 deletions src/gpu/KeyBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
#define skgpu_KeyBuilder_DEFINED

#include "include/core/SkString.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTArray.h"

#include <cstdint>
#include <string_view>

namespace skgpu {

class KeyBuilder {
Expand Down
5 changes: 2 additions & 3 deletions src/gpu/PipelineUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
#include "src/gpu/PipelineUtils.h"

#include "include/gpu/ShaderErrorHandler.h"
#include "include/private/base/SkDebug.h"
#include "src/sksl/SkSLCompiler.h"
#include "src/sksl/SkSLProgramKind.h"
#include "src/sksl/SkSLProgramSettings.h"
#include "src/sksl/SkSLUtil.h"
#include "src/sksl/ir/SkSLProgram.h"
#include "src/utils/SkShaderUtils.h"

#include <memory>
#include <string>

namespace skgpu {
Expand Down
3 changes: 3 additions & 0 deletions src/gpu/RectanizerPow2.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
#ifndef skgpu_RectanizerPow2_DEFINED
#define skgpu_RectanizerPow2_DEFINED

#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMalloc.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkIPoint16.h"
#include "src/gpu/Rectanizer.h"

#include <cstdint>

namespace skgpu {

// This Rectanizer quantizes the incoming rects to powers of 2. Each power
Expand Down
4 changes: 3 additions & 1 deletion src/gpu/RectanizerSkyline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
* found in the LICENSE file.
*/

#include "src/core/SkIPoint16.h"
#include "src/gpu/RectanizerSkyline.h"

#include "include/private/base/SkAssert.h"
#include "src/core/SkIPoint16.h"

#include <algorithm>

namespace skgpu {
Expand Down
4 changes: 4 additions & 0 deletions src/gpu/RectanizerSkyline.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include "include/private/base/SkTDArray.h"
#include "src/gpu/Rectanizer.h"

#include <cstdint>

struct SkIPoint16;

namespace skgpu {

// Pack rectangles and track the current silhouette
Expand Down
5 changes: 4 additions & 1 deletion src/gpu/ResourceKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
* found in the LICENSE file.
*/

#include "src/core/SkChecksum.h"
#include "src/gpu/ResourceKey.h"

#include "src/core/SkChecksum.h"

#include <atomic>

namespace skgpu {

ScratchKey::ResourceType ScratchKey::GenerateResourceType() {
Expand Down
8 changes: 6 additions & 2 deletions src/gpu/ResourceKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
#define skgpu_ResourceKey_DEFINED

#include "include/core/SkData.h"
#include "include/core/SkString.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkAlignedStorage.h"
#include "include/private/base/SkOnce.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"

#include <cstdint>
#include <cstring>
#include <new>
#include <utility>

class TestResource;

Expand Down
4 changes: 4 additions & 0 deletions src/gpu/ShaderErrorHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@

#include "include/gpu/ShaderErrorHandler.h"

#include "include/private/base/SkDebug.h"
#include "src/utils/SkShaderUtils.h"

#include <functional>
#include <string>

namespace skgpu {

ShaderErrorHandler* DefaultShaderErrorHandler() {
Expand Down
1 change: 1 addition & 0 deletions src/gpu/SkBackingFit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "src/gpu/SkBackingFit.h"

#include "include/private/base/SkMath.h"
#include "src/base/SkMathPriv.h"

#include <algorithm>
Expand Down
2 changes: 2 additions & 0 deletions src/gpu/Swizzle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkRasterPipelineOpList.h"

#include <cstring>

namespace skgpu {

void Swizzle::apply(SkRasterPipeline* pipeline) const {
Expand Down
9 changes: 8 additions & 1 deletion src/gpu/Swizzle.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@
#ifndef skgpu_Swizzle_DEFINED
#define skgpu_Swizzle_DEFINED

#include "include/core/SkAlphaType.h"
#include "include/core/SkColor.h"
#include "include/core/SkString.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTypeTraits.h"

#include <array>
#include <cstddef>
#include <cstdint>
#include <type_traits>

class SkRasterPipeline;
enum SkAlphaType : int;

namespace skgpu {

Expand Down
2 changes: 2 additions & 0 deletions src/gpu/SwizzlePriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include "src/gpu/Swizzle.h"

#include <cstdint>

namespace skgpu {

// This class is friended by Swizzle and allows other functions to trampoline through this
Expand Down
23 changes: 11 additions & 12 deletions src/gpu/ganesh/GrGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,35 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/


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

#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTextureCompressionType.h"
#include "include/gpu/GrBackendSemaphore.h"
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrDirectContext.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkCompressedDataUtils.h"
#include "src/core/SkMipmap.h"
#include "src/gpu/ganesh/GrAttachment.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/RefCntedCallback.h"
#include "src/gpu/ganesh/GrBackendUtils.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrDataUtils.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrGpuBuffer.h"
#include "src/gpu/ganesh/GrGpuResourcePriv.h"
#include "src/gpu/ganesh/GrNativeRect.h"
#include "src/gpu/ganesh/GrPipeline.h"
#include "src/gpu/ganesh/GrRenderTarget.h"
#include "src/gpu/ganesh/GrResourceCache.h"
#include "src/gpu/ganesh/GrResourceProvider.h"
#include "src/gpu/ganesh/GrRingBuffer.h"
#include "src/gpu/ganesh/GrSemaphore.h"
#include "src/gpu/ganesh/GrStagingBufferManager.h"
#include "src/gpu/ganesh/GrStencilSettings.h"
#include "src/gpu/ganesh/GrSurface.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrTextureProxyPriv.h"
#include "src/gpu/ganesh/GrTracing.h"
#include "src/sksl/SkSLCompiler.h"

#include <algorithm>
#include <utility>

using namespace skia_private;

Expand Down
43 changes: 27 additions & 16 deletions src/gpu/ganesh/GrGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,56 @@
#ifndef GrGpu_DEFINED
#define GrGpu_DEFINED

#include "include/core/SkPath.h"
#include "include/core/SkData.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSpan.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTypes.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrTypes.h"
#include "include/private/base/SkTArray.h"
#include "src/base/SkTInternalLList.h"
#include "src/gpu/RefCntedCallback.h"
#include "src/gpu/Swizzle.h"
#include "src/gpu/ganesh/GrAttachment.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrGpuBuffer.h"
#include "src/gpu/ganesh/GrGpuBuffer.h" // IWYU pragma: keep
#include "src/gpu/ganesh/GrOpsRenderPass.h"
#include "src/gpu/ganesh/GrPixmap.h"
#include "src/gpu/ganesh/GrSamplerState.h"
#include "src/gpu/ganesh/GrXferProcessor.h"

#include <array>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string_view>

class GrAttachment;
class GrBackendRenderTarget;
class GrBackendSemaphore;
struct GrContextOptions;
class GrDirectContext;
class GrGLContext;
class GrPipeline;
class GrGeometryProcessor;
class GrProgramDesc;
class GrProgramInfo;
class GrRenderTarget;
class GrRingBuffer;
class GrSemaphore;
class GrStagingBufferManager;
class GrStencilSettings;
class GrSurface;
class GrSurfaceProxy;
class GrTexture;
class GrThreadSafePipelineBuilder;
struct GrVkDrawableInfo;
class SkJSONWriter;
class SkString;
enum class SkTextureCompressionType;
struct GrVkDrawableInfo;
struct SkISize;
struct SkImageInfo;

namespace SkSL {
class Compiler;
namespace SkSurfaces {
enum class BackendSurfaceAccess;
}
namespace skgpu {
class MutableTextureState;
class RefCntedCallback;
} // namespace skgpu

class GrGpu {
public:
Expand Down
9 changes: 8 additions & 1 deletion src/gpu/ganesh/GrGpuBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
* found in the LICENSE file.
*/

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

#include "include/private/base/SkAlign.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTo.h"
#include "src/gpu/ResourceKey.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrGpu.h"
#include "src/gpu/ganesh/GrGpuBuffer.h"

#include <cstdint>

GrGpuBuffer::GrGpuBuffer(GrGpu* gpu, size_t sizeInBytes, GrGpuBufferType type,
GrAccessPattern pattern,
Expand Down
8 changes: 8 additions & 0 deletions src/gpu/ganesh/GrGpuBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@
#ifndef GrGpuBuffer_DEFINED
#define GrGpuBuffer_DEFINED

#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/ganesh/GrBuffer.h"
#include "src/gpu/ganesh/GrGpuResource.h"

#include <cstddef>
#include <string_view>

class GrGpu;

namespace skgpu {
class ScratchKey;
}

class GrGpuBuffer : public GrGpuResource, public GrBuffer {
public:
/**
Expand Down
5 changes: 4 additions & 1 deletion src/gpu/ganesh/GrGpuResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/gpu/ganesh/GrGpuResource.h"

#include "include/core/SkTraceMemoryDump.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/GrDirectContext.h"
#include "include/private/base/SkDebug.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrGpu.h"
#include "src/gpu/ganesh/GrGpuResource.h"
#include "src/gpu/ganesh/GrGpuResourcePriv.h"
#include "src/gpu/ganesh/GrResourceCache.h"

#include <atomic>

static inline GrResourceCache* get_resource_cache(GrGpu* gpu) {
Expand Down
Loading

0 comments on commit 7e207af

Please sign in to comment.