diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2018-02-01 12:14:34 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-01 18:22:03 +0000 |
commit | 130fb3f7aac19e40eddfc8fa85a9b39e7c99a7e8 (patch) | |
tree | 8daee5ab96a5bdc06e991ff8d1e370c011b6b7a5 | |
parent | 28eaed254dcd73b42c15b73528f349cccd7797e5 (diff) |
updated .fp file headers
Bug: skia:
Change-Id: I9c39622f34e803a706acd04372be569667380661
Reviewed-on: https://skia-review.googlesource.com/102204
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
58 files changed, 284 insertions, 172 deletions
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/effects/GrAlphaThresholdFragmentProcessor.cpp index 988d308db2..f174ff5285 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.cpp +++ b/src/effects/GrAlphaThresholdFragmentProcessor.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrAlphaThresholdFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrAlphaThresholdFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrAlphaThresholdFragmentProcessor.h" #if SK_SUPPORT_GPU diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.fp b/src/effects/GrAlphaThresholdFragmentProcessor.fp index f4470cab42..38d6a61bc5 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.fp +++ b/src/effects/GrAlphaThresholdFragmentProcessor.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + in uniform sampler2D mask; in uniform half innerThreshold; in uniform half outerThreshold; diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.h b/src/effects/GrAlphaThresholdFragmentProcessor.h index 5faf892ea4..37ce967a33 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.h +++ b/src/effects/GrAlphaThresholdFragmentProcessor.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrAlphaThresholdFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrAlphaThresholdFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrAlphaThresholdFragmentProcessor_DEFINED #define GrAlphaThresholdFragmentProcessor_DEFINED #include "SkTypes.h" diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp index 5579f8845b..31311e2e1c 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.cpp +++ b/src/effects/GrCircleBlurFragmentProcessor.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrCircleBlurFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrCircleBlurFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrCircleBlurFragmentProcessor.h" #if SK_SUPPORT_GPU diff --git a/src/effects/GrCircleBlurFragmentProcessor.fp b/src/effects/GrCircleBlurFragmentProcessor.fp index 6fc2e9e5d0..21c80079e5 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.fp +++ b/src/effects/GrCircleBlurFragmentProcessor.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + in half4 circleRect; in half textureRadius; in half solidRadius; diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h index 4b5c4b311f..25dcb9ade6 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.h +++ b/src/effects/GrCircleBlurFragmentProcessor.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrCircleBlurFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrCircleBlurFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrCircleBlurFragmentProcessor_DEFINED #define GrCircleBlurFragmentProcessor_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrAARectEffect.cpp b/src/gpu/effects/GrAARectEffect.cpp index 48ed6447a1..c1301980e3 100644 --- a/src/gpu/effects/GrAARectEffect.cpp +++ b/src/gpu/effects/GrAARectEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrAARectEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrAARectEffect.fp; do not modify. + **************************************************************************************************/ #include "GrAARectEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrAARectEffect.fp b/src/gpu/effects/GrAARectEffect.fp index b8449c2252..95064dd82e 100644 --- a/src/gpu/effects/GrAARectEffect.fp +++ b/src/gpu/effects/GrAARectEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + layout(key) in GrClipEdgeType edgeType; layout(ctype=SkRect) in float4 rect; layout(ctype=SkRect) float4 prevRect = float4(-1); diff --git a/src/gpu/effects/GrAARectEffect.h b/src/gpu/effects/GrAARectEffect.h index 21f20773f3..676f6c0abe 100644 --- a/src/gpu/effects/GrAARectEffect.h +++ b/src/gpu/effects/GrAARectEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrAARectEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrAARectEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrAARectEffect_DEFINED #define GrAARectEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrArithmeticFP.cpp b/src/gpu/effects/GrArithmeticFP.cpp index a9057059b7..5c381d91a7 100644 --- a/src/gpu/effects/GrArithmeticFP.cpp +++ b/src/gpu/effects/GrArithmeticFP.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrArithmeticFP.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrArithmeticFP.fp; do not modify. + **************************************************************************************************/ #include "GrArithmeticFP.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrArithmeticFP.fp b/src/gpu/effects/GrArithmeticFP.fp index 546fa79843..9aa6549a90 100644 --- a/src/gpu/effects/GrArithmeticFP.fp +++ b/src/gpu/effects/GrArithmeticFP.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + in float k1; in float k2; in float k3; diff --git a/src/gpu/effects/GrArithmeticFP.h b/src/gpu/effects/GrArithmeticFP.h index 940f1adcf4..3042b7e01c 100644 --- a/src/gpu/effects/GrArithmeticFP.h +++ b/src/gpu/effects/GrArithmeticFP.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrArithmeticFP.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrArithmeticFP.fp; do not modify. + **************************************************************************************************/ #ifndef GrArithmeticFP_DEFINED #define GrArithmeticFP_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp b/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp index a531d42116..532691499c 100644 --- a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp +++ b/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrBlurredEdgeFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrBlurredEdgeFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrBlurredEdgeFragmentProcessor.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h b/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h index 4a8f21521e..5fa50ea82c 100644 --- a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h +++ b/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrBlurredEdgeFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrBlurredEdgeFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrBlurredEdgeFragmentProcessor_DEFINED #define GrBlurredEdgeFragmentProcessor_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrCircleEffect.cpp b/src/gpu/effects/GrCircleEffect.cpp index ed3ad518b9..c5c21fa873 100644 --- a/src/gpu/effects/GrCircleEffect.cpp +++ b/src/gpu/effects/GrCircleEffect.cpp @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrCircleEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrCircleEffect.fp; do not modify. + **************************************************************************************************/ #include "GrCircleEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrCircleEffect.h b/src/gpu/effects/GrCircleEffect.h index cfc5aaf411..676075c052 100644 --- a/src/gpu/effects/GrCircleEffect.h +++ b/src/gpu/effects/GrCircleEffect.h @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrCircleEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrCircleEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrCircleEffect_DEFINED #define GrCircleEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index b1e4aa758f..b71a29d273 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrConfigConversionEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrConfigConversionEffect.fp; do not modify. + **************************************************************************************************/ #include "GrConfigConversionEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrConfigConversionEffect.fp b/src/gpu/effects/GrConfigConversionEffect.fp index 528eb8cbae..856195b0bd 100644 --- a/src/gpu/effects/GrConfigConversionEffect.fp +++ b/src/gpu/effects/GrConfigConversionEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + @header { #include "GrClip.h" #include "GrContext.h" diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h index f83105f7fe..b3709cafc8 100644 --- a/src/gpu/effects/GrConfigConversionEffect.h +++ b/src/gpu/effects/GrConfigConversionEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrConfigConversionEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrConfigConversionEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrConfigConversionEffect_DEFINED #define GrConfigConversionEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp index cfc910ab57..b72d44d5d1 100644 --- a/src/gpu/effects/GrConstColorProcessor.cpp +++ b/src/gpu/effects/GrConstColorProcessor.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrConstColorProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrConstColorProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrConstColorProcessor.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrConstColorProcessor.fp b/src/gpu/effects/GrConstColorProcessor.fp index d7db4f047c..dbad279331 100644 --- a/src/gpu/effects/GrConstColorProcessor.fp +++ b/src/gpu/effects/GrConstColorProcessor.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + enum class InputMode { kIgnore, kModulateRGBA, diff --git a/src/gpu/effects/GrConstColorProcessor.h b/src/gpu/effects/GrConstColorProcessor.h index 637c67a85f..65d50db1ba 100644 --- a/src/gpu/effects/GrConstColorProcessor.h +++ b/src/gpu/effects/GrConstColorProcessor.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrConstColorProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrConstColorProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrConstColorProcessor_DEFINED #define GrConstColorProcessor_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp index a66a40d2b7..9ca7b248a2 100644 --- a/src/gpu/effects/GrDitherEffect.cpp +++ b/src/gpu/effects/GrDitherEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrDitherEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrDitherEffect.fp; do not modify. + **************************************************************************************************/ #include "GrDitherEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrDitherEffect.fp b/src/gpu/effects/GrDitherEffect.fp index c47898e6ed..0f9b443802 100644 --- a/src/gpu/effects/GrDitherEffect.fp +++ b/src/gpu/effects/GrDitherEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + // This controls the range of values added to color channels layout(key) in int rangeType; diff --git a/src/gpu/effects/GrDitherEffect.h b/src/gpu/effects/GrDitherEffect.h index 1b944a852d..166ab716fb 100644 --- a/src/gpu/effects/GrDitherEffect.h +++ b/src/gpu/effects/GrDitherEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrDitherEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrDitherEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrDitherEffect_DEFINED #define GrDitherEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrEllipseEffect.cpp b/src/gpu/effects/GrEllipseEffect.cpp index 7ea975ffde..0d040cac95 100644 --- a/src/gpu/effects/GrEllipseEffect.cpp +++ b/src/gpu/effects/GrEllipseEffect.cpp @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrEllipseEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrEllipseEffect.fp; do not modify. + **************************************************************************************************/ #include "GrEllipseEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrEllipseEffect.h b/src/gpu/effects/GrEllipseEffect.h index b892f98a56..ef47cb03c7 100644 --- a/src/gpu/effects/GrEllipseEffect.h +++ b/src/gpu/effects/GrEllipseEffect.h @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrEllipseEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrEllipseEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrEllipseEffect_DEFINED #define GrEllipseEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrLumaColorFilterEffect.cpp b/src/gpu/effects/GrLumaColorFilterEffect.cpp index 6cd103086f..0fbbdd6d07 100644 --- a/src/gpu/effects/GrLumaColorFilterEffect.cpp +++ b/src/gpu/effects/GrLumaColorFilterEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrLumaColorFilterEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrLumaColorFilterEffect.fp; do not modify. + **************************************************************************************************/ #include "GrLumaColorFilterEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrLumaColorFilterEffect.fp b/src/gpu/effects/GrLumaColorFilterEffect.fp index b8b9fe047f..17f270b153 100644 --- a/src/gpu/effects/GrLumaColorFilterEffect.fp +++ b/src/gpu/effects/GrLumaColorFilterEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + @class { #include "SkColorData.h" diff --git a/src/gpu/effects/GrLumaColorFilterEffect.h b/src/gpu/effects/GrLumaColorFilterEffect.h index e77aeed532..45fda7499b 100644 --- a/src/gpu/effects/GrLumaColorFilterEffect.h +++ b/src/gpu/effects/GrLumaColorFilterEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrLumaColorFilterEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrLumaColorFilterEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrLumaColorFilterEffect_DEFINED #define GrLumaColorFilterEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrMagnifierEffect.cpp b/src/gpu/effects/GrMagnifierEffect.cpp index 7dfa07a499..eaaef10268 100644 --- a/src/gpu/effects/GrMagnifierEffect.cpp +++ b/src/gpu/effects/GrMagnifierEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrMagnifierEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrMagnifierEffect.fp; do not modify. + **************************************************************************************************/ #include "GrMagnifierEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrMagnifierEffect.fp b/src/gpu/effects/GrMagnifierEffect.fp index 962c1a0160..53245bb6be 100644 --- a/src/gpu/effects/GrMagnifierEffect.fp +++ b/src/gpu/effects/GrMagnifierEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + in uniform sampler2D src; layout(ctype=SkIRect) in int4 bounds; uniform float4 boundsUniform; diff --git a/src/gpu/effects/GrMagnifierEffect.h b/src/gpu/effects/GrMagnifierEffect.h index 13904f983f..4100095d9e 100644 --- a/src/gpu/effects/GrMagnifierEffect.h +++ b/src/gpu/effects/GrMagnifierEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrMagnifierEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrMagnifierEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrMagnifierEffect_DEFINED #define GrMagnifierEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrOverdrawFragmentProcessor.cpp b/src/gpu/effects/GrOverdrawFragmentProcessor.cpp index 9d9e4fecc3..89b4caab95 100644 --- a/src/gpu/effects/GrOverdrawFragmentProcessor.cpp +++ b/src/gpu/effects/GrOverdrawFragmentProcessor.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrOverdrawFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrOverdrawFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrOverdrawFragmentProcessor.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrOverdrawFragmentProcessor.fp b/src/gpu/effects/GrOverdrawFragmentProcessor.fp index 2e9df97ee2..9ee69153ef 100644 --- a/src/gpu/effects/GrOverdrawFragmentProcessor.fp +++ b/src/gpu/effects/GrOverdrawFragmentProcessor.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + layout(ctype=SkPMColor) in half4 color0; layout(ctype=SkPMColor) in half4 color1; layout(ctype=SkPMColor) in half4 color2; diff --git a/src/gpu/effects/GrOverdrawFragmentProcessor.h b/src/gpu/effects/GrOverdrawFragmentProcessor.h index 2b468feac5..6d5f008701 100644 --- a/src/gpu/effects/GrOverdrawFragmentProcessor.h +++ b/src/gpu/effects/GrOverdrawFragmentProcessor.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrOverdrawFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrOverdrawFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrOverdrawFragmentProcessor_DEFINED #define GrOverdrawFragmentProcessor_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrPremulInputFragmentProcessor.cpp b/src/gpu/effects/GrPremulInputFragmentProcessor.cpp index 2e3beceec3..49ab53df75 100644 --- a/src/gpu/effects/GrPremulInputFragmentProcessor.cpp +++ b/src/gpu/effects/GrPremulInputFragmentProcessor.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrPremulInputFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrPremulInputFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrPremulInputFragmentProcessor.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrPremulInputFragmentProcessor.fp b/src/gpu/effects/GrPremulInputFragmentProcessor.fp index 5a0d6c5f96..65fd255d1b 100644 --- a/src/gpu/effects/GrPremulInputFragmentProcessor.fp +++ b/src/gpu/effects/GrPremulInputFragmentProcessor.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + @optimizationFlags { kPreservesOpaqueInput_OptimizationFlag | kConstantOutputForConstantInput_OptimizationFlag } diff --git a/src/gpu/effects/GrPremulInputFragmentProcessor.h b/src/gpu/effects/GrPremulInputFragmentProcessor.h index cc74e7e544..5f005c138d 100644 --- a/src/gpu/effects/GrPremulInputFragmentProcessor.h +++ b/src/gpu/effects/GrPremulInputFragmentProcessor.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrPremulInputFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrPremulInputFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrPremulInputFragmentProcessor_DEFINED #define GrPremulInputFragmentProcessor_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrRRectBlurEffect.cpp b/src/gpu/effects/GrRRectBlurEffect.cpp index b1792d7192..e83ef17605 100644 --- a/src/gpu/effects/GrRRectBlurEffect.cpp +++ b/src/gpu/effects/GrRRectBlurEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrRRectBlurEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrRRectBlurEffect.fp; do not modify. + **************************************************************************************************/ #include "GrRRectBlurEffect.h" #if SK_SUPPORT_GPU diff --git a/src/gpu/effects/GrRRectBlurEffect.fp b/src/gpu/effects/GrRRectBlurEffect.fp index 3724331ccd..3f817d5331 100644 --- a/src/gpu/effects/GrRRectBlurEffect.fp +++ b/src/gpu/effects/GrRRectBlurEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + in float sigma; layout(ctype=SkRect) in float4 rect; in uniform float cornerRadius; diff --git a/src/gpu/effects/GrRRectBlurEffect.h b/src/gpu/effects/GrRRectBlurEffect.h index 7b2c341f40..3fd6f0c976 100644 --- a/src/gpu/effects/GrRRectBlurEffect.h +++ b/src/gpu/effects/GrRRectBlurEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrRRectBlurEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrRRectBlurEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrRRectBlurEffect_DEFINED #define GrRRectBlurEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrRectBlurEffect.cpp b/src/gpu/effects/GrRectBlurEffect.cpp index f886ae3db2..4f2c4bacdb 100644 --- a/src/gpu/effects/GrRectBlurEffect.cpp +++ b/src/gpu/effects/GrRectBlurEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrRectBlurEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrRectBlurEffect.fp; do not modify. + **************************************************************************************************/ #include "GrRectBlurEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrRectBlurEffect.fp b/src/gpu/effects/GrRectBlurEffect.fp index 7a54613afe..762942aaa4 100644 --- a/src/gpu/effects/GrRectBlurEffect.fp +++ b/src/gpu/effects/GrRectBlurEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + @header { #include "GrProxyProvider.h" #include "../effects/SkBlurMask.h" diff --git a/src/gpu/effects/GrRectBlurEffect.h b/src/gpu/effects/GrRectBlurEffect.h index c878808453..91177072a1 100644 --- a/src/gpu/effects/GrRectBlurEffect.h +++ b/src/gpu/effects/GrRectBlurEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrRectBlurEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrRectBlurEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrRectBlurEffect_DEFINED #define GrRectBlurEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp index 1c49dd5315..9e6e9cf991 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.cpp +++ b/src/gpu/effects/GrSimpleTextureEffect.cpp @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrSimpleTextureEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrSimpleTextureEffect.fp; do not modify. + **************************************************************************************************/ #include "GrSimpleTextureEffect.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h index ffa6da66a0..119f11e305 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.h +++ b/src/gpu/effects/GrSimpleTextureEffect.h @@ -5,9 +5,9 @@ * found in the LICENSE file. */ -/* - * This file was autogenerated from GrSimpleTextureEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrSimpleTextureEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrSimpleTextureEffect_DEFINED #define GrSimpleTextureEffect_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp b/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp index 6e33763f9d..e9888123e5 100644 --- a/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp +++ b/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrUnpremulInputFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrUnpremulInputFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #include "GrUnpremulInputFragmentProcessor.h" #if SK_SUPPORT_GPU #include "glsl/GrGLSLFragmentProcessor.h" diff --git a/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp b/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp index 65395f34fc..53ab9c9cb2 100644 --- a/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp +++ b/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + @optimizationFlags { kPreservesOpaqueInput_OptimizationFlag | kConstantOutputForConstantInput_OptimizationFlag } diff --git a/src/gpu/effects/GrUnpremulInputFragmentProcessor.h b/src/gpu/effects/GrUnpremulInputFragmentProcessor.h index 2e61f8b68b..56e9d3095b 100644 --- a/src/gpu/effects/GrUnpremulInputFragmentProcessor.h +++ b/src/gpu/effects/GrUnpremulInputFragmentProcessor.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrUnpremulInputFragmentProcessor.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrUnpremulInputFragmentProcessor.fp; do not modify. + **************************************************************************************************/ #ifndef GrUnpremulInputFragmentProcessor_DEFINED #define GrUnpremulInputFragmentProcessor_DEFINED #include "SkTypes.h" diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp index 5279890be3..d5b71b81f5 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.cpp +++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrYUVtoRGBEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrYUVtoRGBEffect.fp; do not modify. + **************************************************************************************************/ #include "GrYUVtoRGBEffect.h" #if SK_SUPPORT_GPU diff --git a/src/gpu/effects/GrYUVtoRGBEffect.fp b/src/gpu/effects/GrYUVtoRGBEffect.fp index 0565b885d6..9b08fbd13a 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.fp +++ b/src/gpu/effects/GrYUVtoRGBEffect.fp @@ -1,3 +1,10 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + in uniform sampler2D ySampler; in half4x4 ySamplerTransform; @coordTransform(ySampler) { diff --git a/src/gpu/effects/GrYUVtoRGBEffect.h b/src/gpu/effects/GrYUVtoRGBEffect.h index 68223efa1e..3fe075f8fb 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.h +++ b/src/gpu/effects/GrYUVtoRGBEffect.h @@ -1,13 +1,13 @@ /* - * Copyright 2017 Google Inc. + * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -/* - * This file was autogenerated from GrYUVtoRGBEffect.fp; do not modify. - */ +/************************************************************************************************** + *** This file was autogenerated from GrYUVtoRGBEffect.fp; do not modify. + **************************************************************************************************/ #ifndef GrYUVtoRGBEffect_DEFINED #define GrYUVtoRGBEffect_DEFINED #include "SkTypes.h" diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp index d6a6a25eac..7b35ca8f90 100644 --- a/src/sksl/SkSLCPPCodeGenerator.cpp +++ b/src/sksl/SkSLCPPCodeGenerator.cpp @@ -764,6 +764,7 @@ bool CPPCodeGenerator::generateCode() { } const char* baseName = fName.c_str(); const char* fullName = fFullName.c_str(); + this->writef("%s\n", HCodeGenerator::GetHeader(fProgram, fErrors).c_str()); this->writef(kFragmentProcessorHeader, fullName); this->writef("#include \"%s.h\"\n" "#if SK_SUPPORT_GPU\n", fullName); diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp index 819b85a515..9750aabb87 100644 --- a/src/sksl/SkSLHCodeGenerator.cpp +++ b/src/sksl/SkSLHCodeGenerator.cpp @@ -7,6 +7,7 @@ #include "SkSLHCodeGenerator.h" +#include "SkSLParser.h" #include "SkSLUtil.h" #include "ir/SkSLEnum.h" #include "ir/SkSLFunctionDeclaration.h" @@ -252,7 +253,24 @@ void HCodeGenerator::writeFields() { } } +String HCodeGenerator::GetHeader(const Program& program, ErrorReporter& errors) { + SymbolTable types(&errors); + Parser parser(program.fSource->c_str(), program.fSource->length(), types, errors); + for (;;) { + Token header = parser.nextRawToken(); + switch (header.fKind) { + case Token::WHITESPACE: + break; + case Token::BLOCK_COMMENT: + return String(program.fSource->c_str() + header.fOffset, header.fLength); + default: + return ""; + } + } +} + bool HCodeGenerator::generateCode() { + this->writef("%s\n", GetHeader(fProgram, fErrors).c_str()); this->writef(kFragmentProcessorHeader, fFullName.c_str()); this->writef("#ifndef %s_DEFINED\n" "#define %s_DEFINED\n", diff --git a/src/sksl/SkSLHCodeGenerator.h b/src/sksl/SkSLHCodeGenerator.h index fa5544a0e0..c6031b2779 100644 --- a/src/sksl/SkSLHCodeGenerator.h +++ b/src/sksl/SkSLHCodeGenerator.h @@ -16,16 +16,10 @@ #include <cctype> constexpr const char* kFragmentProcessorHeader = -R"(/* - * Copyright 2017 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* - * This file was autogenerated from %s.fp; do not modify. - */ +R"( +/************************************************************************************************** + *** This file was autogenerated from %s.fp; do not modify. + **************************************************************************************************/ )"; namespace SkSL { @@ -45,6 +39,8 @@ public: return String::printf("f%c%s", toupper(varName[0]), varName + 1); } + static String GetHeader(const Program& program, ErrorReporter& errors); + private: void writef(const char* s, va_list va) SKSL_PRINTF_LIKE(2, 0); diff --git a/src/sksl/SkSLParser.h b/src/sksl/SkSLParser.h index 51e689ecff..f067c48be9 100644 --- a/src/sksl/SkSLParser.h +++ b/src/sksl/SkSLParser.h @@ -242,6 +242,7 @@ private: ErrorReporter& fErrors; friend class AutoDepth; + friend class HCodeGenerator; }; } // namespace diff --git a/tests/SkSLFPTest.cpp b/tests/SkSLFPTest.cpp index 982591082b..f1a65fcfdb 100644 --- a/tests/SkSLFPTest.cpp +++ b/tests/SkSLFPTest.cpp @@ -61,21 +61,17 @@ static void test(skiatest::Reporter* r, const char* src, const GrShaderCaps& cap DEF_TEST(SkSLFPHelloWorld, r) { test(r, + "/* HEADER */" "void main() {" "sk_OutColor = half4(1);" "}", *SkSL::ShaderCapsFactory::Default(), { - "/*\n" - " * Copyright 2017 Google Inc.\n" - " *\n" - " * Use of this source code is governed by a BSD-style license that can be\n" - " * found in the LICENSE file.\n" - " */\n" + "/* HEADER */\n" "\n" - "/*\n" - " * This file was autogenerated from GrTest.fp; do not modify.\n" - " */\n" + "/**************************************************************************************************\n" + " *** This file was autogenerated from GrTest.fp; do not modify.\n" + " **************************************************************************************************/\n" "#ifndef GrTest_DEFINED\n" "#define GrTest_DEFINED\n" "#include \"SkTypes.h\"\n" @@ -105,16 +101,11 @@ DEF_TEST(SkSLFPHelloWorld, r) { "#endif\n" }, { - "/*\n" - " * Copyright 2017 Google Inc.\n" - " *\n" - " * Use of this source code is governed by a BSD-style license that can be\n" - " * found in the LICENSE file.\n" - " */\n" + "/* HEADER */\n" "\n" - "/*\n" - " * This file was autogenerated from GrTest.fp; do not modify.\n" - " */\n" + "/**************************************************************************************************\n" + " *** This file was autogenerated from GrTest.fp; do not modify.\n" + " **************************************************************************************************/\n" "#include \"GrTest.h\"\n" "#if SK_SUPPORT_GPU\n" "#include \"glsl/GrGLSLFragmentProcessor.h\"\n" |