OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmapProcShader.h" | 8 #include "SkBitmapProcShader.h" |
9 #include "SkBitmapProcState.h" | 9 #include "SkBitmapProcState.h" |
10 #include "SkBitmapProvider.h" | 10 #include "SkBitmapProvider.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 SkFilterQuality fFilterQuality; | 218 SkFilterQuality fFilterQuality; |
219 | 219 |
220 typedef BitmapProcInfoContext INHERITED; | 220 typedef BitmapProcInfoContext INHERITED; |
221 }; | 221 }; |
222 | 222 |
223 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 223 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
224 | 224 |
225 static bool choose_linear_pipeline(const SkShader::ContextRec& rec, const SkImag
eInfo& srcInfo) { | 225 static bool choose_linear_pipeline(const SkShader::ContextRec& rec, const SkImag
eInfo& srcInfo) { |
226 // These src attributes are not supported in the new 4f context (yet) | 226 // These src attributes are not supported in the new 4f context (yet) |
227 // | 227 // |
| 228 if (srcInfo.profileType() != kSRGB_SkColorProfileType) { return false; } |
228 if (srcInfo.colorType() != kRGBA_8888_SkColorType | 229 if (srcInfo.colorType() != kRGBA_8888_SkColorType |
229 && srcInfo.colorType() != kBGRA_8888_SkColorType | 230 && srcInfo.colorType() != kBGRA_8888_SkColorType |
230 && srcInfo.colorType() != kIndex_8_SkColorType | 231 && srcInfo.colorType() != kIndex_8_SkColorType |
231 && srcInfo.colorType() != kRGBA_F16_SkColorType) { | 232 && srcInfo.colorType() != kRGBA_F16_SkColorType) { |
232 return false; | 233 return false; |
233 } | 234 } |
234 | 235 |
235 // If we get here, we can reasonably use either context, respect the caller'
s preference | 236 // If we get here, we can reasonably use either context, respect the caller'
s preference |
236 // | 237 // |
237 return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType; | 238 return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); | 490 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); |
490 } | 491 } |
491 | 492 |
492 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { | 493 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { |
493 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); | 494 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); |
494 } | 495 } |
495 return GrFragmentProcessor::MulOutputByInputAlpha(inner); | 496 return GrFragmentProcessor::MulOutputByInputAlpha(inner); |
496 } | 497 } |
497 | 498 |
498 #endif | 499 #endif |
OLD | NEW |