OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkDither.h" | 8 #include "SkDither.h" |
9 #include "SkPerlinNoiseShader.h" | 9 #include "SkPerlinNoiseShader.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 const SkPerlinNoiseShader::StitchData& stitchData = turbulence.stitchDat
a(); | 939 const SkPerlinNoiseShader::StitchData& stitchData = turbulence.stitchDat
a(); |
940 uman.set2f(fStitchDataUni, SkIntToScalar(stitchData.fWidth), | 940 uman.set2f(fStitchDataUni, SkIntToScalar(stitchData.fWidth), |
941 SkIntToScalar(stitchData.fHeight)); | 941 SkIntToScalar(stitchData.fHeight)); |
942 } | 942 } |
943 } | 943 } |
944 | 944 |
945 ///////////////////////////////////////////////////////////////////// | 945 ///////////////////////////////////////////////////////////////////// |
946 | 946 |
947 bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, | 947 bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, |
948 const SkMatrix* externalLocalMatrix, GrCol
or* grColor, | 948 const SkMatrix* externalLocalMatrix, GrCol
or* grColor, |
949 GrEffectRef** grEffect) const { | 949 GrEffect** grEffect) const { |
950 SkASSERT(NULL != context); | 950 SkASSERT(NULL != context); |
951 | 951 |
952 *grColor = SkColor2GrColorJustAlpha(paint.getColor()); | 952 *grColor = SkColor2GrColorJustAlpha(paint.getColor()); |
953 | 953 |
954 SkMatrix localMatrix = this->getLocalMatrix(); | 954 SkMatrix localMatrix = this->getLocalMatrix(); |
955 if (externalLocalMatrix) { | 955 if (externalLocalMatrix) { |
956 localMatrix.preConcat(*externalLocalMatrix); | 956 localMatrix.preConcat(*externalLocalMatrix); |
957 } | 957 } |
958 | 958 |
959 SkMatrix matrix = context->getMatrix(); | 959 SkMatrix matrix = context->getMatrix(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 GrUnlockAndUnrefCachedBitmapTexture(noiseTexture); | 1004 GrUnlockAndUnrefCachedBitmapTexture(noiseTexture); |
1005 } | 1005 } |
1006 | 1006 |
1007 return true; | 1007 return true; |
1008 } | 1008 } |
1009 | 1009 |
1010 #else | 1010 #else |
1011 | 1011 |
1012 bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, | 1012 bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, |
1013 const SkMatrix* externalLocalMatrix, GrCol
or* grColor, | 1013 const SkMatrix* externalLocalMatrix, GrCol
or* grColor, |
1014 GrEffectRef** grEffect) const { | 1014 GrEffect** grEffect) const { |
1015 SkDEBUGFAIL("Should not call in GPU-less build"); | 1015 SkDEBUGFAIL("Should not call in GPU-less build"); |
1016 return false; | 1016 return false; |
1017 } | 1017 } |
1018 | 1018 |
1019 #endif | 1019 #endif |
1020 | 1020 |
1021 #ifndef SK_IGNORE_TO_STRING | 1021 #ifndef SK_IGNORE_TO_STRING |
1022 void SkPerlinNoiseShader::toString(SkString* str) const { | 1022 void SkPerlinNoiseShader::toString(SkString* str) const { |
1023 str->append("SkPerlinNoiseShader: ("); | 1023 str->append("SkPerlinNoiseShader: ("); |
1024 | 1024 |
(...skipping 18 matching lines...) Expand all Loading... |
1043 str->append(" seed: "); | 1043 str->append(" seed: "); |
1044 str->appendScalar(fSeed); | 1044 str->appendScalar(fSeed); |
1045 str->append(" stitch tiles: "); | 1045 str->append(" stitch tiles: "); |
1046 str->append(fStitchTiles ? "true " : "false "); | 1046 str->append(fStitchTiles ? "true " : "false "); |
1047 | 1047 |
1048 this->INHERITED::toString(str); | 1048 this->INHERITED::toString(str); |
1049 | 1049 |
1050 str->append(")"); | 1050 str->append(")"); |
1051 } | 1051 } |
1052 #endif | 1052 #endif |
OLD | NEW |