OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp.width()), | 115 SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp.width()), |
116 SkIntToScalar(fBmp.height())); | 116 SkIntToScalar(fBmp.height())); |
117 renderRect.outset(kDrawPad, kDrawPad); | 117 renderRect.outset(kDrawPad, kDrawPad); |
118 | 118 |
119 SkScalar y = kDrawPad + kTestPad; | 119 SkScalar y = kDrawPad + kTestPad; |
120 for (int tm = 0; tm < textureMatrices.count(); ++tm) { | 120 for (int tm = 0; tm < textureMatrices.count(); ++tm) { |
121 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { | 121 for (size_t d = 0; d < SK_ARRAY_COUNT(texelDomains); ++d) { |
122 SkScalar x = kDrawPad + kTestPad; | 122 SkScalar x = kDrawPad + kTestPad; |
123 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { | 123 for (int m = 0; m < GrTextureDomain::kModeCount; ++m) { |
124 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; | 124 GrTextureDomain::Mode mode = (GrTextureDomain::Mode) m; |
125 SkAutoTUnref<GrEffectRef> effect( | 125 SkAutoTUnref<GrEffect> effect( |
126 GrTextureDomainEffect::Create(texture, textureMatrices[t
m], | 126 GrTextureDomainEffect::Create(texture, textureMatrices[t
m], |
127 GrTextureDomain::MakeTexelDomain
(texture, | 127 GrTextureDomain::MakeTexelDomain
(texture, |
128
texelDomains[d]), | 128
texelDomains[d]), |
129 mode, GrTextureParams::kNone_Fil
terMode)); | 129 mode, GrTextureParams::kNone_Fil
terMode)); |
130 | 130 |
131 if (!effect) { | 131 if (!effect) { |
132 continue; | 132 continue; |
133 } | 133 } |
134 SkMatrix viewMatrix; | 134 SkMatrix viewMatrix; |
135 viewMatrix.setTranslate(x, y); | 135 viewMatrix.setTranslate(x, y); |
(...skipping 14 matching lines...) Expand all Loading... |
150 private: | 150 private: |
151 SkBitmap fBmp; | 151 SkBitmap fBmp; |
152 | 152 |
153 typedef GM INHERITED; | 153 typedef GM INHERITED; |
154 }; | 154 }; |
155 | 155 |
156 DEF_GM( return SkNEW(TextureDomainEffect); ) | 156 DEF_GM( return SkNEW(TextureDomainEffect); ) |
157 } | 157 } |
158 | 158 |
159 #endif | 159 #endif |
OLD | NEW |