| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 vm.setRotate(90 * SK_Scalar1, | 104 vm.setRotate(90 * SK_Scalar1, |
| 105 S * SK_Scalar1, | 105 S * SK_Scalar1, |
| 106 S * SK_Scalar1); | 106 S * SK_Scalar1); |
| 107 } else { | 107 } else { |
| 108 vm.reset(); | 108 vm.reset(); |
| 109 } | 109 } |
| 110 ctx->setMatrix(vm); | 110 ctx->setMatrix(vm); |
| 111 SkMatrix tm; | 111 SkMatrix tm; |
| 112 tm = vm; | 112 tm = vm; |
| 113 tm.postIDiv(2*S, 2*S); | 113 tm.postIDiv(2*S, 2*S); |
| 114 paint.addColorTextureEffect(texture, tm); | 114 paint.addColorTextureProcessor(texture, tm); |
| 115 | 115 |
| 116 ctx->drawRect(paint, SkRect::MakeWH(2*S, 2*S)); | 116 ctx->drawRect(paint, SkRect::MakeWH(2*S, 2*S)); |
| 117 | 117 |
| 118 // now update the lower right of the texture in first pass | 118 // now update the lower right of the texture in first pass |
| 119 // or upper right in second pass | 119 // or upper right in second pass |
| 120 offset = 0; | 120 offset = 0; |
| 121 for (int y = 0; y < S; ++y) { | 121 for (int y = 0; y < S; ++y) { |
| 122 for (int x = 0; x < S; ++x) { | 122 for (int x = 0; x < S; ++x) { |
| 123 gTextureData[offset + y * stride + x] = | 123 gTextureData[offset + y * stride + x] = |
| 124 ((x + y) % 2) ? (i ? green : red) : blue; | 124 ((x + y) % 2) ? (i ? green : red) : blue; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 ////////////////////////////////////////////////////////////////////////////// | 139 ////////////////////////////////////////////////////////////////////////////// |
| 140 | 140 |
| 141 static GM* MyFactory(void*) { return new TexDataGM; } | 141 static GM* MyFactory(void*) { return new TexDataGM; } |
| 142 static GMRegistry reg(MyFactory); | 142 static GMRegistry reg(MyFactory); |
| 143 | 143 |
| 144 } | 144 } |
| 145 | 145 |
| 146 #endif | 146 #endif |
| OLD | NEW |