| 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 "GrDistanceFieldGeoProc.h" | 8 #include "GrDistanceFieldGeoProc.h" |
| 9 #include "GrFontAtlasSizes.h" | 9 #include "GrFontAtlasSizes.h" |
| 10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
| 11 #include "GrTexture.h" | 11 #include "GrTexture.h" |
| 12 | 12 |
| 13 #include "SkDistanceFieldGen.h" | 13 #include "SkDistanceFieldGen.h" |
| 14 | 14 |
| 15 #include "gl/GrGLProcessor.h" | 15 #include "gl/GrGLProcessor.h" |
| 16 #include "gl/GrGLSL.h" | |
| 17 #include "gl/GrGLTexture.h" | 16 #include "gl/GrGLTexture.h" |
| 18 #include "gl/GrGLGeometryProcessor.h" | 17 #include "gl/GrGLGeometryProcessor.h" |
| 19 #include "gl/builders/GrGLProgramBuilder.h" | 18 #include "gl/builders/GrGLProgramBuilder.h" |
| 20 | 19 |
| 21 // Assuming a radius of a little less than the diagonal of the fragment | 20 // Assuming a radius of a little less than the diagonal of the fragment |
| 22 #define SK_DistanceFieldAAFactor "0.65" | 21 #define SK_DistanceFieldAAFactor "0.65" |
| 23 | 22 |
| 24 class GrGLDistanceFieldA8TextGeoProc : public GrGLGeometryProcessor { | 23 class GrGLDistanceFieldA8TextGeoProc : public GrGLGeometryProcessor { |
| 25 public: | 24 public: |
| 26 GrGLDistanceFieldA8TextGeoProc(const GrGeometryProcessor&, | 25 GrGLDistanceFieldA8TextGeoProc(const GrGeometryProcessor&, |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; | 746 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; |
| 748 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; | 747 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; |
| 749 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; | 748 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; |
| 750 return GrDistanceFieldLCDTextGeoProc::Create(GrRandomColor(random), | 749 return GrDistanceFieldLCDTextGeoProc::Create(GrRandomColor(random), |
| 751 GrTest::TestMatrix(random), | 750 GrTest::TestMatrix(random), |
| 752 textures[texIdx], params, | 751 textures[texIdx], params, |
| 753 wa, | 752 wa, |
| 754 flags, | 753 flags, |
| 755 random->nextBool()); | 754 random->nextBool()); |
| 756 } | 755 } |
| OLD | NEW |