| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkGrPriv_DEFINED | 8 #ifndef SkGrPriv_DEFINED |
| 9 #define SkGrPriv_DEFINED | 9 #define SkGrPriv_DEFINED |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 bool SkPaintToGrPaintNoShader(GrContext* context, | 55 bool SkPaintToGrPaintNoShader(GrContext* context, |
| 56 const SkPaint& skPaint, | 56 const SkPaint& skPaint, |
| 57 bool allowSRGBInputs, | 57 bool allowSRGBInputs, |
| 58 GrPaint* grPaint); | 58 GrPaint* grPaint); |
| 59 | 59 |
| 60 /** Replaces the SkShader (if any) on skPaint with the passed in GrFragmentProce
ssor. The processor | 60 /** Replaces the SkShader (if any) on skPaint with the passed in GrFragmentProce
ssor. The processor |
| 61 should expect an unpremul input color and produce a premultiplied output col
or. There is | 61 should expect an unpremul input color and produce a premultiplied output col
or. There is |
| 62 no primitive color. */ | 62 no primitive color. */ |
| 63 bool SkPaintToGrPaintReplaceShader(GrContext*, | 63 bool SkPaintToGrPaintReplaceShader(GrContext*, |
| 64 const SkPaint& skPaint, | 64 const SkPaint& skPaint, |
| 65 const GrFragmentProcessor* shaderFP, | 65 sk_sp<GrFragmentProcessor> shaderFP, |
| 66 bool allowSRGBInputs, | 66 bool allowSRGBInputs, |
| 67 GrPaint* grPaint); | 67 GrPaint* grPaint); |
| 68 | 68 |
| 69 /** Blends the SkPaint's shader (or color if no shader) with the color which spe
cified via a | 69 /** Blends the SkPaint's shader (or color if no shader) with the color which spe
cified via a |
| 70 GrBatch's GrPrimitiveProcesssor. Currently there is a bool param to indicate
whether the | 70 GrBatch's GrPrimitiveProcesssor. Currently there is a bool param to indicate
whether the |
| 71 primitive color is the dst or src color to the blend in order to work around
differences between | 71 primitive color is the dst or src color to the blend in order to work around
differences between |
| 72 drawVertices and drawAtlas. */ | 72 drawVertices and drawAtlas. */ |
| 73 bool SkPaintToGrPaintWithXfermode(GrContext* context, | 73 bool SkPaintToGrPaintWithXfermode(GrContext* context, |
| 74 const SkPaint& skPaint, | 74 const SkPaint& skPaint, |
| 75 const SkMatrix& viewM, | 75 const SkMatrix& viewM, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 86 bool allowSRGBInputs, GrPaint* gr
Paint) { | 86 bool allowSRGBInputs, GrPaint* gr
Paint) { |
| 87 return SkPaintToGrPaintWithXfermode(context, skPaint, SkMatrix::I(), SkXferm
ode::kDst_Mode, | 87 return SkPaintToGrPaintWithXfermode(context, skPaint, SkMatrix::I(), SkXferm
ode::kDst_Mode, |
| 88 false, allowSRGBInputs, grPaint); | 88 false, allowSRGBInputs, grPaint); |
| 89 } | 89 } |
| 90 | 90 |
| 91 /** This is used when there may or may not be a shader, and the caller wants to
plugin a texture | 91 /** This is used when there may or may not be a shader, and the caller wants to
plugin a texture |
| 92 lookup. If there is a shader, then its output will only be used if the text
ure is alpha8. */ | 92 lookup. If there is a shader, then its output will only be used if the text
ure is alpha8. */ |
| 93 bool SkPaintToGrPaintWithTexture(GrContext* context, | 93 bool SkPaintToGrPaintWithTexture(GrContext* context, |
| 94 const SkPaint& paint, | 94 const SkPaint& paint, |
| 95 const SkMatrix& viewM, | 95 const SkMatrix& viewM, |
| 96 const GrFragmentProcessor* fp, | 96 sk_sp<GrFragmentProcessor> fp, |
| 97 bool textureIsAlphaOnly, | 97 bool textureIsAlphaOnly, |
| 98 bool allowSRGBInputs, | 98 bool allowSRGBInputs, |
| 99 GrPaint* grPaint); | 99 GrPaint* grPaint); |
| 100 | 100 |
| 101 ////////////////////////////////////////////////////////////////////////////// | 101 ////////////////////////////////////////////////////////////////////////////// |
| 102 | 102 |
| 103 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&); | 103 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&); |
| 104 | 104 |
| 105 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfi
leType*); | 105 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfi
leType*); |
| 106 | 106 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); | 147 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); |
| 148 GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff); | 148 GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff); |
| 149 GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff); | 149 GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff); |
| 150 GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff); | 150 GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff); |
| 151 GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff); | 151 GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff); |
| 152 GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10); | 152 GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10); |
| 153 | 153 |
| 154 #define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X)) | 154 #define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X)) |
| 155 | 155 |
| 156 #endif | 156 #endif |
| OLD | NEW |