[bazel] Fix Bazel build by guarding addToKey

PS1 is the automatic regenerated changes.
PS2-3 adds an #ifdef guard to the addToKey method on shaders.
The SkShaderCodeDictionary class helps generate SkSL and is
only necessary when we are building with SkSL (gpu builds and
cpu builds with SkVM).

Suggested Review order:
 - Use Gerrit to diff PS 1 and the last PS
 - src/core/BUILD.bazel adds some sources to the "only
   necessary if sksl is enabled" bucket
 - All the .cpp and .h files to see the #ifdef is added
   correctly.

Change-Id: I4d4ce61a4957ef1e0840204acff08ce7e616f9cb
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512157
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2022-02-23 11:50:43 -05:00 committed by SkCQ
parent 0b2a5b9a03
commit b902658a1a
33 changed files with 216 additions and 77 deletions

View File

@ -100,6 +100,7 @@ generated_cc_atom(
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [ deps = [
":ContextPriv_hdr", ":ContextPriv_hdr",
":GlobalCache_hdr",
":Gpu_hdr", ":Gpu_hdr",
], ],
) )
@ -366,6 +367,7 @@ generated_cc_atom(
"//experimental/graphite/include:Recorder_hdr", "//experimental/graphite/include:Recorder_hdr",
"//experimental/graphite/src/geom:BoundsManager_hdr", "//experimental/graphite/src/geom:BoundsManager_hdr",
"//src/core:SkMathPriv_hdr", "//src/core:SkMathPriv_hdr",
"//src/core:SkPaintParamsKey_hdr",
"//src/core:SkTBlockList_hdr", "//src/core:SkTBlockList_hdr",
"//src/core:SkUniformData_hdr", "//src/core:SkUniformData_hdr",
"//src/gpu:BufferWriter_hdr", "//src/gpu:BufferWriter_hdr",
@ -482,7 +484,10 @@ generated_cc_atom(
name = "Image_Graphite_hdr", name = "Image_Graphite_hdr",
hdrs = ["Image_Graphite.h"], hdrs = ["Image_Graphite.h"],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = ["//src/image:SkImage_Base_hdr"], deps = [
":TextureProxyView_hdr",
"//src/image:SkImage_Base_hdr",
],
) )
generated_cc_atom( generated_cc_atom(
@ -944,3 +949,15 @@ generated_cc_atom(
"//src/core:SkConvertPixels_hdr", "//src/core:SkConvertPixels_hdr",
], ],
) )
generated_cc_atom(
name = "TextureProxyView_hdr",
hdrs = ["TextureProxyView.h"],
visibility = ["//:__subpackages__"],
deps = [
":TextureProxy_hdr",
"//experimental/graphite/include:GraphiteTypes_hdr",
"//include/core:SkRefCnt_hdr",
"//src/gpu:Swizzle_hdr",
],
)

View File

@ -1927,8 +1927,8 @@ generated_cc_atom(
"//include/private:SkColorData_hdr", "//include/private:SkColorData_hdr",
"//src/core:SkCanvasPriv_hdr", "//src/core:SkCanvasPriv_hdr",
"//src/gpu:GrRecordingContextPriv_hdr", "//src/gpu:GrRecordingContextPriv_hdr",
"//src/gpu:GrSwizzle_hdr",
"//src/gpu:SurfaceFillContext_hdr", "//src/gpu:SurfaceFillContext_hdr",
"//src/gpu:Swizzle_hdr",
], ],
) )
@ -5755,6 +5755,7 @@ generated_cc_atom(
deps = [ deps = [
":gm_hdr", ":gm_hdr",
"//include/core:SkCanvas_hdr", "//include/core:SkCanvas_hdr",
"//include/core:SkMaskFilter_hdr",
"//include/core:SkPaint_hdr", "//include/core:SkPaint_hdr",
"//include/core:SkPathEffect_hdr", "//include/core:SkPathEffect_hdr",
"//include/core:SkPath_hdr", "//include/core:SkPath_hdr",
@ -5763,6 +5764,7 @@ generated_cc_atom(
"//include/core:SkScalar_hdr", "//include/core:SkScalar_hdr",
"//include/core:SkTypes_hdr", "//include/core:SkTypes_hdr",
"//include/effects:SkDashPathEffect_hdr", "//include/effects:SkDashPathEffect_hdr",
"//include/effects:SkImageFilters_hdr",
], ],
) )
@ -9381,6 +9383,7 @@ generated_cc_atom(
"//include/gpu:GrRecordingContext_hdr", "//include/gpu:GrRecordingContext_hdr",
"//include/gpu:GrTypes_hdr", "//include/gpu:GrTypes_hdr",
"//include/private:GrTypesPriv_hdr", "//include/private:GrTypesPriv_hdr",
"//include/private:SkHalf_hdr",
"//include/private:SkTArray_hdr", "//include/private:SkTArray_hdr",
"//include/private:SkTDArray_hdr", "//include/private:SkTDArray_hdr",
"//include/private:SkTPin_hdr", "//include/private:SkTPin_hdr",
@ -9616,3 +9619,26 @@ generated_cc_atom(
"//src/gpu/v1:SurfaceDrawContext_v1_hdr", "//src/gpu/v1:SurfaceDrawContext_v1_hdr",
], ],
) )
generated_cc_atom(
name = "palette_src",
srcs = ["palette.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":gm_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkColor_hdr",
"//include/core:SkFontMetrics_hdr",
"//include/core:SkFontMgr_hdr",
"//include/core:SkFont_hdr",
"//include/core:SkPaint_hdr",
"//include/core:SkRefCnt_hdr",
"//include/core:SkScalar_hdr",
"//include/core:SkSize_hdr",
"//include/core:SkString_hdr",
"//include/core:SkTypeface_hdr",
"//include/core:SkTypes_hdr",
"//tools:Resources_hdr",
"//tools:ToolUtils_hdr",
],
)

View File

