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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 /** This is used when there is a primitive color, but the shader should be ignor
ed. Currently, | 77 /** This is used when there is a primitive color, but the shader should be ignor
ed. Currently, |
78 the expectation is that the primitive color will be premultiplied, though it
really should be | 78 the expectation is that the primitive color will be premultiplied, though it
really should be |
79 unpremultiplied so that interpolation is done in unpremul space. The paint's
alpha will be | 79 unpremultiplied so that interpolation is done in unpremul space. The paint's
alpha will be |
80 applied to the primitive color after interpolation. */ | 80 applied to the primitive color after interpolation. */ |
81 inline bool SkPaintToGrPaintWithPrimitiveColor(GrContext* context, const SkPaint
& skPaint, | 81 inline bool SkPaintToGrPaintWithPrimitiveColor(GrContext* context, const SkPaint
& skPaint, |
82 GrPaint* grPaint) { | 82 GrPaint* grPaint) { |
83 return SkPaintToGrPaintWithXfermode(context, skPaint, SkMatrix::I(), SkXferm
ode::kDst_Mode, | 83 return SkPaintToGrPaintWithXfermode(context, skPaint, SkMatrix::I(), SkXferm
ode::kDst_Mode, |
84 false, grPaint); | 84 false, grPaint); |
85 } | 85 } |
86 | 86 |
| 87 /** This is used when there may or may not be a shader, and the caller wants to
plugin a texture |
| 88 lookup. If there is a shader, then its output will only be used if the text
ure is alpha8. */ |
| 89 bool SkPaintToGrPaintWithTexture(GrContext* context, |
| 90 const SkPaint& paint, |
| 91 const SkMatrix& viewM, |
| 92 const GrFragmentProcessor* fp, |
| 93 bool textureIsAlphaOnly, |
| 94 GrPaint* grPaint); |
| 95 |
87 ////////////////////////////////////////////////////////////////////////////// | 96 ////////////////////////////////////////////////////////////////////////////// |
88 | 97 |
89 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&); | 98 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&); |
90 | 99 |
91 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfi
leType*); | 100 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfi
leType*); |
92 | 101 |
93 /** | 102 /** |
94 * If the compressed data in the SkData is supported (as a texture format, this
returns | 103 * If the compressed data in the SkData is supported (as a texture format, this
returns |
95 * the pixel-config that should be used, and sets outStartOfDataToUpload to the
ptr into | 104 * the pixel-config that should be used, and sets outStartOfDataToUpload to the
ptr into |
96 * the data where the actual raw data starts (skipping any header bytes). | 105 * the data where the actual raw data starts (skipping any header bytes). |
(...skipping 23 matching lines...) Expand all Loading... |
120 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); | 129 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); |
121 GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff); | 130 GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff); |
122 GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff); | 131 GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff); |
123 GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff); | 132 GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff); |
124 GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff); | 133 GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff); |
125 GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10); | 134 GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10); |
126 | 135 |
127 #define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X)) | 136 #define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X)) |
128 | 137 |
129 #endif | 138 #endif |
OLD | NEW |