| 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 |
| 11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
| 12 #include "GrBlend.h" | 12 #include "GrBlend.h" |
| 13 #include "SkEncodedFormat.h" |
| 13 #include "SkImageInfo.h" | 14 #include "SkImageInfo.h" |
| 14 #include "SkMatrix.h" | 15 #include "SkMatrix.h" |
| 15 #include "SkXfermode.h" | 16 #include "SkXfermode.h" |
| 16 | 17 |
| 17 class GrCaps; | 18 class GrCaps; |
| 18 class GrContext; | 19 class GrContext; |
| 19 class GrFragmentProcessor; | 20 class GrFragmentProcessor; |
| 20 class GrPaint; | 21 class GrPaint; |
| 21 class GrTexture; | 22 class GrTexture; |
| 22 class GrTextureParams; | 23 class GrTextureParams; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 bool allowSRGBInputs, | 99 bool allowSRGBInputs, |
| 99 GrPaint* grPaint); | 100 GrPaint* grPaint); |
| 100 | 101 |
| 101 ////////////////////////////////////////////////////////////////////////////// | 102 ////////////////////////////////////////////////////////////////////////////// |
| 102 | 103 |
| 103 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&); | 104 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&); |
| 104 | 105 |
| 105 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfi
leType*); | 106 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfi
leType*); |
| 106 | 107 |
| 107 /** | 108 /** |
| 109 * Returns true if the specified encoded format might be supported on this GPU. |
| 110 */ |
| 111 bool GrIsCompressedFormatPossiblySupported(GrContext*, SkEncodedFormat); |
| 112 |
| 113 /** |
| 114 * Sniffs the provided data, and returns true if it might be supported by the g
pu. |
| 115 * If the format is not recognized, this returns false. |
| 116 * |
| 117 * Note: it is possible that even if true is returned, that the gpu may fail to
actually support |
| 118 * it as a texture, once the width/height are considered. |
| 119 * |
| 120 * See GrIsCompressedTextureDataPossiblySupported() |
| 121 */ |
| 122 bool GrIsCompressedTextureDataPossiblySupported(GrContext* ctx, const void* data
, size_t size); |
| 123 |
| 124 /** |
| 108 * If the compressed data in the SkData is supported (as a texture format, this
returns | 125 * If the compressed data in the SkData is supported (as a texture format, this
returns |
| 109 * the pixel-config that should be used, and sets outStartOfDataToUpload to the
ptr into | 126 * the pixel-config that should be used, and sets outStartOfDataToUpload to the
ptr into |
| 110 * the data where the actual raw data starts (skipping any header bytes). | 127 * the data where the actual raw data starts (skipping any header bytes). |
| 111 * | 128 * |
| 112 * If the compressed data is not supported, this returns kUnknown_GrPixelConfig
, and | 129 * If the compressed data is not supported, this returns kUnknown_GrPixelConfig
, and |
| 113 * ignores outStartOfDataToUpload. | 130 * ignores outStartOfDataToUpload. |
| 114 */ | 131 */ |
| 115 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, | 132 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, |
| 116 int expectedW, int expectedH, | 133 int expectedW, int expectedH, |
| 117 const void** outStartOfDataToUp
load); | 134 const void** outStartOfDataToUp
load); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 141 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); | 158 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); |
| 142 GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff); | 159 GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff); |
| 143 GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff); | 160 GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff); |
| 144 GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff); | 161 GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff); |
| 145 GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff); | 162 GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff); |
| 146 GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10); | 163 GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10); |
| 147 | 164 |
| 148 #define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X)) | 165 #define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X)) |
| 149 | 166 |
| 150 #endif | 167 #endif |
| OLD | NEW |