Skip to content

Commit

Permalink
Replace some includes with forward declares in public headers
Browse files Browse the repository at this point in the history
Follow-up from https://skia-review.googlesource.com/c/skia/+/594807

These work as-is with my local Chrome build at least, so that's a good
sign.

Change-Id: Iaf459eae20e749c83fe73a14341979b68e14ab69
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/596076
Commit-Queue: Kevin Lubick <[email protected]>
Owners-Override: Kevin Lubick <[email protected]>
Reviewed-by: Ben Wagner <[email protected]>
  • Loading branch information
kjlubick authored and SkCQ committed Oct 26, 2022
1 parent 5096e8e commit e8a8a3b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions include/effects/SkColorMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

#include "include/core/SkTypes.h"

// TODO(kjlubick, bungeman) replace this include with a forward declare.
#include "include/core/SkImageInfo.h" // IWYU pragma: keep

#include <algorithm>
#include <array>

enum SkYUVColorSpace : int;

class SK_API SkColorMatrix {
public:
constexpr SkColorMatrix() : SkColorMatrix(1, 0, 0, 0, 0,
Expand Down
8 changes: 3 additions & 5 deletions include/utils/SkNWayCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
#include "include/private/SkTDArray.h"
#include "include/utils/SkNoDrawCanvas.h"

// TODO(kjlubick, bungeman) replace these includes with forward declares.
#include "include/core/SkBlendMode.h" // IWYU pragma: keep
#include "include/core/SkCanvas.h" // IWYU pragma: keep
#include "include/core/SkClipOp.h" // IWYU pragma: keep

#include <cstddef>

namespace sktext {
class GlyphRunList;
}

class SkCanvas;
class SkData;
class SkDrawable;
class SkImage;
Expand All @@ -42,6 +38,8 @@ class SkRegion;
class SkShader;
class SkTextBlob;
class SkVertices;
enum class SkBlendMode;
enum class SkClipOp;
struct SkDrawShadowRec;
struct SkPoint;
struct SkRSXform;
Expand Down
4 changes: 1 addition & 3 deletions include/utils/SkPaintFilterCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#include "include/private/SkTDArray.h"
#include "include/utils/SkNWayCanvas.h"

// TODO(kjlubick, bungeman) replace this include with a forward declare.
#include "include/core/SkBlendMode.h" // IWYU pragma: keep

#include <cstddef>

namespace sktext {
Expand All @@ -44,6 +41,7 @@ class SkSurface;
class SkSurfaceProps;
class SkTextBlob;
class SkVertices;
enum class SkBlendMode;
struct SkDrawShadowRec;
struct SkPoint;
struct SkRSXform;
Expand Down
2 changes: 2 additions & 0 deletions src/effects/SkColorMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "include/effects/SkColorMatrix.h"
#include "src/core/SkYUVMath.h"

enum SkYUVColorSpace : int;

SkColorMatrix SkColorMatrix::RGBtoYUV(SkYUVColorSpace cs) {
SkColorMatrix m;
SkColorMatrix_RGB2YUV(cs, m.fMat.data());
Expand Down
2 changes: 2 additions & 0 deletions src/utils/SkNWayCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class SkRRect;
class SkRegion;
class SkTextBlob;
class SkVertices;
enum class SkBlendMode;
enum class SkClipOp;
struct SkDrawShadowRec;

SkNWayCanvas::SkNWayCanvas(int width, int height) : INHERITED(width, height) {}
Expand Down

0 comments on commit e8a8a3b

Please sign in to comment.