OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 SkScalar y = kDrawPad + kTestPad; | 109 SkScalar y = kDrawPad + kTestPad; |
110 for (int tm = 0; tm < textureMatrices.count(); ++tm) { | 110 for (int tm = 0; tm < textureMatrices.count(); ++tm) { |
111 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { | 111 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { |
112 SkScalar x = kDrawPad + kTestPad; | 112 SkScalar x = kDrawPad + kTestPad; |
113 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { | 113 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { |
114 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; | 114 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; |
115 GrPaint grPaint; | 115 GrPaint grPaint; |
116 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode:
:kSrc_Mode)); | 116 grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode:
:kSrc_Mode)); |
117 sk_sp<GrFragmentProcessor> fp( | 117 sk_sp<GrFragmentProcessor> fp( |
118 GrTextureDomainEffect::Make(texture, textureMatrices[tm]
, | 118 GrTextureDomainEffect::Make(texture, nullptr, textureMat
rices[tm], |
119 GrTextureDomain::MakeTexelDomain
(texture, | 119 GrTextureDomain::MakeTexelDomain
(texture, |
120
texelDomains[d]), | 120
texelDomains[d]), |
121 mode, GrTextureParams::kNone_Fil
terMode)); | 121 mode, GrTextureParams::kNone_Fil
terMode)); |
122 | 122 |
123 if (!fp) { | 123 if (!fp) { |
124 continue; | 124 continue; |
125 } | 125 } |
126 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); | 126 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); |
127 grPaint.addColorFragmentProcessor(std::move(fp)); | 127 grPaint.addColorFragmentProcessor(std::move(fp)); |
128 | 128 |
(...skipping 19 matching lines...) Expand all Loading... |
148 }; | 148 }; |
149 | 149 |
150 // Windows builds did not like SkScalar initialization in class :( | 150 // Windows builds did not like SkScalar initialization in class :( |
151 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 151 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
152 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 152 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
153 | 153 |
154 DEF_GM(return new TextureDomainEffect;) | 154 DEF_GM(return new TextureDomainEffect;) |
155 } | 155 } |
156 | 156 |
157 #endif | 157 #endif |
OLD | NEW |