diff --git a/bench/GlyphQuadFillBench.cpp b/bench/GlyphQuadFillBench.cpp index 760a53e3f7..363a0c45e9 100644 --- a/bench/GlyphQuadFillBench.cpp +++ b/bench/GlyphQuadFillBench.cpp @@ -6,6 +6,7 @@ */ #include "bench/Benchmark.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkFont.h" #include "include/core/SkTypeface.h" #include "include/gpu/GrDirectContext.h" diff --git a/gm/BUILD.bazel b/gm/BUILD.bazel index b044d8d2aa..51a6ffe3ef 100644 --- a/gm/BUILD.bazel +++ b/gm/BUILD.bazel @@ -1922,6 +1922,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":gm_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkPoint_hdr", "//include/core:SkRect_hdr", "//include/private:SkColorData_hdr", @@ -3224,6 +3225,7 @@ generated_cc_atom( ":gm_hdr", "//include/core:SkBlender_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkCustomMesh_hdr", "//include/core:SkSurface_hdr", "//include/effects:SkGradientShader_hdr", @@ -4659,6 +4661,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":gm_hdr", + "//include/core:SkColorSpace_hdr", "//include/effects:SkGradientShader_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/core:SkCanvasPriv_hdr", @@ -6597,6 +6600,7 @@ generated_cc_atom( "//include/core:SkTypes_hdr", "//include/effects:SkDashPathEffect_hdr", "//include/effects:SkGradientShader_hdr", + "//include/private:SkImageInfoPriv_hdr", "//include/private:SkTPin_hdr", "//src/core:SkColorSpaceXformSteps_hdr", ], diff --git a/gm/clear_swizzle.cpp b/gm/clear_swizzle.cpp index 5e7e69f209..2564a073aa 100644 --- a/gm/clear_swizzle.cpp +++ b/gm/clear_swizzle.cpp @@ -6,6 +6,8 @@ */ #include "gm/gm.h" + +#include "include/core/SkColorSpace.h" #include "include/core/SkPoint.h" #include "include/core/SkRect.h" #include "include/private/SkColorData.h" diff --git a/gm/custommesh.cpp b/gm/custommesh.cpp index d11c75b64d..62229793f6 100644 --- a/gm/custommesh.cpp +++ b/gm/custommesh.cpp @@ -8,6 +8,7 @@ #include "gm/gm.h" #include "include/core/SkBlender.h" #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkCustomMesh.h" #include "include/core/SkSurface.h" #include "include/effects/SkGradientShader.h" diff --git a/gm/gpu_blur_utils.cpp b/gm/gpu_blur_utils.cpp index 9917455a8c..de77519c24 100644 --- a/gm/gpu_blur_utils.cpp +++ b/gm/gpu_blur_utils.cpp @@ -7,6 +7,7 @@ #include "gm/gm.h" +#include "include/core/SkColorSpace.h" #include "include/effects/SkGradientShader.h" #include "include/gpu/GrRecordingContext.h" #include "src/core/SkCanvasPriv.h" diff --git a/gm/p3.cpp b/gm/p3.cpp index 7aecf37c7e..9b78a970cd 100644 --- a/gm/p3.cpp +++ b/gm/p3.cpp @@ -24,6 +24,7 @@ #include "include/core/SkTypes.h" #include "include/effects/SkDashPathEffect.h" #include "include/effects/SkGradientShader.h" +#include "include/private/SkImageInfoPriv.h" #include "include/private/SkTPin.h" #include "src/core/SkColorSpaceXformSteps.h" diff --git a/gn/gpu.gni b/gn/gpu.gni index b2acbfb88f..6660d859a7 100644 --- a/gn/gpu.gni +++ b/gn/gpu.gni @@ -111,6 +111,7 @@ skia_gpu_sources = [ "$_src/gpu/GrHashMapWithCache.h", "$_src/gpu/GrImageContext.cpp", "$_src/gpu/GrImageContextPriv.h", + "$_src/gpu/GrImageInfo.cpp", "$_src/gpu/GrImageInfo.h", "$_src/gpu/GrManagedResource.cpp", "$_src/gpu/GrManagedResource.h", diff --git a/include/core/BUILD.bazel b/include/core/BUILD.bazel index 4ad55d827b..3796a081be 100644 --- a/include/core/BUILD.bazel +++ b/include/core/BUILD.bazel @@ -933,10 +933,10 @@ generated_cc_atom( generated_cc_atom( name = "SkCustomMesh_hdr", hdrs = ["SkCustomMesh.h"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ - ":SkColorSpace_hdr", - ":SkImageInfo_hdr", + ":SkAlphaType_hdr", ":SkRect_hdr", ":SkRefCnt_hdr", ":SkSpan_hdr", diff --git a/include/core/SkCustomMesh.h b/include/core/SkCustomMesh.h index f9bddf3385..af647365ff 100644 --- a/include/core/SkCustomMesh.h +++ b/include/core/SkCustomMesh.h @@ -11,15 +11,17 @@ #include "include/core/SkTypes.h" #ifdef SK_ENABLE_SKSL -#include "include/core/SkColorSpace.h" -#include "include/core/SkImageInfo.h" +#include "include/core/SkAlphaType.h" #include "include/core/SkRect.h" #include "include/core/SkRefCnt.h" #include "include/core/SkSpan.h" #include "include/core/SkString.h" +#include #include +class SkColorSpace; + namespace SkSL { struct Program; } /** @@ -111,13 +113,24 @@ public: * @param at The alpha type of the color produced by 'fs'. Ignored if 'fs's main() * function does not have a color out param. Cannot be kUnknown. */ + static Result Make(SkSpan attributes, + size_t vertexStride, + SkSpan varyings, + const SkString& vs, + const SkString& fs); static Result Make(SkSpan attributes, size_t vertexStride, SkSpan varyings, const SkString& vs, const SkString& fs, - sk_sp cs = SkColorSpace::MakeSRGB(), - SkAlphaType at = kPremul_SkAlphaType); + sk_sp cs); + static Result Make(SkSpan attributes, + size_t vertexStride, + SkSpan varyings, + const SkString& vs, + const SkString& fs, + sk_sp cs, + SkAlphaType at); SkSpan attributes() const { return SkMakeSpan(fAttributes); } diff --git a/include/core/SkImage.h b/include/core/SkImage.h index d06d715f50..2cf723bac2 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -401,12 +401,21 @@ public: @param colorSpace range of colors; may be nullptr @return created SkImage, or nullptr */ + static sk_sp MakeFromAdoptedTexture(GrRecordingContext* context, + const GrBackendTexture& backendTexture, + GrSurfaceOrigin textureOrigin, + SkColorType colorType); static sk_sp MakeFromAdoptedTexture(GrRecordingContext* context, const GrBackendTexture& backendTexture, GrSurfaceOrigin textureOrigin, SkColorType colorType, - SkAlphaType alphaType = kPremul_SkAlphaType, - sk_sp colorSpace = nullptr); + SkAlphaType alphaType); + static sk_sp MakeFromAdoptedTexture(GrRecordingContext* context, + const GrBackendTexture& backendTexture, + GrSurfaceOrigin textureOrigin, + SkColorType colorType, + SkAlphaType alphaType, + sk_sp colorSpace); /** Creates an SkImage from YUV[A] planar textures. This requires that the textures stay valid for the lifetime of the image. The ReleaseContext can be used to know when it is safe to diff --git a/src/core/BUILD.bazel b/src/core/BUILD.bazel index b2d838b2eb..9aada3a122 100644 --- a/src/core/BUILD.bazel +++ b/src/core/BUILD.bazel @@ -1186,24 +1186,28 @@ generated_cc_atom( generated_cc_atom( name = "SkColorSpaceXformSteps_hdr", hdrs = ["SkColorSpaceXformSteps.h"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ - ":SkVM_fwd_hdr", - "//include/core:SkColorSpace_hdr", - "//include/core:SkImageInfo_hdr", - "//include/private:SkImageInfoPriv_hdr", + ":SkVM_hdr", + "//include/core:SkAlphaType_hdr", + "//include/third_party/skcms:skcms_hdr", ], ) generated_cc_atom( name = "SkColorSpaceXformSteps_src", srcs = ["SkColorSpaceXformSteps.cpp"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":SkColorSpacePriv_hdr", ":SkColorSpaceXformSteps_hdr", ":SkRasterPipeline_hdr", ":SkVM_hdr", + "//include/core:SkColorSpace_hdr", + "//include/core:SkTypes_hdr", + "//include/private:SkFloatingPoint_hdr", "//include/third_party/skcms:skcms_hdr", ], ) @@ -2245,6 +2249,7 @@ generated_cc_atom( ":SkGpuBlurUtils_hdr", ":SkMathPriv_hdr", "//include/core:SkBitmap_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkRect_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/gpu:GrCaps_hdr", @@ -4563,6 +4568,7 @@ generated_cc_atom( ":SkSpecialSurface_hdr", ":SkSurfacePriv_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkMallocPixelRef_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/gpu:GrRecordingContextPriv_hdr", @@ -5569,16 +5575,25 @@ generated_cc_atom( generated_cc_atom( name = "SkCustomMesh_src", srcs = ["SkCustomMesh.cpp"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":SkCustomMeshPriv_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkCustomMesh_hdr", - "//src/gpu:GrShaderCaps_hdr", + "//include/core:SkMath_hdr", + "//include/private:SkOpts_spi_hdr", + "//include/private:SkSLProgramElement_hdr", + "//include/private:SkSLProgramKind_hdr", + "//src/sksl:SkSLAnalysis_hdr", + "//src/sksl:SkSLBuiltinTypes_hdr", "//src/sksl:SkSLCompiler_hdr", "//src/sksl:SkSLSharedCompiler_hdr", + "//src/sksl/ir:SkSLFunctionDeclaration_hdr", "//src/sksl/ir:SkSLFunctionDefinition_hdr", "//src/sksl/ir:SkSLProgram_hdr", - "//src/sksl/ir:SkSLVarDeclarations_hdr", + "//src/sksl/ir:SkSLType_hdr", + "//src/sksl/ir:SkSLVariable_hdr", ], ) diff --git a/src/core/SkColorSpaceXformSteps.cpp b/src/core/SkColorSpaceXformSteps.cpp index 501f8b4e34..f61b0f266e 100644 --- a/src/core/SkColorSpaceXformSteps.cpp +++ b/src/core/SkColorSpaceXformSteps.cpp @@ -5,9 +5,13 @@ * found in the LICENSE file. */ +#include "src/core/SkColorSpaceXformSteps.h" + +#include "include/core/SkColorSpace.h" +#include "include/core/SkTypes.h" +#include "include/private/SkFloatingPoint.h" #include "include/third_party/skcms/skcms.h" #include "src/core/SkColorSpacePriv.h" -#include "src/core/SkColorSpaceXformSteps.h" #include "src/core/SkRasterPipeline.h" #include "src/core/SkVM.h" diff --git a/src/core/SkColorSpaceXformSteps.h b/src/core/SkColorSpaceXformSteps.h index 03c9aab638..e9d5d74eb9 100644 --- a/src/core/SkColorSpaceXformSteps.h +++ b/src/core/SkColorSpaceXformSteps.h @@ -8,11 +8,12 @@ #ifndef SkColorSpaceXformSteps_DEFINED #define SkColorSpaceXformSteps_DEFINED -#include "include/core/SkColorSpace.h" -#include "include/core/SkImageInfo.h" -#include "include/private/SkImageInfoPriv.h" -#include "src/core/SkVM_fwd.h" +#include "include/core/SkAlphaType.h" +#include "include/third_party/skcms/skcms.h" +#include "src/core/SkVM.h" +#include +class SkColorSpace; class SkRasterPipeline; struct SkColorSpaceXformSteps { diff --git a/src/core/SkCustomMesh.cpp b/src/core/SkCustomMesh.cpp index 3920ccd24e..68439828a2 100644 --- a/src/core/SkCustomMesh.cpp +++ b/src/core/SkCustomMesh.cpp @@ -8,16 +8,27 @@ #include "include/core/SkCustomMesh.h" #ifdef SK_ENABLE_SKSL - +#include "include/core/SkColorSpace.h" +#include "include/core/SkMath.h" +#include "include/private/SkOpts_spi.h" +#include "include/private/SkSLProgramElement.h" +#include "include/private/SkSLProgramKind.h" #include "src/core/SkCustomMeshPriv.h" -#include "src/gpu/GrShaderCaps.h" +#include "src/sksl/SkSLAnalysis.h" +#include "src/sksl/SkSLBuiltinTypes.h" #include "src/sksl/SkSLCompiler.h" #include "src/sksl/SkSLSharedCompiler.h" +#include "src/sksl/ir/SkSLFunctionDeclaration.h" #include "src/sksl/ir/SkSLFunctionDefinition.h" #include "src/sksl/ir/SkSLProgram.h" -#include "src/sksl/ir/SkSLVarDeclarations.h" +#include "src/sksl/ir/SkSLType.h" +#include "src/sksl/ir/SkSLVariable.h" #include +#include +#include +#include +#include using Attribute = SkCustomMeshSpecification::Attribute; using Varying = SkCustomMeshSpecification::Varying; @@ -170,6 +181,27 @@ check_vertex_offsets_and_stride(SkSpan attributes, RETURN_SUCCESS; } +SkCustomMeshSpecification::Result SkCustomMeshSpecification::Make( + SkSpan attributes, + size_t vertexStride, + SkSpan varyings, + const SkString& vs, + const SkString& fs) { + return Make(attributes, vertexStride, varyings, vs, fs, + SkColorSpace::MakeSRGB(), kPremul_SkAlphaType); +} + +SkCustomMeshSpecification::Result SkCustomMeshSpecification::Make( + SkSpan attributes, + size_t vertexStride, + SkSpan varyings, + const SkString& vs, + const SkString& fs, + sk_sp cs) { + return Make(attributes, vertexStride, varyings, vs, fs, + std::move(cs), kPremul_SkAlphaType); +} + SkCustomMeshSpecification::Result SkCustomMeshSpecification::Make( SkSpan attributes, size_t vertexStride, diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp index d800810c6d..26e528d5b0 100644 --- a/src/core/SkGpuBlurUtils.cpp +++ b/src/core/SkGpuBlurUtils.cpp @@ -12,6 +12,7 @@ #include "src/core/SkMathPriv.h" #if SK_SUPPORT_GPU +#include "include/core/SkColorSpace.h" #include "include/gpu/GrRecordingContext.h" #include "src/gpu/GrCaps.h" #include "src/gpu/GrRecordingContextPriv.h" diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp index 3aed94ca27..0b5e9b8fd2 100644 --- a/src/core/SkSpecialSurface.cpp +++ b/src/core/SkSpecialSurface.cpp @@ -10,6 +10,7 @@ #include #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "src/core/SkSpecialImage.h" #include "src/core/SkSurfacePriv.h" diff --git a/src/gpu/BUILD.bazel b/src/gpu/BUILD.bazel index 7c260cf067..843fbc79a5 100644 --- a/src/gpu/BUILD.bazel +++ b/src/gpu/BUILD.bazel @@ -45,6 +45,7 @@ cc_library( ":GrGpuResource_src", ":GrGpu_src", ":GrImageContext_src", + ":GrImageInfo_src", ":GrManagedResource_src", ":GrMemoryPool_src", ":GrMeshDrawTarget_src", @@ -401,6 +402,7 @@ generated_cc_atom( ":GrSurfaceProxyView_hdr", ":SurfaceContext_hdr", ":SurfaceFillContext_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrRecordingContext_hdr", ], ) @@ -636,6 +638,7 @@ generated_cc_atom( ":GrTextureProxyPriv_hdr", ":GrTexture_hdr", ":SkGr_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/core:SkMessageBus_hdr", @@ -703,6 +706,7 @@ generated_cc_atom( ":GrUtil_hdr", ":SkGr_hdr", "//include/core:SkBitmap_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkPaint_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", @@ -830,21 +834,25 @@ generated_cc_atom( generated_cc_atom( name = "GrColorInfo_hdr", hdrs = ["GrColorInfo.h"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":GrColorSpaceXform_hdr", - "//include/core:SkColorSpace_hdr", + "//include/core:SkAlphaType_hdr", "//include/core:SkRefCnt_hdr", - "//include/gpu:GrTypes_hdr", + "//include/private:GrTypesPriv_hdr", ], ) generated_cc_atom( name = "GrColorInfo_src", srcs = ["GrColorInfo.cpp"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":GrColorInfo_hdr", + "//include/core:SkColorSpace_hdr", + "//include/core:SkImageInfo_hdr", "//src/core:SkColorSpacePriv_hdr", ], ) @@ -852,11 +860,14 @@ generated_cc_atom( generated_cc_atom( name = "GrColorSpaceXform_hdr", hdrs = ["GrColorSpaceXform.h"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":GrFragmentProcessor_hdr", + "//include/core:SkAlphaType_hdr", + "//include/core:SkColor_hdr", "//include/core:SkRefCnt_hdr", - "//src/core:SkColorSpacePriv_hdr", + "//include/private:SkColorData_hdr", "//src/core:SkColorSpaceXformSteps_hdr", ], ) @@ -864,12 +875,15 @@ generated_cc_atom( generated_cc_atom( name = "GrColorSpaceXform_src", srcs = ["GrColorSpaceXform.cpp"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":GrColorInfo_hdr", ":GrColorSpaceXform_hdr", + ":GrProcessor_hdr", ":KeyBuilder_hdr", - "//include/core:SkColorSpace_hdr", + "//include/core:SkString_hdr", + "//include/third_party/skcms:skcms_hdr", "//src/core:SkColorSpacePriv_hdr", "//src/gpu/glsl:GrGLSLColorSpaceXformHelper_hdr", "//src/gpu/glsl:GrGLSLFragmentShaderBuilder_hdr", @@ -1025,6 +1039,7 @@ generated_cc_atom( ":GrImageInfo_hdr", ":GrPixmap_hdr", ":Swizzle_hdr", + "//include/core:SkColorSpace_hdr", "//include/private:SkTPin_hdr", "//include/third_party/skcms:skcms_hdr", "//src/core:SkColorSpaceXformSteps_hdr", @@ -1680,14 +1695,29 @@ generated_cc_atom( generated_cc_atom( name = "GrImageInfo_hdr", hdrs = ["GrImageInfo.h"], + enforce_iwyu = True, visibility = ["//:__subpackages__"], deps = [ ":GrColorInfo_hdr", - "//include/core:SkImageInfo_hdr", + "//include/core:SkAlphaType_hdr", + "//include/core:SkRefCnt_hdr", + "//include/core:SkSize_hdr", "//include/private:GrTypesPriv_hdr", ], ) +generated_cc_atom( + name = "GrImageInfo_src", + srcs = ["GrImageInfo.cpp"], + enforce_iwyu = True, + visibility = ["//:__subpackages__"], + deps = [ + ":GrImageInfo_hdr", + "//include/core:SkColorSpace_hdr", + "//include/core:SkImageInfo_hdr", + ], +) + generated_cc_atom( name = "GrManagedResource_hdr", hdrs = ["GrManagedResource.h"], @@ -1834,6 +1864,7 @@ generated_cc_atom( ":GrProgramInfo_hdr", ":GrResourceProvider_hdr", ":GrTexture_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/core:SkConvertPixels_hdr", ], @@ -2211,6 +2242,7 @@ generated_cc_atom( ":GrRecordingContextPriv_hdr", ":GrRenderTargetProxy_hdr", ":GrSurfaceProxyView_hdr", + "//include/core:SkColorSpace_hdr", "//src/gpu/v1:Device_v1_hdr", "//src/gpu/v1:SurfaceDrawContext_v1_hdr", "//src/gpu/v1:SurfaceFillContext_v1_hdr", @@ -2538,6 +2570,7 @@ generated_cc_atom( ":GrTexture_hdr", ":ResourceKey_hdr", ":SkGr_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrBackendSemaphore_hdr", "//include/private:SingleOwner_hdr", "//src/core:SkConvertPixels_hdr", @@ -2867,6 +2900,7 @@ generated_cc_atom( ":GrTextureRenderTargetProxy_hdr", ":GrTexture_hdr", ":SurfaceFillContext_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/core:SkMathPriv_hdr", @@ -2941,6 +2975,7 @@ generated_cc_atom( ":GrProcessorUnitTest_hdr", ":GrStyle_hdr", ":GrTestUtils_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkMatrix_hdr", "//include/core:SkPathBuilder_hdr", "//include/core:SkRRect_hdr", @@ -3473,6 +3508,7 @@ generated_cc_atom( ":SkGr_hdr", ":SurfaceContext_hdr", ":SurfaceFillContext_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/core:SkAutoPixmapStorage_hdr", diff --git a/src/gpu/BaseDevice.cpp b/src/gpu/BaseDevice.cpp index 90f422251d..7c7d573649 100644 --- a/src/gpu/BaseDevice.cpp +++ b/src/gpu/BaseDevice.cpp @@ -7,6 +7,7 @@ #include "src/gpu/BaseDevice.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrRecordingContext.h" #include "src/gpu/GrProxyProvider.h" #include "src/gpu/GrRecordingContextPriv.h" diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp index 3fd9dbf3e0..4855f70d23 100644 --- a/src/gpu/GrBackendTextureImageGenerator.cpp +++ b/src/gpu/GrBackendTextureImageGenerator.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/GrRecordingContext.h" #include "src/core/SkMessageBus.h" diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index 0ec54fff96..5d6317ef66 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -10,6 +10,7 @@ #if SK_GPU_V1 #include "include/core/SkBitmap.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkPaint.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/GrRecordingContext.h" diff --git a/src/gpu/GrColorInfo.cpp b/src/gpu/GrColorInfo.cpp index 22bdc98678..e108a7d703 100644 --- a/src/gpu/GrColorInfo.cpp +++ b/src/gpu/GrColorInfo.cpp @@ -7,8 +7,12 @@ #include "src/gpu/GrColorInfo.h" +#include "include/core/SkColorSpace.h" +#include "include/core/SkImageInfo.h" #include "src/core/SkColorSpacePriv.h" +#include + GrColorInfo::GrColorInfo( GrColorType colorType, SkAlphaType alphaType, sk_sp colorSpace) : fColorSpace(std::move(colorSpace)), fColorType(colorType), fAlphaType(alphaType) { @@ -22,5 +26,24 @@ GrColorInfo::GrColorInfo(const SkColorInfo& ci) ci.alphaType(), ci.refColorSpace()) {} +GrColorInfo::GrColorInfo() = default; GrColorInfo::GrColorInfo(const GrColorInfo&) = default; GrColorInfo& GrColorInfo::operator=(const GrColorInfo&) = default; +GrColorInfo::~GrColorInfo() = default; + +bool GrColorInfo::operator==(const GrColorInfo& that) const { + return fColorType == that.fColorType && + fAlphaType == that.fAlphaType && + SkColorSpace::Equals(fColorSpace.get(), that.fColorSpace.get()); +} + +GrColorInfo GrColorInfo::makeColorType(GrColorType ct) const { + return GrColorInfo(ct, fAlphaType, this->refColorSpace()); +} + +bool GrColorInfo::isLinearlyBlended() const { + return fColorSpace && fColorSpace->gammaIsLinear(); +} + +SkColorSpace* GrColorInfo::colorSpace() const { return fColorSpace.get(); } +sk_sp GrColorInfo::refColorSpace() const { return fColorSpace; } diff --git a/src/gpu/GrColorInfo.h b/src/gpu/GrColorInfo.h index 0a8aaa0060..7ee0410f15 100644 --- a/src/gpu/GrColorInfo.h +++ b/src/gpu/GrColorInfo.h @@ -8,37 +8,34 @@ #ifndef GrColorInfo_DEFINED #define GrColorInfo_DEFINED -#include "include/core/SkColorSpace.h" +#include "include/core/SkAlphaType.h" #include "include/core/SkRefCnt.h" -#include "include/gpu/GrTypes.h" +#include "include/private/GrTypesPriv.h" #include "src/gpu/GrColorSpaceXform.h" +class SkColorInfo; +class SkColorSpace; /** * All the info needed to interpret a color: Color type + alpha type + color space. Also caches * the GrColorSpaceXform from sRGB. */ class GrColorInfo { public: - GrColorInfo() = default; + GrColorInfo(); GrColorInfo(const GrColorInfo&); GrColorInfo& operator=(const GrColorInfo&); GrColorInfo(GrColorType, SkAlphaType, sk_sp); /* implicit */ GrColorInfo(const SkColorInfo&); + ~GrColorInfo(); - bool operator==(const GrColorInfo& that) const { - return fColorType == that.fColorType && - fAlphaType == that.fAlphaType && - SkColorSpace::Equals(fColorSpace.get(), that.fColorSpace.get()); - } + bool operator==(const GrColorInfo& that) const; bool operator!=(const GrColorInfo& that) const { return !(*this == that); } - GrColorInfo makeColorType(GrColorType ct) const { - return GrColorInfo(ct, fAlphaType, this->refColorSpace()); - } + GrColorInfo makeColorType(GrColorType ct) const; - bool isLinearlyBlended() const { return fColorSpace && fColorSpace->gammaIsLinear(); } + bool isLinearlyBlended() const; - SkColorSpace* colorSpace() const { return fColorSpace.get(); } - sk_sp refColorSpace() const { return fColorSpace; } + SkColorSpace* colorSpace() const; + sk_sp refColorSpace() const; GrColorSpaceXform* colorSpaceXformFromSRGB() const { return fColorXformFromSRGB.get(); } sk_sp refColorSpaceXformFromSRGB() const { return fColorXformFromSRGB; } diff --git a/src/gpu/GrColorSpaceXform.cpp b/src/gpu/GrColorSpaceXform.cpp index 72d55c58ef..7d00ee3ebf 100644 --- a/src/gpu/GrColorSpaceXform.cpp +++ b/src/gpu/GrColorSpaceXform.cpp @@ -7,12 +7,20 @@ #include "src/gpu/GrColorSpaceXform.h" -#include "include/core/SkColorSpace.h" +#include "include/core/SkString.h" +#include "include/third_party/skcms/skcms.h" #include "src/core/SkColorSpacePriv.h" #include "src/gpu/GrColorInfo.h" +#include "src/gpu/GrProcessor.h" #include "src/gpu/KeyBuilder.h" #include "src/gpu/glsl/GrGLSLColorSpaceXformHelper.h" #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" +#include +#include + +class GrGLSLProgramDataManager; +class GrGLSLUniformHandler; +struct GrShaderCaps; sk_sp GrColorSpaceXform::Make(SkColorSpace* src, SkAlphaType srcAT, SkColorSpace* dst, SkAlphaType dstAT) { @@ -27,6 +35,22 @@ sk_sp GrColorSpaceXform::Make(const GrColorInfo& srcInfo, dstInfo.colorSpace(), dstInfo.alphaType()); } +uint32_t GrColorSpaceXform::XformKey(const GrColorSpaceXform* xform) { + // Code generation depends on which steps we apply, + // and the kinds of transfer functions (if we're applying those). + if (!xform) { return 0; } + + const SkColorSpaceXformSteps& steps(xform->fSteps); + uint32_t key = steps.flags.mask(); + if (steps.flags.linearize) { + key |= classify_transfer_fn(steps.srcTF) << 8; + } + if (steps.flags.encode) { + key |= classify_transfer_fn(steps.dstTFInv) << 16; + } + return key; +} + bool GrColorSpaceXform::Equals(const GrColorSpaceXform* a, const GrColorSpaceXform* b) { if (a == b) { return true; diff --git a/src/gpu/GrColorSpaceXform.h b/src/gpu/GrColorSpaceXform.h index 6f09299390..ab0ba5a559 100644 --- a/src/gpu/GrColorSpaceXform.h +++ b/src/gpu/GrColorSpaceXform.h @@ -8,13 +8,21 @@ #ifndef GrColorSpaceXform_DEFINED #define GrColorSpaceXform_DEFINED +#include "include/core/SkAlphaType.h" +#include "include/core/SkColor.h" #include "include/core/SkRefCnt.h" -#include "src/core/SkColorSpacePriv.h" +#include "include/private/SkColorData.h" #include "src/core/SkColorSpaceXformSteps.h" #include "src/gpu/GrFragmentProcessor.h" +#include +#include + class GrColorInfo; class SkColorSpace; +struct GrShaderCaps; + +namespace skgpu { class KeyBuilder; } /** * Represents a color space transformation @@ -34,21 +42,7 @@ public: * GrFragmentProcessor::addToKey() must call this and include the returned value in its * computed key. */ - static uint32_t XformKey(const GrColorSpaceXform* xform) { - // Code generation depends on which steps we apply, - // and the kinds of transfer functions (if we're applying those). - if (!xform) { return 0; } - - const SkColorSpaceXformSteps& steps(xform->fSteps); - uint32_t key = steps.flags.mask(); - if (steps.flags.linearize) { - key |= classify_transfer_fn(steps.srcTF) << 8; - } - if (steps.flags.encode) { - key |= classify_transfer_fn(steps.dstTFInv) << 16; - } - return key; - } + static uint32_t XformKey(const GrColorSpaceXform* xform); static bool Equals(const GrColorSpaceXform* a, const GrColorSpaceXform* b); diff --git a/src/gpu/GrDataUtils.cpp b/src/gpu/GrDataUtils.cpp index af836eac0f..a30434bf5e 100644 --- a/src/gpu/GrDataUtils.cpp +++ b/src/gpu/GrDataUtils.cpp @@ -7,6 +7,7 @@ #include "src/gpu/GrDataUtils.h" +#include "include/core/SkColorSpace.h" #include "include/private/SkTPin.h" #include "include/third_party/skcms/skcms.h" #include "src/core/SkColorSpaceXformSteps.h" diff --git a/src/gpu/GrImageInfo.cpp b/src/gpu/GrImageInfo.cpp new file mode 100644 index 0000000000..7ddc1d2ecc --- /dev/null +++ b/src/gpu/GrImageInfo.cpp @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "src/gpu/GrImageInfo.h" + +#include "include/core/SkColorSpace.h" +#include "include/core/SkImageInfo.h" + +#include + +GrImageInfo::GrImageInfo() = default; + +GrImageInfo::GrImageInfo(const SkImageInfo& info) + : fColorInfo(info.colorInfo()), fDimensions(info.dimensions()) {} + +GrImageInfo::GrImageInfo(GrColorType ct, SkAlphaType at, sk_sp cs, int w, int h) + : fColorInfo(ct, at, std::move(cs)), fDimensions{w,h} {} + +GrImageInfo::GrImageInfo(GrColorType ct, SkAlphaType at, sk_sp cs, + const SkISize& dimensions) + : fColorInfo(ct, at, std::move(cs)), fDimensions(dimensions) {} + +GrImageInfo::GrImageInfo(const GrColorInfo& info, const SkISize& dimensions) + : fColorInfo(info), fDimensions(dimensions) {} + +GrImageInfo::GrImageInfo(GrColorInfo&& info, const SkISize& dimensions) + : fColorInfo(std::move(info)), fDimensions(dimensions) {} + +GrImageInfo::GrImageInfo(const GrImageInfo&) = default; +GrImageInfo::GrImageInfo(GrImageInfo&&) = default; +GrImageInfo& GrImageInfo::operator=(const GrImageInfo&) = default; +GrImageInfo& GrImageInfo::operator=(GrImageInfo&&) = default; + +GrImageInfo GrImageInfo::makeColorType(GrColorType ct) const { + return {this->colorInfo().makeColorType(ct), this->dimensions()}; +} + +GrImageInfo GrImageInfo::makeAlphaType(SkAlphaType at) const { + return {this->colorType(), at, this->refColorSpace(), this->width(), this->height()}; +} + +GrImageInfo GrImageInfo::makeColorSpace(sk_sp cs) const { + return {this->colorType(), this->alphaType(), std::move(cs), this->width(), this->height()}; +} + +GrImageInfo GrImageInfo::makeDimensions(SkISize dimensions) const { + return {this->colorType(), this->alphaType(), this->refColorSpace(), dimensions}; +} + +GrImageInfo GrImageInfo::makeWH(int width, int height) const { + return {this->colorType(), this->alphaType(), this->refColorSpace(), width, height}; +} + +sk_sp GrImageInfo::refColorSpace() const { return fColorInfo.refColorSpace(); } diff --git a/src/gpu/GrImageInfo.h b/src/gpu/GrImageInfo.h index 8acea12a76..cb9c3662a2 100644 --- a/src/gpu/GrImageInfo.h +++ b/src/gpu/GrImageInfo.h @@ -8,53 +8,36 @@ #ifndef GrImageInfo_DEFINED #define GrImageInfo_DEFINED -#include "include/core/SkImageInfo.h" +#include "include/core/SkAlphaType.h" +#include "include/core/SkRefCnt.h" +#include "include/core/SkSize.h" #include "include/private/GrTypesPriv.h" #include "src/gpu/GrColorInfo.h" +#include + +class SkColorSpace; +struct SkImageInfo; + class GrImageInfo { public: - GrImageInfo() = default; + GrImageInfo(); + GrImageInfo(const SkImageInfo& info); + GrImageInfo(GrColorType ct, SkAlphaType at, sk_sp cs, int w, int h); + GrImageInfo(GrColorType ct, SkAlphaType at, sk_sp cs, const SkISize& dimensions); + GrImageInfo(const GrColorInfo& info, const SkISize& dimensions); + GrImageInfo(GrColorInfo&& info, const SkISize& dimensions); - /* implicit */ GrImageInfo(const SkImageInfo& info) - : fColorInfo(info.colorInfo()), fDimensions(info.dimensions()) {} + GrImageInfo(const GrImageInfo&); + GrImageInfo(GrImageInfo&&); + GrImageInfo& operator=(const GrImageInfo&); + GrImageInfo& operator=(GrImageInfo&&); - GrImageInfo(GrColorType ct, SkAlphaType at, sk_sp cs, int w, int h) - : fColorInfo(ct, at, std::move(cs)), fDimensions{w,h} {} - - GrImageInfo(GrColorType ct, SkAlphaType at, sk_sp cs, const SkISize& dimensions) - : fColorInfo(ct, at, std::move(cs)), fDimensions(dimensions) {} - - GrImageInfo(const GrColorInfo& info, const SkISize& dimensions) - : fColorInfo(info), fDimensions(dimensions) {} - - GrImageInfo(GrColorInfo&& info, const SkISize& dimensions) - : fColorInfo(std::move(info)), fDimensions(dimensions) {} - - GrImageInfo(const GrImageInfo&) = default; - GrImageInfo(GrImageInfo&&) = default; - GrImageInfo& operator=(const GrImageInfo&) = default; - GrImageInfo& operator=(GrImageInfo&&) = default; - - GrImageInfo makeColorType(GrColorType ct) const { - return {this->colorInfo().makeColorType(ct), this->dimensions()}; - } - - GrImageInfo makeAlphaType(SkAlphaType at) const { - return {this->colorType(), at, this->refColorSpace(), this->width(), this->height()}; - } - - GrImageInfo makeColorSpace(sk_sp cs) const { - return {this->colorType(), this->alphaType(), std::move(cs), this->width(), this->height()}; - } - - GrImageInfo makeDimensions(SkISize dimensions) const { - return {this->colorType(), this->alphaType(), this->refColorSpace(), dimensions}; - } - - GrImageInfo makeWH(int width, int height) const { - return {this->colorType(), this->alphaType(), this->refColorSpace(), width, height}; - } + GrImageInfo makeColorType(GrColorType ct) const; + GrImageInfo makeAlphaType(SkAlphaType at) const; + GrImageInfo makeColorSpace(sk_sp cs) const; + GrImageInfo makeDimensions(SkISize dimensions) const ; + GrImageInfo makeWH(int width, int height) const; const GrColorInfo& colorInfo() const { return fColorInfo; } @@ -64,7 +47,7 @@ public: SkColorSpace* colorSpace() const { return fColorInfo.colorSpace(); } - sk_sp refColorSpace() const { return fColorInfo.refColorSpace(); } + sk_sp refColorSpace() const; SkISize dimensions() const { return fDimensions; } diff --git a/src/gpu/GrOpFlushState.cpp b/src/gpu/GrOpFlushState.cpp index ee1a7eb43f..302b752cc5 100644 --- a/src/gpu/GrOpFlushState.cpp +++ b/src/gpu/GrOpFlushState.cpp @@ -7,6 +7,7 @@ #include "src/gpu/GrOpFlushState.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/core/SkConvertPixels.h" #include "src/gpu/GrDataUtils.h" diff --git a/src/gpu/GrRecordingContextPriv.cpp b/src/gpu/GrRecordingContextPriv.cpp index 1b89691280..396e173cc2 100644 --- a/src/gpu/GrRecordingContextPriv.cpp +++ b/src/gpu/GrRecordingContextPriv.cpp @@ -7,6 +7,7 @@ #include "src/gpu/GrRecordingContextPriv.h" +#include "include/core/SkColorSpace.h" #include "src/gpu/GrCaps.h" #include "src/gpu/GrDrawingManager.h" #include "src/gpu/GrProxyProvider.h" diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp index 7a1b8da2b2..af5d8a1556 100644 --- a/src/gpu/GrResourceProvider.cpp +++ b/src/gpu/GrResourceProvider.cpp @@ -7,6 +7,7 @@ #include "src/gpu/GrResourceProvider.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrBackendSemaphore.h" #include "include/private/SingleOwner.h" #include "src/core/SkConvertPixels.h" diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 48db1b7b47..7b840cdad5 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -8,6 +8,7 @@ #include "src/gpu/GrSurfaceProxy.h" #include "src/gpu/GrSurfaceProxyPriv.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrRecordingContext.h" #include "src/core/SkMathPriv.h" #include "src/gpu/GrAttachment.h" diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp index f8822528de..3e7e7b0548 100644 --- a/src/gpu/GrTestUtils.cpp +++ b/src/gpu/GrTestUtils.cpp @@ -7,6 +7,7 @@ #include "src/gpu/GrTestUtils.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkMatrix.h" #include "include/core/SkPathBuilder.h" #include "include/core/SkRRect.h" diff --git a/src/gpu/SurfaceContext.cpp b/src/gpu/SurfaceContext.cpp index 8b2d621ab5..2903d5ef89 100644 --- a/src/gpu/SurfaceContext.cpp +++ b/src/gpu/SurfaceContext.cpp @@ -7,8 +7,7 @@ #include "src/gpu/SurfaceContext.h" -#include - +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/GrRecordingContext.h" #include "src/core/SkAutoPixmapStorage.h" @@ -30,6 +29,8 @@ #include "src/gpu/effects/GrBicubicEffect.h" #include "src/gpu/effects/GrTextureEffect.h" +#include + #define ASSERT_SINGLE_OWNER SKGPU_ASSERT_SINGLE_OWNER(this->singleOwner()) #define RETURN_FALSE_IF_ABANDONED if (this->fContext->abandoned()) { return false; } #define RETURN_NULLPTR_IF_ABANDONED if (this->fContext->abandoned()) { return nullptr; } diff --git a/src/gpu/effects/BUILD.bazel b/src/gpu/effects/BUILD.bazel index 61fb135dc9..a19537ef57 100644 --- a/src/gpu/effects/BUILD.bazel +++ b/src/gpu/effects/BUILD.bazel @@ -503,6 +503,7 @@ generated_cc_atom( "//include/private:GrContext_Base_hdr", "//include/private:SkSLString_hdr", "//src/core:SkColorFilterBase_hdr", + "//src/core:SkColorSpacePriv_hdr", "//src/core:SkRuntimeEffectPriv_hdr", "//src/core:SkVM_hdr", "//src/gpu:GrBaseContextPriv_hdr", diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 064591d913..a12b1d1773 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -112,7 +112,7 @@ GrMatrixConvolutionEffect::KernelWrapper::Make(GrRecordingContext* rContext, } SkBitmap bm; - auto info = SkImageInfo::Make({length, 1}, colorType, kPremul_SkAlphaType, nullptr); + auto info = SkImageInfo::Make({length, 1}, colorType, kPremul_SkAlphaType); if (!bm.tryAllocPixels(info)) { return {}; } diff --git a/src/gpu/effects/GrSkSLFP.cpp b/src/gpu/effects/GrSkSLFP.cpp index 8b47578420..e3f6efb8bb 100644 --- a/src/gpu/effects/GrSkSLFP.cpp +++ b/src/gpu/effects/GrSkSLFP.cpp @@ -10,6 +10,7 @@ #include "include/effects/SkRuntimeEffect.h" #include "include/private/GrContext_Base.h" #include "include/private/SkSLString.h" +#include "src/core/SkColorSpacePriv.h" #include "src/core/SkRuntimeEffectPriv.h" #include "src/core/SkVM.h" #include "src/gpu/GrBaseContextPriv.h" diff --git a/src/gpu/gl/BUILD.bazel b/src/gpu/gl/BUILD.bazel index ceb284aa9a..2af21d470b 100644 --- a/src/gpu/gl/BUILD.bazel +++ b/src/gpu/gl/BUILD.bazel @@ -250,6 +250,7 @@ generated_cc_atom( ":GrGLOpsRenderPass_hdr", ":GrGLSemaphore_hdr", ":GrGLTextureRenderTarget_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkPixmap_hdr", "//include/core:SkTypes_hdr", "//include/gpu:GrBackendSemaphore_hdr", diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 52a24a0e9b..3528b56b06 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -7,6 +7,7 @@ #include "src/gpu/gl/GrGLGpu.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkPixmap.h" #include "include/core/SkTypes.h" #include "include/gpu/GrBackendSemaphore.h" diff --git a/src/gpu/gradients/BUILD.bazel b/src/gpu/gradients/BUILD.bazel index 5ab0c3fe28..30d752fb3c 100644 --- a/src/gpu/gradients/BUILD.bazel +++ b/src/gpu/gradients/BUILD.bazel @@ -48,6 +48,7 @@ generated_cc_atom( deps = [ ":GrGradientBitmapCache_hdr", ":GrGradientShader_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/core:SkMathPriv_hdr", "//src/core:SkRuntimeEffectPriv_hdr", diff --git a/src/gpu/gradients/GrGradientShader.cpp b/src/gpu/gradients/GrGradientShader.cpp index a885e7ecb3..4ce118f78f 100644 --- a/src/gpu/gradients/GrGradientShader.cpp +++ b/src/gpu/gradients/GrGradientShader.cpp @@ -7,8 +7,7 @@ #include "src/gpu/gradients/GrGradientShader.h" -#include "src/gpu/gradients/GrGradientBitmapCache.h" - +#include "include/core/SkColorSpace.h" #include "include/gpu/GrRecordingContext.h" #include "src/core/SkMathPriv.h" #include "src/core/SkRuntimeEffectPriv.h" @@ -20,6 +19,7 @@ #include "src/gpu/effects/GrMatrixEffect.h" #include "src/gpu/effects/GrSkSLFP.h" #include "src/gpu/effects/GrTextureEffect.h" +#include "src/gpu/gradients/GrGradientBitmapCache.h" using Vec4 = skvx::Vec<4, float>; diff --git a/src/gpu/text/BUILD.bazel b/src/gpu/text/BUILD.bazel index 267edfbae6..ab880c0ac3 100644 --- a/src/gpu/text/BUILD.bazel +++ b/src/gpu/text/BUILD.bazel @@ -20,6 +20,7 @@ generated_cc_atom( ":GrAtlasManager_hdr", ":GrStrikeCache_hdr", "//include/core:SkBitmap_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkImageEncoder_hdr", "//include/core:SkStream_hdr", "//include/gpu:GrDirectContext_hdr", diff --git a/src/gpu/text/GrAtlasManager.cpp b/src/gpu/text/GrAtlasManager.cpp index 70a7610f11..8a84bf6bb2 100644 --- a/src/gpu/text/GrAtlasManager.cpp +++ b/src/gpu/text/GrAtlasManager.cpp @@ -7,6 +7,7 @@ #include "src/gpu/text/GrAtlasManager.h" +#include "include/core/SkColorSpace.h" #include "src/codec/SkMasks.h" #include "src/core/SkAutoMalloc.h" #include "src/gpu/GrGlyph.h" diff --git a/src/gpu/v1/BUILD.bazel b/src/gpu/v1/BUILD.bazel index 628cd8b08b..adc101454d 100644 --- a/src/gpu/v1/BUILD.bazel +++ b/src/gpu/v1/BUILD.bazel @@ -24,6 +24,7 @@ generated_cc_atom( ":ClipStack_hdr", ":StencilMaskHelper_hdr", ":SurfaceDrawContext_v1_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkMatrix_hdr", "//src/core:SkMatrixProvider_hdr", "//src/core:SkPathPriv_hdr", @@ -255,6 +256,7 @@ generated_cc_atom( deps = [ ":PathRenderer_hdr", ":SurfaceDrawContext_v1_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkDrawable_hdr", "//include/core:SkVertices_hdr", "//include/gpu:GrBackendSemaphore_hdr", diff --git a/src/gpu/v1/ClipStack.cpp b/src/gpu/v1/ClipStack.cpp index a5149b5f31..e34efd2ccd 100644 --- a/src/gpu/v1/ClipStack.cpp +++ b/src/gpu/v1/ClipStack.cpp @@ -7,6 +7,7 @@ #include "src/gpu/v1/ClipStack.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkMatrix.h" #include "src/core/SkMatrixProvider.h" #include "src/core/SkPathPriv.h" diff --git a/src/gpu/v1/SurfaceDrawContext.cpp b/src/gpu/v1/SurfaceDrawContext.cpp index 37693dcdab..736f58b583 100644 --- a/src/gpu/v1/SurfaceDrawContext.cpp +++ b/src/gpu/v1/SurfaceDrawContext.cpp @@ -7,6 +7,7 @@ #include "src/gpu/v1/SurfaceDrawContext_v1.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkDrawable.h" #include "include/core/SkVertices.h" #include "include/gpu/GrBackendSemaphore.h" diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index f6e54e3ab7..80b1392a7a 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -472,6 +472,22 @@ sk_sp SkImage::MakeFromTexture(GrRecordingContext* rContext, kBorrow_GrWrapOwnership, std::move(releaseHelper)); } +sk_sp SkImage::MakeFromAdoptedTexture(GrRecordingContext* context, + const GrBackendTexture& backendTexture, + GrSurfaceOrigin textureOrigin, + SkColorType colorType) { + return SkImage::MakeFromAdoptedTexture(context, backendTexture, textureOrigin, + colorType, kPremul_SkAlphaType, nullptr); +} +sk_sp SkImage::MakeFromAdoptedTexture(GrRecordingContext* context, + const GrBackendTexture& backendTexture, + GrSurfaceOrigin textureOrigin, + SkColorType colorType, + SkAlphaType alphaType) { + return SkImage::MakeFromAdoptedTexture(context, backendTexture, textureOrigin, + colorType, alphaType, nullptr); +} + sk_sp SkImage::MakeFromAdoptedTexture(GrRecordingContext* rContext, const GrBackendTexture& tex, GrSurfaceOrigin origin, SkColorType ct, SkAlphaType at, diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 6c48885192..e5829d86bf 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -690,6 +690,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkImage_hdr", "//include/gpu:GrBackendSurface_hdr", "//include/gpu:GrDirectContext_hdr", @@ -873,6 +874,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/core:SkBlendModePriv_hdr", "//src/gpu:GrDirectContextPriv_hdr", @@ -1382,6 +1384,7 @@ generated_cc_atom( ":TestUtils_hdr", ":Test_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", "//src/core:SkAutoPixmapStorage_hdr", @@ -1468,6 +1471,7 @@ generated_cc_atom( deps = [ ":Test_hdr", "//include/core:SkBitmap_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkVertices_hdr", "//src/core:SkBlendModePriv_hdr", "//src/core:SkMatrixProvider_hdr", @@ -1813,6 +1817,7 @@ generated_cc_atom( deps = [ ":TestUtils_hdr", ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrDirectContextPriv_hdr", "//src/gpu:GrProxyProvider_hdr", @@ -1900,6 +1905,7 @@ generated_cc_atom( ":TestUtils_hdr", ":Test_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkImage_hdr", "//include/core:SkSurface_hdr", "//include/gpu:GrDirectContext_hdr", @@ -2028,6 +2034,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//include/private:SkHalf_hdr", "//src/gpu:GrDirectContextPriv_hdr", @@ -2186,6 +2193,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkImage_hdr", "//include/core:SkSurface_hdr", "//include/core:SkTypes_hdr", @@ -2303,6 +2311,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkPath_hdr", "//include/core:SkRRect_hdr", "//include/core:SkRect_hdr", @@ -2422,6 +2431,7 @@ generated_cc_atom( deps = [ ":Test_hdr", "//include/core:SkBitmap_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrCaps_hdr", "//src/gpu:GrDirectContextPriv_hdr", @@ -2499,6 +2509,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkTypes_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", @@ -2624,6 +2635,7 @@ generated_cc_atom( ":Test_hdr", "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkSurface_hdr", "//src/gpu:GrCaps_hdr", "//src/gpu:GrDirectContextPriv_hdr", @@ -2639,6 +2651,7 @@ generated_cc_atom( deps = [ ":TestUtils_hdr", ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkSurface_hdr", "//include/gpu:GrDirectContext_hdr", "//src/core:SkAutoPixmapStorage_hdr", @@ -2745,6 +2758,7 @@ generated_cc_atom( "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", "//include/core:SkColorPriv_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkShader_hdr", "//include/core:SkSurface_hdr", "//include/effects:SkGradientShader_hdr", @@ -3104,6 +3118,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu/mock:GrMockTypes_hdr", "//src/core:SkRectPriv_hdr", "//src/gpu:GrClip_hdr", @@ -4464,6 +4479,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkPath_hdr", "//include/gpu:GrDirectContext_hdr", "//include/gpu:GrRecordingContext_hdr", @@ -4668,6 +4684,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkString_hdr", "//include/core:SkTypes_hdr", "//include/gpu:GrDirectContext_hdr", @@ -4695,6 +4712,7 @@ generated_cc_atom( ":TestHarness_hdr", ":TestUtils_hdr", ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrClip_hdr", "//src/gpu:GrDirectContextPriv_hdr", @@ -4720,6 +4738,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkTypes_hdr", "//include/gpu:GrDirectContext_hdr", "//include/private:SkChecksum_hdr", @@ -5054,6 +5073,7 @@ generated_cc_atom( deps = [ ":TestUtils_hdr", ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrDirectContextPriv_hdr", "//src/gpu:GrProxyProvider_hdr", @@ -5203,6 +5223,7 @@ generated_cc_atom( ":TestUtils_hdr", ":Test_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkSurface_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrCaps_hdr", @@ -5219,6 +5240,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkTypes_hdr", "//src/core:SkColorSpaceXformSteps_hdr", "//src/core:SkRasterPipeline_hdr", @@ -6207,6 +6229,7 @@ generated_cc_atom( ":Test_hdr", "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkImage_hdr", "//include/core:SkPixmap_hdr", "//include/core:SkSurface_hdr", @@ -6371,6 +6394,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrDirectContextPriv_hdr", "//src/gpu:GrImageInfo_hdr", @@ -6387,6 +6411,7 @@ generated_cc_atom( ":Test_hdr", "//include/core:SkBitmap_hdr", "//include/core:SkCanvas_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkSurface_hdr", "//include/gpu:GrBackendSemaphore_hdr", "//include/gpu:GrBackendSurface_hdr", @@ -6527,6 +6552,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":TestUtils_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkStream_hdr", "//include/encode:SkPngEncoder_hdr", "//include/utils:SkBase64_hdr", @@ -6621,6 +6647,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkSurface_hdr", "//include/gpu:GrDirectContext_hdr", "//src/gpu:GrDirectContextPriv_hdr", @@ -6750,6 +6777,7 @@ generated_cc_atom( deps = [ ":TestUtils_hdr", ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkSurface_hdr", "//include/core:SkTypes_hdr", "//include/gpu:GrDirectContext_hdr", @@ -6770,6 +6798,7 @@ generated_cc_atom( visibility = ["//:__subpackages__"], deps = [ ":Test_hdr", + "//include/core:SkColorSpace_hdr", "//include/core:SkPath_hdr", "//include/core:SkRect_hdr", "//include/effects:SkGradientShader_hdr", diff --git a/tests/BackendSurfaceMutableStateTest.cpp b/tests/BackendSurfaceMutableStateTest.cpp index 60d58c426c..7bd077d908 100644 --- a/tests/BackendSurfaceMutableStateTest.cpp +++ b/tests/BackendSurfaceMutableStateTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "include/core/SkColorSpace.h" #include "include/core/SkImage.h" #include "include/gpu/GrBackendSurface.h" #include "include/gpu/GrDirectContext.h" diff --git a/tests/BulkRectTest.cpp b/tests/BulkRectTest.cpp index 5bef96b73f..20b4b2e2b4 100644 --- a/tests/BulkRectTest.cpp +++ b/tests/BulkRectTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/core/SkBlendModePriv.h" #include "src/gpu/GrDirectContextPriv.h" diff --git a/tests/CompressedBackendAllocationTest.cpp b/tests/CompressedBackendAllocationTest.cpp index d6a9010b03..00e23e7a0f 100644 --- a/tests/CompressedBackendAllocationTest.cpp +++ b/tests/CompressedBackendAllocationTest.cpp @@ -6,6 +6,7 @@ */ #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/GrRecordingContext.h" #include "src/core/SkAutoPixmapStorage.h" diff --git a/tests/DMSAATest.cpp b/tests/DMSAATest.cpp index f57ce21749..34fa9a2201 100644 --- a/tests/DMSAATest.cpp +++ b/tests/DMSAATest.cpp @@ -8,6 +8,7 @@ #include "tests/Test.h" #include "include/core/SkBitmap.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkVertices.h" #include "src/core/SkBlendModePriv.h" #include "src/core/SkMatrixProvider.h" diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp index 70bfdcf2d9..895a0d77c1 100644 --- a/tests/EGLImageTest.cpp +++ b/tests/EGLImageTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrDirectContextPriv.h" #include "src/gpu/GrProxyProvider.h" diff --git a/tests/ExtendedSkColorTypeTests.cpp b/tests/ExtendedSkColorTypeTests.cpp index 28d7def2bb..aebc79254d 100644 --- a/tests/ExtendedSkColorTypeTests.cpp +++ b/tests/ExtendedSkColorTypeTests.cpp @@ -6,6 +6,7 @@ */ #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkImage.h" #include "include/core/SkSurface.h" #include "include/gpu/GrDirectContext.h" diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index 59b041843c..631aa23798 100644 --- a/tests/FloatingPointTextureTest.cpp +++ b/tests/FloatingPointTextureTest.cpp @@ -14,6 +14,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "include/private/SkHalf.h" #include "src/gpu/GrDirectContextPriv.h" diff --git a/tests/GLBackendSurfaceTest.cpp b/tests/GLBackendSurfaceTest.cpp index 5387e8e3a1..73ae95ee37 100644 --- a/tests/GLBackendSurfaceTest.cpp +++ b/tests/GLBackendSurfaceTest.cpp @@ -11,6 +11,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkImage.h" #include "include/core/SkSurface.h" #include "include/gpu/GrBackendSurface.h" diff --git a/tests/GrClipStackTest.cpp b/tests/GrClipStackTest.cpp index 0acfd5103b..14a01f4848 100644 --- a/tests/GrClipStackTest.cpp +++ b/tests/GrClipStackTest.cpp @@ -9,6 +9,7 @@ #include "src/gpu/v1/ClipStack.h" #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkPath.h" #include "include/core/SkRRect.h" #include "include/core/SkRect.h" diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp index c205dc4056..3a61f96651 100644 --- a/tests/GrMeshTest.cpp +++ b/tests/GrMeshTest.cpp @@ -7,10 +7,9 @@ #include "tests/Test.h" -#include -#include -#include + #include "include/core/SkBitmap.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrCaps.h" #include "src/gpu/GrDirectContextPriv.h" @@ -29,6 +28,10 @@ #include "src/gpu/ops/GrSimpleMeshDrawOpHelper.h" #include "src/gpu/v1/SurfaceDrawContext_v1.h" +#include +#include +#include + #if 0 #include "tools/ToolUtils.h" #define WRITE_PNG_CONTEXT_TYPE kANGLE_D3D11_ES3_ContextType diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp index 52198a6865..1c8b7cc7b0 100644 --- a/tests/GrPipelineDynamicStateTest.cpp +++ b/tests/GrPipelineDynamicStateTest.cpp @@ -8,6 +8,7 @@ #include "include/core/SkTypes.h" #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/GrRecordingContext.h" #include "src/gpu/GrColor.h" diff --git a/tests/GrSurfaceResolveTest.cpp b/tests/GrSurfaceResolveTest.cpp index 4dc49e6098..26268ba38f 100644 --- a/tests/GrSurfaceResolveTest.cpp +++ b/tests/GrSurfaceResolveTest.cpp @@ -9,6 +9,7 @@ #include "include/core/SkBitmap.h" #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" #include "src/gpu/GrCaps.h" #include "src/gpu/GrDirectContextPriv.h" diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index e6375178fd..83a1cd0171 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -#include +#include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" #include "include/gpu/GrDirectContext.h" #include "src/core/SkAutoPixmapStorage.h" @@ -26,6 +26,8 @@ #include "tools/gpu/BackendTextureImageFactory.h" #include "tools/gpu/ManagedBackendTexture.h" +#include + // Tests that GrSurface::asTexture(), GrSurface::asRenderTarget(), and static upcasting of texture // and render targets to GrSurface all work as expected. DEF_GPUTEST_FOR_MOCK_CONTEXT(GrSurface, reporter, ctxInfo) { diff --git a/tests/GradientTest.cpp b/tests/GradientTest.cpp index 1e9c1db738..e594ac588d 100644 --- a/tests/GradientTest.cpp +++ b/tests/GradientTest.cpp @@ -8,6 +8,7 @@ #include "include/core/SkBitmap.h" #include "include/core/SkCanvas.h" #include "include/core/SkColorPriv.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkShader.h" #include "include/core/SkSurface.h" #include "include/effects/SkGradientShader.h" diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp index be6ef56ffb..49567b6601 100644 --- a/tests/LazyProxyTest.cpp +++ b/tests/LazyProxyTest.cpp @@ -7,6 +7,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/mock/GrMockTypes.h" #include "src/core/SkRectPriv.h" #include "src/gpu/GrClip.h" diff --git a/tests/PathRendererCacheTests.cpp b/tests/PathRendererCacheTests.cpp index 81acded4b4..a8555ca8d8 100644 --- a/tests/PathRendererCacheTests.cpp +++ b/tests/PathRendererCacheTests.cpp @@ -7,6 +7,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkPath.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/GrRecordingContext.h" diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 03b7a936ab..c1e63afb22 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -7,11 +7,9 @@ // This is a GPU-backend specific test. It relies on static initializers to work -#include - #include "include/core/SkTypes.h" -#include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkString.h" #include "include/gpu/GrDirectContext.h" #include "src/core/SkPointPriv.h" @@ -27,6 +25,9 @@ #include "src/gpu/ops/GrMeshDrawOp.h" #include "src/gpu/ops/GrSimpleMeshDrawOpHelper.h" #include "src/gpu/v1/SurfaceDrawContext_v1.h" +#include "tests/Test.h" + +#include namespace { class Op : public GrMeshDrawOp { diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index 5ed4538be2..608db4b34a 100644 --- a/tests/ProcessorTest.cpp +++ b/tests/ProcessorTest.cpp @@ -7,6 +7,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrClip.h" #include "src/gpu/GrDirectContextPriv.h" diff --git a/tests/ProgramsTest.cpp b/tests/ProgramsTest.cpp index 2abd3801c9..ab978ee3ff 100644 --- a/tests/ProgramsTest.cpp +++ b/tests/ProgramsTest.cpp @@ -9,6 +9,7 @@ #include "include/core/SkTypes.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "include/private/SkChecksum.h" #include "include/utils/SkRandom.h" diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index 267f057973..ce2033c5db 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -8,6 +8,7 @@ #include "tests/Test.h" #include "tests/TestUtils.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrDirectContextPriv.h" #include "src/gpu/GrProxyProvider.h" diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp index 5bfdda3ed4..1a478f4423 100644 --- a/tests/SRGBReadWritePixelsTest.cpp +++ b/tests/SRGBReadWritePixelsTest.cpp @@ -6,6 +6,7 @@ */ #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrCaps.h" diff --git a/tests/SRGBTest.cpp b/tests/SRGBTest.cpp index 2eea2ceeab..04ff6d158f 100644 --- a/tests/SRGBTest.cpp +++ b/tests/SRGBTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "include/core/SkColorSpace.h" #include "include/core/SkTypes.h" #include "src/core/SkColorSpaceXformSteps.h" #include "src/core/SkRasterPipeline.h" diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp index 90f233a304..898c50836b 100644 --- a/tests/SpecialImageTest.cpp +++ b/tests/SpecialImageTest.cpp @@ -7,6 +7,7 @@ #include "include/core/SkBitmap.h" #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkImage.h" #include "include/core/SkPixmap.h" #include "include/core/SkSurface.h" diff --git a/tests/SurfaceDrawContextTest.cpp b/tests/SurfaceDrawContextTest.cpp index 3b95318d32..6851113ea5 100644 --- a/tests/SurfaceDrawContextTest.cpp +++ b/tests/SurfaceDrawContextTest.cpp @@ -9,6 +9,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrDirectContextPriv.h" #include "src/gpu/GrImageInfo.h" diff --git a/tests/SurfaceSemaphoreTest.cpp b/tests/SurfaceSemaphoreTest.cpp index 996b241ea6..dbaf5cb18d 100644 --- a/tests/SurfaceSemaphoreTest.cpp +++ b/tests/SurfaceSemaphoreTest.cpp @@ -7,6 +7,7 @@ #include "include/core/SkBitmap.h" #include "include/core/SkCanvas.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" #include "include/gpu/GrBackendSemaphore.h" #include "include/gpu/GrBackendSurface.h" diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp index 6d7b17e18d..dc5dcb9ea2 100644 --- a/tests/TestUtils.cpp +++ b/tests/TestUtils.cpp @@ -7,6 +7,7 @@ #include "tests/TestUtils.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkStream.h" #include "include/encode/SkPngEncoder.h" #include "include/utils/SkBase64.h" diff --git a/tests/TextureBindingsResetTest.cpp b/tests/TextureBindingsResetTest.cpp index f9220894db..669169f67e 100644 --- a/tests/TextureBindingsResetTest.cpp +++ b/tests/TextureBindingsResetTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrDirectContextPriv.h" diff --git a/tests/TransferPixelsTest.cpp b/tests/TransferPixelsTest.cpp index 24851c3b7e..151f5954c8 100644 --- a/tests/TransferPixelsTest.cpp +++ b/tests/TransferPixelsTest.cpp @@ -5,10 +5,11 @@ * found in the LICENSE file. */ -// This is a GPU-backend specific test. It relies on static intializers to work +// This is a GPU-backend specific test. It relies on static initializers to work #include "include/core/SkTypes.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" #include "include/gpu/GrDirectContext.h" #include "src/gpu/GrDirectContextPriv.h" diff --git a/tests/TriangulatingPathRendererTests.cpp b/tests/TriangulatingPathRendererTests.cpp index 8f4febd08d..f164724555 100644 --- a/tests/TriangulatingPathRendererTests.cpp +++ b/tests/TriangulatingPathRendererTests.cpp @@ -7,6 +7,7 @@ #include "tests/Test.h" +#include "include/core/SkColorSpace.h" #include "include/core/SkPath.h" #include "include/core/SkRect.h" #include "include/effects/SkGradientShader.h"