| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 if (!fp) { | 124 if (!fp) { |
| 125 continue; | 125 continue; |
| 126 } | 126 } |
| 127 SkMatrix viewMatrix; | 127 SkMatrix viewMatrix; |
| 128 viewMatrix.setTranslate(x, y); | 128 viewMatrix.setTranslate(x, y); |
| 129 GrPipelineBuilder pipelineBuilder; | 129 GrPipelineBuilder pipelineBuilder; |
| 130 pipelineBuilder.setRenderTarget(rt); | 130 pipelineBuilder.setRenderTarget(rt); |
| 131 pipelineBuilder.addColorProcessor(fp); | 131 pipelineBuilder.addColorProcessor(fp); |
| 132 | 132 |
| 133 tt.target()->drawSimpleRect(&pipelineBuilder, GrColor_WHITE,
viewMatrix, | 133 tt.target()->drawSimpleRect(&pipelineBuilder, |
| 134 GrColor_WHITE, |
| 135 viewMatrix, |
| 134 renderRect); | 136 renderRect); |
| 135 x += renderRect.width() + kTestPad; | 137 x += renderRect.width() + kTestPad; |
| 136 } | 138 } |
| 137 y += renderRect.height() + kTestPad; | 139 y += renderRect.height() + kTestPad; |
| 138 } | 140 } |
| 139 } | 141 } |
| 140 } | 142 } |
| 141 | 143 |
| 142 private: | 144 private: |
| 143 static const SkScalar kDrawPad; | 145 static const SkScalar kDrawPad; |
| 144 static const SkScalar kTestPad; | 146 static const SkScalar kTestPad; |
| 145 static const int kTargetWidth = 100; | 147 static const int kTargetWidth = 100; |
| 146 static const int kTargetHeight = 100; | 148 static const int kTargetHeight = 100; |
| 147 SkBitmap fBmp; | 149 SkBitmap fBmp; |
| 148 | 150 |
| 149 typedef GM INHERITED; | 151 typedef GM INHERITED; |
| 150 }; | 152 }; |
| 151 | 153 |
| 152 // Windows builds did not like SkScalar initialization in class :( | 154 // Windows builds did not like SkScalar initialization in class :( |
| 153 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 155 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
| 154 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 156 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
| 155 | 157 |
| 156 DEF_GM( return SkNEW(TextureDomainEffect); ) | 158 DEF_GM( return SkNEW(TextureDomainEffect); ) |
| 157 } | 159 } |
| 158 | 160 |
| 159 #endif | 161 #endif |
| OLD | NEW |