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