Stop including SkCanvas.h from GrTypesPriv.h

It was too easy to get into circular include chains. Added static
asserts to ensure we keep our quad AA flags in sync. Also, IWYU.

Change-Id: I01aefa264aa56420ab5a46a8ecd9e63c021c79ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280405
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Brian Osman 2020-03-30 15:57:14 -04:00 committed by Skia Commit-Bot
parent 68ccec5880
commit 01e6d17fe8
12 changed files with 24 additions and 7 deletions

View File

@ -7,6 +7,7 @@
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkDeferredDisplayListRecorder.h"
#include "include/core/SkSurfaceCharacterization.h"

View File

@ -8,6 +8,7 @@
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkSurface.h"

View File

@ -14,6 +14,7 @@ class GrBackendFormat;
class GrContextThreadSafeProxyPriv;
struct SkImageInfo;
class SkSurfaceCharacterization;
class SkSurfaceProps;
/**
* Can be used to perform actions related to the generating GrContext in a thread safe manner. The

View File

@ -10,6 +10,7 @@
#include "include/core/SkRefCnt.h"
#include "include/private/GrImageContext.h"
#include "include/private/SkTArray.h"
class GrAuditTrail;
class GrBackendFormat;

View File

@ -9,7 +9,6 @@
#define GrTypesPriv_DEFINED
#include <chrono>
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPath.h"
@ -260,15 +259,17 @@ enum class GrClampType {
* Therefore, APIs that use per-edge AA flags also take a GrAA value so that they can differentiate
* between the regular and tiling use case behaviors. Tiling operations should always pass
* GrAA::kYes while regular options should pass GrAA based on the SkPaint's anti-alias state.
*
* These values are identical to SkCanvas::QuadAAFlags.
*/
enum class GrQuadAAFlags {
kLeft = SkCanvas::kLeft_QuadAAFlag,
kTop = SkCanvas::kTop_QuadAAFlag,
kRight = SkCanvas::kRight_QuadAAFlag,
kBottom = SkCanvas::kBottom_QuadAAFlag,
kLeft = 0b0001,
kTop = 0b0010,
kRight = 0b0100,
kBottom = 0b1000,
kNone = SkCanvas::kNone_QuadAAFlags,
kAll = SkCanvas::kAll_QuadAAFlags
kNone = 0b0000,
kAll = 0b1111,
};
GR_MAKE_BITFIELD_CLASS_OPS(GrQuadAAFlags)

View File

@ -17,6 +17,12 @@
#include "src/gpu/glsl/GrGLSLVarying.h"
#include "src/gpu/glsl/GrGLSLVertexGeoBuilder.h"
static_assert((int)GrQuadAAFlags::kLeft == SkCanvas::kLeft_QuadAAFlag);
static_assert((int)GrQuadAAFlags::kTop == SkCanvas::kTop_QuadAAFlag);
static_assert((int)GrQuadAAFlags::kRight == SkCanvas::kRight_QuadAAFlag);
static_assert((int)GrQuadAAFlags::kBottom == SkCanvas::kBottom_QuadAAFlag);
static_assert((int)GrQuadAAFlags::kNone == SkCanvas::kNone_QuadAAFlags);
static_assert((int)GrQuadAAFlags::kAll == SkCanvas::kAll_QuadAAFlags);
namespace {

View File

@ -18,6 +18,7 @@
class GrDrawOp;
class GrRecordingContext;
class GrRenderTargetContext;
class GrTextBlobCache;
class SkGlyph;
class GrTextBlob;

View File

@ -9,6 +9,7 @@
#include "tools/Resources.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkEncodedImageFormat.h"
#include "include/core/SkImage.h"

View File

@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "src/core/SkAutoPixmapStorage.h"

View File

@ -9,6 +9,7 @@
#if SK_SUPPORT_GPU && defined(SK_VULKAN)
#include "include/core/SkCanvas.h"
#include "include/core/SkImage.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GrContext.h"

View File

@ -20,6 +20,7 @@ class GrContext;
class SkCanvas;
class SkSurface;
class SkSurfaceProps;
class SkString;
namespace sk_app {

View File

@ -7,6 +7,7 @@
#include "tools/viewer/ParticlesSlide.h"
#include "include/core/SkCanvas.h"
#include "modules/particles/include/SkParticleEffect.h"
#include "modules/particles/include/SkParticleSerialization.h"
#include "modules/particles/include/SkReflected.h"