| 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 |
| 11 #include "gm.h" | 11 #include "gm.h" |
| 12 | 12 |
| 13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
| 14 #include "GrContext.h" | 14 #include "GrContext.h" |
| 15 #include "effects/GrSimpleTextureEffect.h" |
| 15 #include "SkColorPriv.h" | 16 #include "SkColorPriv.h" |
| 16 #include "effects/GrPorterDuffXferProcessor.h" | |
| 17 #include "effects/GrSimpleTextureEffect.h" | |
| 18 | 17 |
| 19 namespace skiagm { | 18 namespace skiagm { |
| 20 | 19 |
| 21 static const int S = 200; | 20 static const int S = 200; |
| 22 | 21 |
| 23 class TexDataGM : public GM { | 22 class TexDataGM : public GM { |
| 24 public: | 23 public: |
| 25 TexDataGM() { | 24 TexDataGM() { |
| 26 this->setBGColor(0xff000000); | 25 this->setBGColor(0xff000000); |
| 27 } | 26 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (!texture) { | 91 if (!texture) { |
| 93 return; | 92 return; |
| 94 } | 93 } |
| 95 SkAutoTUnref<GrTexture> au(texture); | 94 SkAutoTUnref<GrTexture> au(texture); |
| 96 | 95 |
| 97 GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S)); | 96 GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S)); |
| 98 | 97 |
| 99 ctx->setRenderTarget(target); | 98 ctx->setRenderTarget(target); |
| 100 | 99 |
| 101 GrPaint paint; | 100 GrPaint paint; |
| 102 paint.setPorterDuffXPFactory(SkXfermode::kSrcOver_Mode); | 101 paint.setBlendFunc(kOne_GrBlendCoeff, kISA_GrBlendCoeff); |
| 103 | |
| 104 SkMatrix vm; | 102 SkMatrix vm; |
| 105 if (i) { | 103 if (i) { |
| 106 vm.setRotate(90 * SK_Scalar1, | 104 vm.setRotate(90 * SK_Scalar1, |
| 107 S * SK_Scalar1, | 105 S * SK_Scalar1, |
| 108 S * SK_Scalar1); | 106 S * SK_Scalar1); |
| 109 } else { | 107 } else { |
| 110 vm.reset(); | 108 vm.reset(); |
| 111 } | 109 } |
| 112 ctx->setMatrix(vm); | 110 ctx->setMatrix(vm); |
| 113 SkMatrix tm; | 111 SkMatrix tm; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 139 }; | 137 }; |
| 140 | 138 |
| 141 ////////////////////////////////////////////////////////////////////////////// | 139 ////////////////////////////////////////////////////////////////////////////// |
| 142 | 140 |
| 143 static GM* MyFactory(void*) { return new TexDataGM; } | 141 static GM* MyFactory(void*) { return new TexDataGM; } |
| 144 static GMRegistry reg(MyFactory); | 142 static GMRegistry reg(MyFactory); |
| 145 | 143 |
| 146 } | 144 } |
| 147 | 145 |
| 148 #endif | 146 #endif |
| OLD | NEW |