| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 desc.fHeight = 2 * S; | 75 desc.fHeight = 2 * S; |
| 76 GrTexture* texture = context->textureProvider()->createTexture( | 76 GrTexture* texture = context->textureProvider()->createTexture( |
| 77 desc, SkBudgeted::kNo, gTextureData.get(), 0); | 77 desc, SkBudgeted::kNo, gTextureData.get(), 0); |
| 78 | 78 |
| 79 if (!texture) { | 79 if (!texture) { |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 SkAutoTUnref<GrTexture> au(texture); | 82 SkAutoTUnref<GrTexture> au(texture); |
| 83 | 83 |
| 84 // setup new clip | 84 // setup new clip |
| 85 GrClip clip(SkRect::MakeWH(2*S, 2*S)); | 85 GrFixedClip clip(SkIRect::MakeWH(2*S, 2*S)); |
| 86 | 86 |
| 87 GrPaint paint; | 87 GrPaint paint; |
| 88 paint.setPorterDuffXPFactory(SkXfermode::kSrcOver_Mode); | 88 paint.setPorterDuffXPFactory(SkXfermode::kSrcOver_Mode); |
| 89 | 89 |
| 90 SkMatrix vm; | 90 SkMatrix vm; |
| 91 if (i) { | 91 if (i) { |
| 92 vm.setRotate(90 * SK_Scalar1, | 92 vm.setRotate(90 * SK_Scalar1, |
| 93 S * SK_Scalar1, | 93 S * SK_Scalar1, |
| 94 S * SK_Scalar1); | 94 S * SK_Scalar1); |
| 95 } else { | 95 } else { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 texture->writePixels(S, (i ? 0 : S), S, S, | 114 texture->writePixels(S, (i ? 0 : S), S, S, |
| 115 texture->config(), gTextureData.get(), | 115 texture->config(), gTextureData.get(), |
| 116 4 * stride); | 116 4 * stride); |
| 117 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S)); | 117 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S)); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 #endif | 120 #endif |
| 121 | 121 |
| OLD | NEW |