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 #include "GrContext.h" | 8 #include "GrContext.h" |
9 #include "GrDrawContext.h" | 9 #include "GrDrawContext.h" |
10 #include "GrYUVProvider.h" | 10 #include "GrYUVProvider.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Otherwise, we do our shader math to go from YUV -> sRGB, manually convert
sRGB -> Linear, | 135 // Otherwise, we do our shader math to go from YUV -> sRGB, manually convert
sRGB -> Linear, |
136 // then let the HW convert Linear -> sRGB. | 136 // then let the HW convert Linear -> sRGB. |
137 if (GrPixelConfigIsSRGB(desc.fConfig)) { | 137 if (GrPixelConfigIsSRGB(desc.fConfig)) { |
138 if (ctx->caps()->srgbWriteControl()) { | 138 if (ctx->caps()->srgbWriteControl()) { |
139 paint.setDisableOutputConversionToSRGB(true); | 139 paint.setDisableOutputConversionToSRGB(true); |
140 } else { | 140 } else { |
141 paint.addColorFragmentProcessor(GrGammaEffect::Make(2.2f)); | 141 paint.addColorFragmentProcessor(GrGammaEffect::Make(2.2f)); |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 145 paint.setPorterDuffXPFactory(SkBlendMode::kSrc); |
146 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY]
.fWidth, | 146 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY]
.fWidth, |
147 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight); | 147 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight); |
148 | 148 |
149 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), r); | 149 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), r); |
150 | 150 |
151 return drawContext->asTexture(); | 151 return drawContext->asTexture(); |
152 } | 152 } |
OLD | NEW |