header self-sufficiency and idempotency
Change-Id: I4ec74a358e11d85c6eaf1658efd6f1391ee5e387
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223930
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/src/codec/SkFrameHolder.h b/src/codec/SkFrameHolder.h
index 1990acb..c44d2e0 100644
--- a/src/codec/SkFrameHolder.h
+++ b/src/codec/SkFrameHolder.h
@@ -11,6 +11,8 @@
#include "include/codec/SkCodecAnimation.h"
#include "include/core/SkRect.h"
#include "include/core/SkTypes.h"
+#include "include/private/SkEncodedInfo.h"
+#include "include/private/SkNoncopyable.h"
#include "src/codec/SkCodecAnimationPriv.h"
/**
diff --git a/src/codec/SkScalingCodec.h b/src/codec/SkScalingCodec.h
index a53ecf3..799ca38 100644
--- a/src/codec/SkScalingCodec.h
+++ b/src/codec/SkScalingCodec.h
@@ -4,6 +4,8 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+#ifndef SkScalingCodec_DEFINED
+#define SkScalingCodec_DEFINED
#include "include/codec/SkCodec.h"
@@ -34,3 +36,4 @@
typedef SkCodec INHERITED;
};
+#endif // SkScalingCodec_DEFINED
diff --git a/src/core/SkMSAN.h b/src/core/SkMSAN.h
index 35ad785..acde144 100644
--- a/src/core/SkMSAN.h
+++ b/src/core/SkMSAN.h
@@ -10,6 +10,8 @@
#include "include/core/SkTypes.h"
+#include <string.h>
+
// Typically declared in LLVM's msan_interface.h. Easier for us to just re-declare.
extern "C" {
void __msan_check_mem_is_initialized(const volatile void*, size_t);
diff --git a/src/core/SkSafeRange.h b/src/core/SkSafeRange.h
index ef068c2..0d322cc 100644
--- a/src/core/SkSafeRange.h
+++ b/src/core/SkSafeRange.h
@@ -8,6 +8,10 @@
#ifndef SkSafeRange_DEFINED
#define SkSafeRange_DEFINED
+#include "include/core/SkTypes.h"
+
+#include <cstdint>
+
// SkSafeRange always check that a series of operations are in-range.
// This check is sticky, so that if any one operation fails, the object will remember that and
// return false from ok().
diff --git a/src/core/SkSpecialSurface.h b/src/core/SkSpecialSurface.h
index 6628791..75f2392 100644
--- a/src/core/SkSpecialSurface.h
+++ b/src/core/SkSpecialSurface.h
@@ -18,6 +18,7 @@
class GrBackendFormat;
class GrContext;
+class GrRecordingContext;
class SkBitmap;
class SkCanvas;
class SkSpecialImage;
diff --git a/src/core/SkStrikeInterface.h b/src/core/SkStrikeInterface.h
index 59804f6..06a5235 100644
--- a/src/core/SkStrikeInterface.h
+++ b/src/core/SkStrikeInterface.h
@@ -8,12 +8,13 @@
#ifndef SkStrikeInterface_DEFINED
#define SkStrikeInterface_DEFINED
-#include <memory>
-
+#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkTypes.h"
#include "src/core/SkSpan.h"
+#include <memory>
+
class SkDescriptor;
class SkGlyph;
class SkMaskFilter;
diff --git a/src/core/SkWritePixelsRec.h b/src/core/SkWritePixelsRec.h
index 2414d96..4f02c4e 100644
--- a/src/core/SkWritePixelsRec.h
+++ b/src/core/SkWritePixelsRec.h
@@ -9,6 +9,7 @@
#define SkWritePixelsRec_DEFINED
#include "include/core/SkImageInfo.h"
+#include "include/core/SkPixmap.h"
/**
* Helper class to package and trim the parameters passed to writePixels()
diff --git a/src/gpu/GrContextThreadSafeProxyPriv.h b/src/gpu/GrContextThreadSafeProxyPriv.h
index bf09305..9f83e4b 100644
--- a/src/gpu/GrContextThreadSafeProxyPriv.h
+++ b/src/gpu/GrContextThreadSafeProxyPriv.h
@@ -10,6 +10,8 @@
#include "include/gpu/GrContextThreadSafeProxy.h"
+#include "src/gpu/GrCaps.h"
+
/**
* Class that adds methods to GrContextThreadSafeProxy that are only intended for use internal to
* Skia. This class is purely a privileged window into GrContextThreadSafeProxy. It should never
diff --git a/src/gpu/geometry/GrRect.h b/src/gpu/geometry/GrRect.h
index ffded09..9a0bee7 100644
--- a/src/gpu/geometry/GrRect.h
+++ b/src/gpu/geometry/GrRect.h
@@ -8,6 +8,7 @@
#ifndef GrRect_DEFINED
#define GrRect_DEFINED
+#include "include/core/SkMatrix.h"
#include "include/core/SkRect.h"
#include "include/core/SkTypes.h"
#include "include/private/SkTo.h"
diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h
index d7aa866..ddf5e52 100644
--- a/src/gpu/mock/GrMockTexture.h
+++ b/src/gpu/mock/GrMockTexture.h
@@ -11,6 +11,7 @@
#include "include/gpu/GrTexture.h"
#include "include/gpu/mock/GrMockTypes.h"
#include "src/gpu/GrRenderTargetPriv.h"
+#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrTexturePriv.h"
#include "src/gpu/mock/GrMockGpu.h"
diff --git a/src/image/SkReadPixelsRec.h b/src/image/SkReadPixelsRec.h
index 2257e5c..dd88d6c 100644
--- a/src/image/SkReadPixelsRec.h
+++ b/src/image/SkReadPixelsRec.h
@@ -9,6 +9,7 @@
#define SkReadPixelsRec_DEFINED
#include "include/core/SkImageInfo.h"
+#include "include/core/SkPixmap.h"
/**
* Helper class to package and trim the parameters passed to readPixels()
diff --git a/src/image/SkSurface_Gpu.h b/src/image/SkSurface_Gpu.h
index 84299e0..9ac45d5 100644
--- a/src/image/SkSurface_Gpu.h
+++ b/src/image/SkSurface_Gpu.h
@@ -13,6 +13,7 @@
#if SK_SUPPORT_GPU
+class GrBackendFormat;
class SkGpuDevice;
class SkSurface_Gpu : public SkSurface_Base {
diff --git a/src/opts/SkVM_opts.h b/src/opts/SkVM_opts.h
index ce7dcf9..0655960 100644
--- a/src/opts/SkVM_opts.h
+++ b/src/opts/SkVM_opts.h
@@ -10,6 +10,8 @@
#include "src/core/SkVM.h"
+#include "include/private/SkVx.h"
+
namespace SK_OPTS_NS {
inline void eval(const skvm::Program::Instruction insts[], const int ninsts,
diff --git a/src/pdf/SkPDFTag.h b/src/pdf/SkPDFTag.h
index 0b859bb..d0718d3 100644
--- a/src/pdf/SkPDFTag.h
+++ b/src/pdf/SkPDFTag.h
@@ -14,6 +14,7 @@
#include "src/core/SkArenaAlloc.h"
class SkPDFDocument;
+struct SkPDFIndirectReference;
struct SkPDFTagNode;
class SkPDFTagTree {
diff --git a/src/sksl/SkSLCPP.h b/src/sksl/SkSLCPP.h
index 40d876d..11b5b00 100644
--- a/src/sksl/SkSLCPP.h
+++ b/src/sksl/SkSLCPP.h
@@ -12,6 +12,7 @@
#include <cmath>
#include "include/core/SkPoint.h"
+#include "include/core/SkRect.h"
using std::abs;
diff --git a/src/sksl/ir/SkSLEnum.h b/src/sksl/ir/SkSLEnum.h
index 885b17e..a22db36 100644
--- a/src/sksl/ir/SkSLEnum.h
+++ b/src/sksl/ir/SkSLEnum.h
@@ -8,12 +8,18 @@
#ifndef SKSL_ENUM
#define SKSL_ENUM
+#include "src/sksl/ir/SkSLExpression.h"
#include "src/sksl/ir/SkSLProgramElement.h"
+#include "src/sksl/ir/SkSLSymbolTable.h"
+#include "src/sksl/ir/SkSLVariable.h"
#include <algorithm>
+#include <vector>
namespace SkSL {
+struct Symbol;
+
struct Enum : public ProgramElement {
Enum(int offset, StringFragment typeName, std::shared_ptr<SymbolTable> symbols)
: INHERITED(offset, kEnum_Kind)
diff --git a/src/sksl/ir/SkSLPostfixExpression.h b/src/sksl/ir/SkSLPostfixExpression.h
index 2fcb202..c11e208 100644
--- a/src/sksl/ir/SkSLPostfixExpression.h
+++ b/src/sksl/ir/SkSLPostfixExpression.h
@@ -8,6 +8,7 @@
#ifndef SKSL_POSTFIXEXPRESSION
#define SKSL_POSTFIXEXPRESSION
+#include "src/sksl/SkSLCompiler.h"
#include "src/sksl/SkSLLexer.h"
#include "src/sksl/ir/SkSLExpression.h"
diff --git a/src/sksl/ir/SkSLProgramElement.h b/src/sksl/ir/SkSLProgramElement.h
index 84b764e..4caaebe 100644
--- a/src/sksl/ir/SkSLProgramElement.h
+++ b/src/sksl/ir/SkSLProgramElement.h
@@ -10,6 +10,8 @@
#include "src/sksl/ir/SkSLIRNode.h"
+#include <memory>
+
namespace SkSL {
/**
diff --git a/src/sksl/ir/SkSLSwitchStatement.h b/src/sksl/ir/SkSLSwitchStatement.h
index 3f6a7a0..0777c5c 100644
--- a/src/sksl/ir/SkSLSwitchStatement.h
+++ b/src/sksl/ir/SkSLSwitchStatement.h
@@ -13,6 +13,8 @@
namespace SkSL {
+class SymbolTable;
+
/**
* A 'switch' statement.
*/
diff --git a/src/sksl/lex/DFAState.h b/src/sksl/lex/DFAState.h
index e600637..141078a 100644
--- a/src/sksl/lex/DFAState.h
+++ b/src/sksl/lex/DFAState.h
@@ -10,6 +10,9 @@
#include "src/sksl/lex/LexUtil.h"
+#include <vector>
+#include <string>
+
struct DFAState {
struct Label {
std::vector<int> fStates;
diff --git a/src/sksl/lex/NFAtoDFA.h b/src/sksl/lex/NFAtoDFA.h
index d566132..3c90380 100644
--- a/src/sksl/lex/NFAtoDFA.h
+++ b/src/sksl/lex/NFAtoDFA.h
@@ -4,6 +4,8 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+#ifndef NFAtoDFA_DEFINED
+#define NFAtoDFA_DEFINED
#include "src/sksl/lex/DFA.h"
#include "src/sksl/lex/DFAState.h"
@@ -163,3 +165,4 @@
std::vector<int> fCharMappings;
std::vector<int> fAccepts;
};
+#endif // NFAtoDFA_DEFINED
diff --git a/src/utils/SkCallableTraits.h b/src/utils/SkCallableTraits.h
index 7df0124..003db21 100644
--- a/src/utils/SkCallableTraits.h
+++ b/src/utils/SkCallableTraits.h
@@ -9,6 +9,7 @@
#define SkCallableTraits_DEFINED
#include <type_traits>
+#include <tuple>
template <typename R, typename... Args> struct sk_base_callable_traits {
using return_type = R;