| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 SkAutoTUnref<const GrFragmentProcessor> fp( | 117 SkAutoTUnref<const GrFragmentProcessor> fp( |
| 118 GrTextureDomainEffect::Create(texture, textureMatrices[t
m], | 118 GrTextureDomainEffect::Create(texture, textureMatrices[t
m], |
| 119 GrTextureDomain::MakeTexelDomain
(texture, | 119 GrTextureDomain::MakeTexelDomain
(texture, |
| 120
texelDomains[d]), | 120
texelDomains[d]), |
| 121 mode, GrTextureParams::kNone_Fil
terMode)); | 121 mode, GrTextureParams::kNone_Fil
terMode)); |
| 122 | 122 |
| 123 if (!fp) { | 123 if (!fp) { |
| 124 continue; | 124 continue; |
| 125 } | 125 } |
| 126 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); | 126 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); |
| 127 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar
get()); | |
| 128 pipelineBuilder.addColorFragmentProcessor(fp); | 127 pipelineBuilder.addColorFragmentProcessor(fp); |
| 129 | 128 |
| 130 SkAutoTUnref<GrDrawBatch> batch( | 129 SkAutoTUnref<GrDrawBatch> batch( |
| 131 GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, v
iewMatrix, | 130 GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, v
iewMatrix, |
| 132 renderRect, null
ptr, nullptr)); | 131 renderRect, null
ptr, nullptr)); |
| 133 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 132 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
| 134 x += renderRect.width() + kTestPad; | 133 x += renderRect.width() + kTestPad; |
| 135 } | 134 } |
| 136 y += renderRect.height() + kTestPad; | 135 y += renderRect.height() + kTestPad; |
| 137 } | 136 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 149 }; | 148 }; |
| 150 | 149 |
| 151 // Windows builds did not like SkScalar initialization in class :( | 150 // Windows builds did not like SkScalar initialization in class :( |
| 152 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 151 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
| 153 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 152 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
| 154 | 153 |
| 155 DEF_GM(return new TextureDomainEffect;) | 154 DEF_GM(return new TextureDomainEffect;) |
| 156 } | 155 } |
| 157 | 156 |
| 158 #endif | 157 #endif |
| OLD | NEW |