@ -274,6 +274,7 @@ generated_cc_atom(
hdrs = ["SkFontArguments.h"], hdrs = ["SkFontArguments.h"],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [ deps = [
":SkColor_hdr",
":SkScalar_hdr", ":SkScalar_hdr",
":SkTypes_hdr", ":SkTypes_hdr",
], ],

View File

@ -367,10 +367,7 @@ generated_cc_atom(
name = "SkSLString_hdr", name = "SkSLString_hdr",
hdrs = ["SkSLString.h"], hdrs = ["SkSLString.h"],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [ deps = [":SkSLDefines_hdr"],
":SkSLDefines_hdr",
"//include/core:SkString_hdr",
],
) )
generated_cc_atom( generated_cc_atom(

View File

@ -5,6 +5,7 @@ generated_cc_atom(
hdrs = ["GrSlug.h"], hdrs = ["GrSlug.h"],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [ deps = [
"//include/core:SkData_hdr",
"//include/core:SkRect_hdr", "//include/core:SkRect_hdr",
"//include/core:SkRefCnt_hdr", "//include/core:SkRefCnt_hdr",
], ],

View File

@ -94,7 +94,6 @@ cc_library(
":SkImageFilter_src", ":SkImageFilter_src",
":SkImageGenerator_src", ":SkImageGenerator_src",
":SkImageInfo_src", ":SkImageInfo_src",
":SkKeyHelpers_src",
":SkLatticeIter_src", ":SkLatticeIter_src",
":SkLineClipper_src", ":SkLineClipper_src",
":SkLocalMatrixImageFilter_src", ":SkLocalMatrixImageFilter_src",
@ -210,10 +209,14 @@ cc_library(
], ],
) )
# These are sources that are only needed if SkSL is enabled (GPU backend or SkVM).
cc_library( cc_library(
name = "sksl_srcs", name = "sksl_srcs",
deps = [ deps = [
":SkKeyHelpers_src",
":SkPaintParamsKey_src",
":SkRuntimeEffect_src", ":SkRuntimeEffect_src",
":SkShaderCodeDictionary_src",
], ],
) )
@ -3126,8 +3129,6 @@ generated_cc_atom(
":SkBlenderBase_hdr", ":SkBlenderBase_hdr",
":SkColorFilterBase_hdr", ":SkColorFilterBase_hdr",
":SkColorSpacePriv_hdr", ":SkColorSpacePriv_hdr",
":SkKeyHelpers_hdr",
":SkPaintParamsKey_hdr",
":SkPaintPriv_hdr", ":SkPaintPriv_hdr",
":SkXfermodePriv_hdr", ":SkXfermodePriv_hdr",
"//include/core:SkPaint_hdr", "//include/core:SkPaint_hdr",
@ -5656,7 +5657,9 @@ generated_cc_atom(
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [ deps = [
":SkBuiltInCodeSnippetID_hdr", ":SkBuiltInCodeSnippetID_hdr",
"//include/core:SkSpan_hdr",
"//include/core:SkTypes_hdr", "//include/core:SkTypes_hdr",
"//include/private:SkTArray_hdr",
], ],
) )

View File

@ -6,7 +6,6 @@
*/ */
#include "src/core/SkBlendModeBlender.h" #include "src/core/SkBlendModeBlender.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h" #include "src/core/SkWriteBuffer.h"
@ -15,6 +14,10 @@
#include "src/gpu/effects/GrBlendFragmentProcessor.h" #include "src/gpu/effects/GrBlendFragmentProcessor.h"
#endif #endif
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
sk_sp<SkBlender> SkBlender::Mode(SkBlendMode mode) { sk_sp<SkBlender> SkBlender::Mode(SkBlendMode mode) {
#define RETURN_SINGLETON_BLENDER(m) \ #define RETURN_SINGLETON_BLENDER(m) \
case m: { \ case m: { \
@ -60,6 +63,7 @@ sk_sp<SkBlender> SkBlender::Mode(SkBlendMode mode) {
#undef RETURN_SINGLETON_BLENDER #undef RETURN_SINGLETON_BLENDER
} }
#ifdef SK_ENABLE_SKSL
void SkBlenderBase::addToKey(SkShaderCodeDictionary* dict, void SkBlenderBase::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -70,6 +74,7 @@ void SkBlenderBase::addToKey(SkShaderCodeDictionary* dict,
BlendModeBlock::AddToKey(dict, builder, uniformBlock, SkBlendMode::kSrcOver); BlendModeBlock::AddToKey(dict, builder, uniformBlock, SkBlendMode::kSrcOver);
} }
} }
#endif
sk_sp<SkFlattenable> SkBlendModeBlender::CreateProc(SkReadBuffer& buffer) { sk_sp<SkFlattenable> SkBlendModeBlender::CreateProc(SkReadBuffer& buffer) {
SkBlendMode mode = buffer.read32LE(SkBlendMode::kLastMode); SkBlendMode mode = buffer.read32LE(SkBlendMode::kLastMode);

View File

@ -57,10 +57,12 @@ public:
virtual SkRuntimeEffect* asRuntimeEffect() const { return nullptr; } virtual SkRuntimeEffect* asRuntimeEffect() const { return nullptr; }
#ifdef SK_ENABLE_SKSL
// TODO: make pure virtual // TODO: make pure virtual
virtual void addToKey(SkShaderCodeDictionary*, virtual void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const; SkUniformBlock*) const;
#endif
static SkFlattenable::Type GetFlattenableType() { return kSkBlender_Type; } static SkFlattenable::Type GetFlattenableType() { return kSkBlender_Type; }
Type getFlattenableType() const override { return GetFlattenableType(); } Type getFlattenableType() const override { return GetFlattenableType(); }

View File

@ -85,7 +85,6 @@ cc_library(
":GrSurfaceInfo_src", ":GrSurfaceInfo_src",
":GrSurfaceProxy_src", ":GrSurfaceProxy_src",
":GrSurface_src", ":GrSurface_src",
":GrSwizzle_src",
":GrTestUtils_src", ":GrTestUtils_src",
":GrTextureProxy_src", ":GrTextureProxy_src",
":GrTextureRenderTargetProxy_src", ":GrTextureRenderTargetProxy_src",
@ -107,6 +106,7 @@ cc_library(
":SkGr_src", ":SkGr_src",
":SurfaceContext_src", ":SurfaceContext_src",
":SurfaceFillContext_src", ":SurfaceFillContext_src",
":Swizzle_src",
"//src/gpu/effects:GrBezierEffect_src", "//src/gpu/effects:GrBezierEffect_src",
"//src/gpu/effects:GrBicubicEffect_src", "//src/gpu/effects:GrBicubicEffect_src",
"//src/gpu/effects:GrBitmapTextGeoProc_src", "//src/gpu/effects:GrBitmapTextGeoProc_src",
@ -701,7 +701,7 @@ generated_cc_atom(
":GrSamplerState_hdr", ":GrSamplerState_hdr",
":GrShaderCaps_hdr", ":GrShaderCaps_hdr",
":GrSurfaceProxy_hdr", ":GrSurfaceProxy_hdr",
":GrSwizzle_hdr", ":Swizzle_hdr",
"//include/core:SkImageInfo_hdr", "//include/core:SkImageInfo_hdr",
"//include/core:SkRefCnt_hdr", "//include/core:SkRefCnt_hdr",
"//include/core:SkString_hdr", "//include/core:SkString_hdr",
@ -957,7 +957,7 @@ generated_cc_atom(
":GrDataUtils_hdr", ":GrDataUtils_hdr",
":GrImageInfo_hdr", ":GrImageInfo_hdr",
":GrPixmap_hdr", ":GrPixmap_hdr",
":GrSwizzle_hdr", ":Swizzle_hdr",
"//include/private:SkTPin_hdr", "//include/private:SkTPin_hdr",
"//include/third_party/skcms:skcms_hdr", "//include/third_party/skcms:skcms_hdr",
"//src/core:SkColorSpaceXformSteps_hdr", "//src/core:SkColorSpaceXformSteps_hdr",
@ -1311,7 +1311,10 @@ generated_cc_atom(
name = "GrEagerVertexAllocator_hdr", name = "GrEagerVertexAllocator_hdr",
hdrs = ["GrEagerVertexAllocator.h"], hdrs = ["GrEagerVertexAllocator.h"],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [":GrThreadSafeCache_hdr"], deps = [
":BufferWriter_hdr",
":GrThreadSafeCache_hdr",
],
) )
generated_cc_atom( generated_cc_atom(
@ -1416,7 +1419,7 @@ generated_cc_atom(
":GrProcessor_hdr", ":GrProcessor_hdr",
":GrShaderCaps_hdr", ":GrShaderCaps_hdr",
":GrShaderVar_hdr", ":GrShaderVar_hdr",
":GrSwizzle_hdr", ":Swizzle_hdr",
"//src/gpu/glsl:GrGLSLProgramDataManager_hdr", "//src/gpu/glsl:GrGLSLProgramDataManager_hdr",
"//src/gpu/glsl:GrGLSLUniformHandler_hdr", "//src/gpu/glsl:GrGLSLUniformHandler_hdr",
"//src/gpu/glsl:GrGLSLVarying_hdr", "//src/gpu/glsl:GrGLSLVarying_hdr",
@ -1524,8 +1527,8 @@ generated_cc_atom(
":GrCaps_hdr", ":GrCaps_hdr",
":GrOpsRenderPass_hdr", ":GrOpsRenderPass_hdr",
":GrPixmap_hdr", ":GrPixmap_hdr",
":GrSwizzle_hdr",
":GrXferProcessor_hdr", ":GrXferProcessor_hdr",
":Swizzle_hdr",
"//include/core:SkPath_hdr", "//include/core:SkPath_hdr",
"//include/core:SkSpan_hdr", "//include/core:SkSpan_hdr",
"//include/core:SkSurface_hdr", "//include/core:SkSurface_hdr",
@ -2246,7 +2249,7 @@ generated_cc_atom(
":GrNativeRect_hdr", ":GrNativeRect_hdr",
":GrSubRunAllocator_hdr", ":GrSubRunAllocator_hdr",
":GrSurfaceProxy_hdr", ":GrSurfaceProxy_hdr",
":GrSwizzle_hdr", ":Swizzle_hdr",
"//include/private:GrTypesPriv_hdr", "//include/private:GrTypesPriv_hdr",
"//src/core:SkArenaAlloc_hdr", "//src/core:SkArenaAlloc_hdr",
], ],
@ -2750,8 +2753,8 @@ generated_cc_atom(
deps = [ deps = [
":GrRenderTargetProxy_hdr", ":GrRenderTargetProxy_hdr",
":GrSurfaceProxy_hdr", ":GrSurfaceProxy_hdr",
":GrSwizzle_hdr",
":GrTextureProxy_hdr", ":GrTextureProxy_hdr",
":Swizzle_hdr",
"//include/core:SkRefCnt_hdr", "//include/core:SkRefCnt_hdr",
"//include/gpu:GrTypes_hdr", "//include/gpu:GrTypes_hdr",
], ],
@ -2825,27 +2828,6 @@ generated_cc_atom(
], ],
) )
generated_cc_atom(
name = "GrSwizzle_hdr",
hdrs = ["GrSwizzle.h"],
visibility = ["//:__subpackages__"],
deps = [
":GrColor_hdr",
"//include/core:SkString_hdr",
"//include/private:SkColorData_hdr",
],
)
generated_cc_atom(
name = "GrSwizzle_src",
srcs = ["GrSwizzle.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":GrSwizzle_hdr",
"//src/core:SkRasterPipeline_hdr",
],
)
generated_cc_atom( generated_cc_atom(
name = "GrTTopoSort_hdr", name = "GrTTopoSort_hdr",
hdrs = ["GrTTopoSort.h"], hdrs = ["GrTTopoSort.h"],
@ -3492,3 +3474,23 @@ generated_cc_atom(
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = ["//include/core:SkTypes_hdr"], deps = ["//include/core:SkTypes_hdr"],
) )
generated_cc_atom(
name = "Swizzle_hdr",
hdrs = ["Swizzle.h"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkString_hdr",
"//include/private:SkColorData_hdr",
],
)
generated_cc_atom(
name = "Swizzle_src",
srcs = ["Swizzle.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":Swizzle_hdr",
"//src/core:SkRasterPipeline_hdr",
],
)

View File

@ -111,7 +111,7 @@ generated_cc_atom(
"//include/private:SkTArray_hdr", "//include/private:SkTArray_hdr",
"//include/private:SkTHash_hdr", "//include/private:SkTHash_hdr",
"//src/gpu:GrCaps_hdr", "//src/gpu:GrCaps_hdr",
"//src/gpu:GrSwizzle_hdr", "//src/gpu:Swizzle_hdr",
], ],
) )
@ -495,7 +495,7 @@ generated_cc_atom(
":GrGLDefines_hdr", ":GrGLDefines_hdr",
"//include/core:SkScalar_hdr", "//include/core:SkScalar_hdr",
"//include/private:GrGLTypesPriv_hdr", "//include/private:GrGLTypesPriv_hdr",
"//src/gpu:GrSwizzle_hdr", "//src/gpu:Swizzle_hdr",
], ],
) )

View File

@ -36,8 +36,8 @@ generated_cc_atom(
"//src/gpu:GrPersistentCacheUtils_hdr", "//src/gpu:GrPersistentCacheUtils_hdr",
"//src/gpu:GrProgramDesc_hdr", "//src/gpu:GrProgramDesc_hdr",
"//src/gpu:GrShaderCaps_hdr", "//src/gpu:GrShaderCaps_hdr",
"//src/gpu:GrSwizzle_hdr",
"//src/gpu:GrXferProcessor_hdr", "//src/gpu:GrXferProcessor_hdr",
"//src/gpu:Swizzle_hdr",
"//src/gpu/gl:GrGLGpu_hdr", "//src/gpu/gl:GrGLGpu_hdr",
"//src/gpu/gl:GrGLProgram_hdr", "//src/gpu/gl:GrGLProgram_hdr",
"//src/gpu/glsl:GrGLSLProgramDataManager_hdr", "//src/gpu/glsl:GrGLSLProgramDataManager_hdr",

View File

@ -145,7 +145,7 @@ generated_cc_atom(
"//include/sksl:DSL_hdr", "//include/sksl:DSL_hdr",
"//src/gpu:GrShaderCaps_hdr", "//src/gpu:GrShaderCaps_hdr",
"//src/gpu:GrShaderVar_hdr", "//src/gpu:GrShaderVar_hdr",
"//src/gpu:GrSwizzle_hdr", "//src/gpu:Swizzle_hdr",
"//src/sksl:SkSLThreadContext_hdr", "//src/sksl:SkSLThreadContext_hdr",
"//src/sksl/ir:SkSLVarDeclarations_hdr", "//src/sksl/ir:SkSLVarDeclarations_hdr",
], ],
@ -158,7 +158,7 @@ generated_cc_atom(
deps = [ deps = [
":GrGLSLProgramDataManager_hdr", ":GrGLSLProgramDataManager_hdr",
"//src/gpu:GrShaderVar_hdr", "//src/gpu:GrShaderVar_hdr",
"//src/gpu:GrSwizzle_hdr", "//src/gpu:Swizzle_hdr",
], ],
) )

View File

@ -106,6 +106,8 @@ generated_cc_atom(
deps = [ deps = [
"//include/core:SkCanvas_hdr", "//include/core:SkCanvas_hdr",
"//include/private/chromium:GrSlug_hdr", "//include/private/chromium:GrSlug_hdr",
"//src/core:SkReadBuffer_hdr",
"//src/core:SkWriteBuffer_hdr",
], ],
) )
@ -167,10 +169,12 @@ generated_cc_atom(
"//include/gpu:GrRecordingContext_hdr", "//include/gpu:GrRecordingContext_hdr",
"//include/private:SkTemplates_hdr", "//include/private:SkTemplates_hdr",
"//include/private/chromium:GrSlug_hdr", "//include/private/chromium:GrSlug_hdr",
"//include/private/chromium:SkChromeRemoteGlyphCache_hdr",
"//src/core:SkFontPriv_hdr", "//src/core:SkFontPriv_hdr",
"//src/core:SkMaskFilterBase_hdr", "//src/core:SkMaskFilterBase_hdr",
"//src/core:SkMatrixProvider_hdr", "//src/core:SkMatrixProvider_hdr",
"//src/core:SkPaintPriv_hdr", "//src/core:SkPaintPriv_hdr",
"//src/core:SkReadBuffer_hdr",
"//src/core:SkStrikeCache_hdr", "//src/core:SkStrikeCache_hdr",
"//src/core:SkStrikeSpec_hdr", "//src/core:SkStrikeSpec_hdr",
"//src/gpu:GrBlurUtils_hdr", "//src/gpu:GrBlurUtils_hdr",
@ -235,6 +239,7 @@ generated_cc_atom(
deps = [ deps = [
":GrAtlasManager_hdr", ":GrAtlasManager_hdr",
":GrGlyphVector_hdr", ":GrGlyphVector_hdr",
"//include/private/chromium:SkChromeRemoteGlyphCache_hdr",
"//src/core:SkReadBuffer_hdr", "//src/core:SkReadBuffer_hdr",
"//src/core:SkStrikeCache_hdr", "//src/core:SkStrikeCache_hdr",
"//src/core:SkStrikeSpec_hdr", "//src/core:SkStrikeSpec_hdr",

View File

@ -110,6 +110,7 @@ generated_cc_atom(
"//src/core:SkStroke_hdr", "//src/core:SkStroke_hdr",
"//src/core:SkTLazy_hdr", "//src/core:SkTLazy_hdr",
"//src/core:SkVerticesPriv_hdr", "//src/core:SkVerticesPriv_hdr",
"//src/core:SkWriteBuffer_hdr",
"//src/gpu:GrBlurUtils_hdr", "//src/gpu:GrBlurUtils_hdr",
"//src/gpu:GrDirectContextPriv_hdr", "//src/gpu:GrDirectContextPriv_hdr",
"//src/gpu:GrGpu_hdr", "//src/gpu:GrGpu_hdr",
@ -350,8 +351,8 @@ generated_cc_atom(
"//include/core:SkSize_hdr", "//include/core:SkSize_hdr",
"//include/private:GrTypesPriv_hdr", "//include/private:GrTypesPriv_hdr",
"//src/gpu:GrImageInfo_hdr", "//src/gpu:GrImageInfo_hdr",
"//src/gpu:GrSwizzle_hdr",
"//src/gpu:SurfaceFillContext_hdr", "//src/gpu:SurfaceFillContext_hdr",
"//src/gpu:Swizzle_hdr",
"//src/gpu/ops:OpsTask_hdr", "//src/gpu/ops:OpsTask_hdr",
], ],
) )

View File

@ -11,12 +11,15 @@
#include "src/core/SkArenaAlloc.h" #include "src/core/SkArenaAlloc.h"
#include "src/core/SkColorSpacePriv.h" #include "src/core/SkColorSpacePriv.h"
#include "src/core/SkColorSpaceXformSteps.h" #include "src/core/SkColorSpaceXformSteps.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkRasterPipeline.h" #include "src/core/SkRasterPipeline.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkUtils.h" #include "src/core/SkUtils.h"
#include "src/core/SkVM.h" #include "src/core/SkVM.h"
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
SkColorShader::SkColorShader(SkColor c) : fColor(c) {} SkColorShader::SkColorShader(SkColor c) : fColor(c) {}
bool SkColorShader::isOpaque() const { bool SkColorShader::isOpaque() const {
@ -137,6 +140,7 @@ std::unique_ptr<GrFragmentProcessor> SkColor4Shader::asFragmentProcessor(
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkColorShader::addToKey(SkShaderCodeDictionary* dict, void SkColorShader::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -149,3 +153,4 @@ void SkColor4Shader::addToKey(SkShaderCodeDictionary* dict,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
SolidColorShaderBlock::AddToKey(dict, builder, uniformBlock, fColor); SolidColorShaderBlock::AddToKey(dict, builder, uniformBlock, fColor);
} }
#endif

View File

@ -10,6 +10,8 @@
#include "src/shaders/SkShaderBase.h" #include "src/shaders/SkShaderBase.h"
class SkShaderCodeDictionary;
/** \class SkColorShader /** \class SkColorShader
A Shader that represents a single color. In general, this effect can be A Shader that represents a single color. In general, this effect can be
accomplished by just using the color field on the paint, but if an accomplished by just using the color field on the paint, but if an
@ -31,9 +33,12 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
private: private:
SK_FLATTENABLE_HOOKS(SkColorShader) SK_FLATTENABLE_HOOKS(SkColorShader)
@ -64,9 +69,11 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
private: private:
SK_FLATTENABLE_HOOKS(SkColor4Shader) SK_FLATTENABLE_HOOKS(SkColor4Shader)

View File

@ -11,7 +11,6 @@
#include "src/core/SkArenaAlloc.h" #include "src/core/SkArenaAlloc.h"
#include "src/core/SkBlendModePriv.h" #include "src/core/SkBlendModePriv.h"
#include "src/core/SkBlenderBase.h" #include "src/core/SkBlenderBase.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkRasterPipeline.h" #include "src/core/SkRasterPipeline.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkRuntimeEffectPriv.h" #include "src/core/SkRuntimeEffectPriv.h"
@ -20,6 +19,10 @@
#include "src/shaders/SkColorShader.h" #include "src/shaders/SkColorShader.h"
#include "src/shaders/SkComposeShader.h" #include "src/shaders/SkComposeShader.h"
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
namespace { namespace {
struct LocalMatrixStageRec final : public SkStageRec { struct LocalMatrixStageRec final : public SkStageRec {
@ -189,6 +192,7 @@ std::unique_ptr<GrFragmentProcessor> SkShader_Blend::asFragmentProcessor(
} }
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkShader_Blend::addToKey(SkShaderCodeDictionary* dict, void SkShader_Blend::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -197,3 +201,4 @@ void SkShader_Blend::addToKey(SkShaderCodeDictionary* dict,
BlendShaderBlock::AddToKey(dict, builder, uniformBlock, { fDst.get(), fSrc.get(), fMode }); BlendShaderBlock::AddToKey(dict, builder, uniformBlock, { fDst.get(), fSrc.get(), fMode });
} }
#endif

View File

@ -13,6 +13,8 @@
#include "src/core/SkBlenderBase.h" #include "src/core/SkBlenderBase.h"
#include "src/shaders/SkShaderBase.h" #include "src/shaders/SkShaderBase.h"
class SkShaderCodeDictionary;
class SkShader_Blend final : public SkShaderBase { class SkShader_Blend final : public SkShaderBase {
public: public:
SkShader_Blend(SkBlendMode mode, sk_sp<SkShader> dst, sk_sp<SkShader> src) SkShader_Blend(SkBlendMode mode, sk_sp<SkShader> dst, sk_sp<SkShader> src)
@ -28,9 +30,11 @@ public:
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
protected: protected:
SkShader_Blend(SkReadBuffer&); SkShader_Blend(SkReadBuffer&);

View File

@ -11,7 +11,6 @@
#include "src/core/SkArenaAlloc.h" #include "src/core/SkArenaAlloc.h"
#include "src/core/SkColorSpacePriv.h" #include "src/core/SkColorSpacePriv.h"
#include "src/core/SkColorSpaceXformSteps.h" #include "src/core/SkColorSpaceXformSteps.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkMatrixPriv.h" #include "src/core/SkMatrixPriv.h"
#include "src/core/SkMatrixProvider.h" #include "src/core/SkMatrixProvider.h"
#include "src/core/SkMipmapAccessor.h" #include "src/core/SkMipmapAccessor.h"
@ -27,6 +26,10 @@
#include "src/shaders/SkEmptyShader.h" #include "src/shaders/SkEmptyShader.h"
#include "src/shaders/SkTransformShader.h" #include "src/shaders/SkTransformShader.h"
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
SkM44 SkImageShader::CubicResamplerMatrix(float B, float C) { SkM44 SkImageShader::CubicResamplerMatrix(float B, float C) {
#if 0 #if 0
constexpr SkM44 kMitchell = SkM44( 1.f/18.f, -9.f/18.f, 15.f/18.f, -7.f/18.f, constexpr SkM44 kMitchell = SkM44( 1.f/18.f, -9.f/18.f, 15.f/18.f, -7.f/18.f,
@ -373,11 +376,13 @@ std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkImageShader::addToKey(SkShaderCodeDictionary* dict, void SkImageShader::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
ImageShaderBlock::AddToKey(dict, builder, uniformBlock, { fTileModeX, fTileModeY }); ImageShaderBlock::AddToKey(dict, builder, uniformBlock, { fTileModeX, fTileModeY });
} }
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#include "src/core/SkImagePriv.h" #include "src/core/SkImagePriv.h"

View File

@ -13,6 +13,8 @@
#include "src/shaders/SkBitmapProcShader.h" #include "src/shaders/SkBitmapProcShader.h"
#include "src/shaders/SkShaderBase.h" #include "src/shaders/SkShaderBase.h"
class SkShaderCodeDictionary;
class SkImageShader : public SkShaderBase { class SkImageShader : public SkShaderBase {
public: public:
static sk_sp<SkShader> Make(sk_sp<SkImage>, static sk_sp<SkShader> Make(sk_sp<SkImage>,
@ -43,11 +45,11 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
static SkM44 CubicResamplerMatrix(float B, float C); static SkM44 CubicResamplerMatrix(float B, float C);
private: private:

View File

@ -12,7 +12,6 @@
#include "src/core/SkArenaAlloc.h" #include "src/core/SkArenaAlloc.h"
#include "src/core/SkColorSpacePriv.h" #include "src/core/SkColorSpacePriv.h"
#include "src/core/SkColorSpaceXformSteps.h" #include "src/core/SkColorSpaceXformSteps.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkMatrixProvider.h" #include "src/core/SkMatrixProvider.h"
#include "src/core/SkRasterPipeline.h" #include "src/core/SkRasterPipeline.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
@ -31,6 +30,10 @@
#include "src/gpu/GrFragmentProcessor.h" #include "src/gpu/GrFragmentProcessor.h"
#endif #endif
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
SkShaderBase::SkShaderBase(const SkMatrix* localMatrix) SkShaderBase::SkShaderBase(const SkMatrix* localMatrix)
: fLocalMatrix(localMatrix ? *localMatrix : SkMatrix::I()) { : fLocalMatrix(localMatrix ? *localMatrix : SkMatrix::I()) {
// Pre-cache so future calls to fLocalMatrix.getType() are threadsafe. // Pre-cache so future calls to fLocalMatrix.getType() are threadsafe.
@ -149,12 +152,14 @@ SkUpdatableShader* SkShaderBase::onUpdatableShader(SkArenaAlloc* alloc) const {
return nullptr; return nullptr;
} }
#ifdef SK_ENABLE_SKSL
// TODO: add implementations for derived classes // TODO: add implementations for derived classes
void SkShaderBase::addToKey(SkShaderCodeDictionary* dict, void SkShaderBase::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
SolidColorShaderBlock::AddToKey(dict, builder, uniformBlock, SkColors::kRed); SolidColorShaderBlock::AddToKey(dict, builder, uniformBlock, SkColors::kRed);
} }
#endif
sk_sp<SkShader> SkShaders::Empty() { return sk_make_sp<SkEmptyShader>(); } sk_sp<SkShader> SkShaders::Empty() { return sk_make_sp<SkEmptyShader>(); }
sk_sp<SkShader> SkShaders::Color(SkColor color) { return sk_make_sp<SkColorShader>(color); } sk_sp<SkShader> SkShaders::Color(SkColor color) { return sk_make_sp<SkColorShader>(color); }

View File

@ -214,6 +214,7 @@ public:
skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const; skvm::Uniforms* uniforms, SkArenaAlloc* alloc) const;
#ifdef SK_ENABLE_SKSL
/** /**
Add implementation details, for the specified backend, of this SkShader to the Add implementation details, for the specified backend, of this SkShader to the
provided key. provided key.
@ -225,6 +226,7 @@ public:
virtual void addToKey(SkShaderCodeDictionary* dictionary, virtual void addToKey(SkShaderCodeDictionary* dictionary,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const; SkUniformBlock* uniformBlock) const;
#endif
protected: protected:
SkShaderBase(const SkMatrix* localMatrix = nullptr); SkShaderBase(const SkMatrix* localMatrix = nullptr);

View File

@ -7,11 +7,15 @@
#include "src/shaders/gradients/SkLinearGradient.h" #include "src/shaders/gradients/SkLinearGradient.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h" #include "src/core/SkWriteBuffer.h"
#include "src/shaders/gradients/Sk4fLinearGradient.h" #include "src/shaders/gradients/Sk4fLinearGradient.h"
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
static SkMatrix pts_to_unit_matrix(const SkPoint pts[2]) { static SkMatrix pts_to_unit_matrix(const SkPoint pts[2]) {
SkVector vec = pts[1] - pts[0]; SkVector vec = pts[1] - pts[0];
SkScalar mag = vec.length(); SkScalar mag = vec.length();
@ -104,6 +108,7 @@ std::unique_ptr<GrFragmentProcessor> SkLinearGradient::asFragmentProcessor(
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkLinearGradient::addToKey(SkShaderCodeDictionary* dict, void SkLinearGradient::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -117,3 +122,4 @@ void SkLinearGradient::addToKey(SkShaderCodeDictionary* dict,
GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data); GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data);
} }
#endif

View File

@ -10,6 +10,8 @@
#include "src/shaders/gradients/SkGradientShaderPriv.h" #include "src/shaders/gradients/SkGradientShaderPriv.h"
class SkShaderCodeDictionary;
class SkLinearGradient : public SkGradientShaderBase { class SkLinearGradient : public SkGradientShaderBase {
public: public:
SkLinearGradient(const SkPoint pts[2], const Descriptor&); SkLinearGradient(const SkPoint pts[2], const Descriptor&);
@ -18,9 +20,11 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
protected: protected:
SkLinearGradient(SkReadBuffer& buffer); SkLinearGradient(SkReadBuffer& buffer);

View File

@ -7,11 +7,14 @@
#include "src/shaders/gradients/SkRadialGradient.h" #include "src/shaders/gradients/SkRadialGradient.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkRasterPipeline.h" #include "src/core/SkRasterPipeline.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h" #include "src/core/SkWriteBuffer.h"
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
namespace { namespace {
SkMatrix rad_to_unit_matrix(const SkPoint& center, SkScalar radius) { SkMatrix rad_to_unit_matrix(const SkPoint& center, SkScalar radius) {
@ -83,6 +86,7 @@ std::unique_ptr<GrFragmentProcessor> SkRadialGradient::asFragmentProcessor(
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkRadialGradient::addToKey(SkShaderCodeDictionary* dict, void SkRadialGradient::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -96,3 +100,4 @@ void SkRadialGradient::addToKey(SkShaderCodeDictionary* dict,
GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data); GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data);
} }
#endif

View File

@ -10,6 +10,8 @@
#include "src/shaders/gradients/SkGradientShaderPriv.h" #include "src/shaders/gradients/SkGradientShaderPriv.h"
class SkShaderCodeDictionary;
class SkRadialGradient final : public SkGradientShaderBase { class SkRadialGradient final : public SkGradientShaderBase {
public: public:
SkRadialGradient(const SkPoint& center, SkScalar radius, const Descriptor&); SkRadialGradient(const SkPoint& center, SkScalar radius, const Descriptor&);
@ -18,10 +20,11 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
protected: protected:
SkRadialGradient(SkReadBuffer& buffer); SkRadialGradient(SkReadBuffer& buffer);
void flatten(SkWriteBuffer& buffer) const override; void flatten(SkWriteBuffer& buffer) const override;

View File

@ -8,11 +8,14 @@
#include "src/shaders/gradients/SkSweepGradient.h" #include "src/shaders/gradients/SkSweepGradient.h"
#include "include/private/SkFloatingPoint.h" #include "include/private/SkFloatingPoint.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkRasterPipeline.h" #include "src/core/SkRasterPipeline.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h" #include "src/core/SkWriteBuffer.h"
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
SkSweepGradient::SkSweepGradient(const SkPoint& center, SkScalar t0, SkScalar t1, SkSweepGradient::SkSweepGradient(const SkPoint& center, SkScalar t0, SkScalar t1,
const Descriptor& desc) const Descriptor& desc)
: SkGradientShaderBase(desc, SkMatrix::Translate(-center.x(), -center.y())) : SkGradientShaderBase(desc, SkMatrix::Translate(-center.x(), -center.y()))
@ -107,6 +110,7 @@ std::unique_ptr<GrFragmentProcessor> SkSweepGradient::asFragmentProcessor(
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkSweepGradient::addToKey(SkShaderCodeDictionary* dict, void SkSweepGradient::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -120,3 +124,4 @@ void SkSweepGradient::addToKey(SkShaderCodeDictionary* dict,
GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data); GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data);
} }
#endif

View File

@ -10,6 +10,8 @@
#include "src/shaders/gradients/SkGradientShaderPriv.h" #include "src/shaders/gradients/SkGradientShaderPriv.h"
class SkShaderCodeDictionary;
class SkSweepGradient final : public SkGradientShaderBase { class SkSweepGradient final : public SkGradientShaderBase {
public: public:
SkSweepGradient(const SkPoint& center, SkScalar t0, SkScalar t1, const Descriptor&); SkSweepGradient(const SkPoint& center, SkScalar t0, SkScalar t1, const Descriptor&);
@ -19,9 +21,11 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
SkScalar getTBias() const { return fTBias; } SkScalar getTBias() const { return fTBias; }

View File

@ -8,13 +8,16 @@
#include "src/shaders/gradients/SkTwoPointConicalGradient.h" #include "src/shaders/gradients/SkTwoPointConicalGradient.h"
#include "include/private/SkFloatingPoint.h" #include "include/private/SkFloatingPoint.h"
#include "src/core/SkKeyHelpers.h"
#include "src/core/SkRasterPipeline.h" #include "src/core/SkRasterPipeline.h"
#include "src/core/SkReadBuffer.h" #include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h" #include "src/core/SkWriteBuffer.h"
#include <utility> #include <utility>
#ifdef SK_ENABLE_SKSL
#include "src/core/SkKeyHelpers.h"
#endif
// Please see https://skia.org/dev/design/conical for how our shader works. // Please see https://skia.org/dev/design/conical for how our shader works.
bool SkTwoPointConicalGradient::FocalData::set(SkScalar r0, SkScalar r1, SkMatrix* matrix) { bool SkTwoPointConicalGradient::FocalData::set(SkScalar r0, SkScalar r1, SkMatrix* matrix) {
@ -277,6 +280,7 @@ std::unique_ptr<GrFragmentProcessor> SkTwoPointConicalGradient::asFragmentProces
#endif #endif
#ifdef SK_ENABLE_SKSL
void SkTwoPointConicalGradient::addToKey(SkShaderCodeDictionary* dict, void SkTwoPointConicalGradient::addToKey(SkShaderCodeDictionary* dict,
SkPaintParamsKeyBuilder* builder, SkPaintParamsKeyBuilder* builder,
SkUniformBlock* uniformBlock) const { SkUniformBlock* uniformBlock) const {
@ -290,3 +294,4 @@ void SkTwoPointConicalGradient::addToKey(SkShaderCodeDictionary* dict,
GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data); GradientShaderBlocks::AddToKey(dict, builder, uniformBlock, data);
} }
#endif

View File

@ -10,6 +10,8 @@
#include "src/shaders/gradients/SkGradientShaderPriv.h" #include "src/shaders/gradients/SkGradientShaderPriv.h"
class SkShaderCodeDictionary;
class SkTwoPointConicalGradient final : public SkGradientShaderBase { class SkTwoPointConicalGradient final : public SkGradientShaderBase {
public: public:
// See https://skia.org/dev/design/conical for what focal data means and how our shader works. // See https://skia.org/dev/design/conical for what focal data means and how our shader works.
@ -51,10 +53,11 @@ public:
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
#endif #endif
#ifdef SK_ENABLE_SKSL
void addToKey(SkShaderCodeDictionary*, void addToKey(SkShaderCodeDictionary*,
SkPaintParamsKeyBuilder*, SkPaintParamsKeyBuilder*,
SkUniformBlock*) const override; SkUniformBlock*) const override;
#endif
bool isOpaque() const override; bool isOpaque() const override;
SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2); } SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2); }

View File

@ -769,10 +769,7 @@ generated_cc_atom(
name = "SkSLString_src", name = "SkSLString_src",
srcs = ["SkSLString.cpp"], srcs = ["SkSLString.cpp"],
visibility = ["//:__subpackages__"], visibility = ["//:__subpackages__"],
deps = [ deps = ["//include/private:SkSLString_hdr"],
":SkSLUtil_hdr",
"//include/private:SkSLString_hdr",
],
) )
generated_cc_atom( generated_cc_atom(

View File

@ -2875,6 +2875,7 @@ generated_cc_atom(
"//src/core:SkSpecialSurface_hdr", "//src/core:SkSpecialSurface_hdr",
"//src/gpu:GrCaps_hdr", "//src/gpu:GrCaps_hdr",
"//src/gpu:GrRecordingContextPriv_hdr", "//src/gpu:GrRecordingContextPriv_hdr",
"//src/image:SkImage_Base_hdr",
"//tools:Resources_hdr", "//tools:Resources_hdr",
"//tools:ToolUtils_hdr", "//tools:ToolUtils_hdr",
], ],
@ -5572,7 +5573,7 @@ generated_cc_atom(
"//include/private:SkHalf_hdr", "//include/private:SkHalf_hdr",
"//include/private:SkTo_hdr", "//include/private:SkTo_hdr",
"//src/core:SkRasterPipeline_hdr", "//src/core:SkRasterPipeline_hdr",
"//src/gpu:GrSwizzle_hdr", "//src/gpu:Swizzle_hdr",
], ],
) )
@ -5592,6 +5593,7 @@ generated_cc_atom(
"//include/private/chromium:SkChromeRemoteGlyphCache_hdr", "//include/private/chromium:SkChromeRemoteGlyphCache_hdr",
"//src/core:SkDraw_hdr", "//src/core:SkDraw_hdr",
"//src/core:SkFontPriv_hdr", "//src/core:SkFontPriv_hdr",
"//src/core:SkReadBuffer_hdr",
"//src/core:SkScalerCache_hdr", "//src/core:SkScalerCache_hdr",
"//src/core:SkStrikeCache_hdr", "//src/core:SkStrikeCache_hdr",
"//src/core:SkStrikeSpec_hdr", "//src/core:SkStrikeSpec_hdr",
@ -7031,3 +7033,16 @@ generated_cc_atom(
"//src/gpu/text:GrGlyphVector_hdr", "//src/gpu/text:GrGlyphVector_hdr",
], ],
) )
generated_cc_atom(
name = "SaveLayerOriginTest_src",
srcs = ["SaveLayerOriginTest.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":TestUtils_hdr",
":Test_hdr",
"//include/core:SkCanvas_hdr",
"//include/core:SkSurface_hdr",
"//include/gpu:GrDirectContext_hdr",
],
)

View File

@ -18,21 +18,6 @@ generated_cc_atom(
], ],
) )
generated_cc_atom(
name = "ComboTest_src",
srcs = ["ComboTest.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//include/core:SkCanvas_hdr",
"//include/core:SkSurface_hdr",
"//include/effects:SkGradientShader_hdr",
"//src/core:SkPaintParamsKey_hdr",
"//src/core:SkPaintPriv_hdr",
"//src/core:SkShaderCodeDictionary_hdr",
"//tests:Test_hdr",
],
)
generated_cc_atom( generated_cc_atom(
name = "CommandBufferTest_src", name = "CommandBufferTest_src",
srcs = ["CommandBufferTest.cpp"], srcs = ["CommandBufferTest.cpp"],
@ -165,3 +150,15 @@ generated_cc_atom(
"//tests:Test_hdr", "//tests:Test_hdr",
], ],
) )
generated_cc_atom(
name = "KeyTest_src",
srcs = ["KeyTest.cpp"],
visibility = ["//:__subpackages__"],
deps = [
"//experimental/graphite/src:ContextPriv_hdr",
"//src/core:SkPaintParamsKey_hdr",
"//src/core:SkShaderCodeDictionary_hdr",
"//tests:Test_hdr",
],
)