| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 mode, GrTextureParams::kNone_Fil
terMode)); | 129 mode, GrTextureParams::kNone_Fil
terMode)); |
| 130 | 130 |
| 131 if (!effect) { | 131 if (!effect) { |
| 132 continue; | 132 continue; |
| 133 } | 133 } |
| 134 SkMatrix viewMatrix; | 134 SkMatrix viewMatrix; |
| 135 viewMatrix.setTranslate(x, y); | 135 viewMatrix.setTranslate(x, y); |
| 136 drawState->reset(viewMatrix); | 136 drawState->reset(viewMatrix); |
| 137 drawState->setRenderTarget(rt); | 137 drawState->setRenderTarget(rt); |
| 138 drawState->setColor(0xffffffff); | 138 drawState->setColor(0xffffffff); |
| 139 drawState->addColorEffect(effect, 1); | 139 drawState->addColorEffect(effect); |
| 140 | 140 |
| 141 tt.target()->drawSimpleRect(renderRect); | 141 tt.target()->drawSimpleRect(renderRect); |
| 142 x += renderRect.width() + kTestPad; | 142 x += renderRect.width() + kTestPad; |
| 143 } | 143 } |
| 144 y += renderRect.height() + kTestPad; | 144 y += renderRect.height() + kTestPad; |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 GrUnlockAndUnrefCachedBitmapTexture(texture); | 147 GrUnlockAndUnrefCachedBitmapTexture(texture); |
| 148 } | 148 } |
| 149 | 149 |
| 150 private: | 150 private: |
| 151 static const SkScalar kDrawPad; | 151 static const SkScalar kDrawPad; |
| 152 static const SkScalar kTestPad; | 152 static const SkScalar kTestPad; |
| 153 static const int kTargetWidth = 100; | 153 static const int kTargetWidth = 100; |
| 154 static const int kTargetHeight = 100; | 154 static const int kTargetHeight = 100; |
| 155 SkBitmap fBmp; | 155 SkBitmap fBmp; |
| 156 | 156 |
| 157 typedef GM INHERITED; | 157 typedef GM INHERITED; |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 // Windows builds did not like SkScalar initialization in class :( | 160 // Windows builds did not like SkScalar initialization in class :( |
| 161 const SkScalar TextureDomainEffect::kDrawPad = 10.f; | 161 const SkScalar TextureDomainEffect::kDrawPad = 10.f; |
| 162 const SkScalar TextureDomainEffect::kTestPad = 10.f; | 162 const SkScalar TextureDomainEffect::kTestPad = 10.f; |
| 163 | 163 |
| 164 DEF_GM( return SkNEW(TextureDomainEffect); ) | 164 DEF_GM( return SkNEW(TextureDomainEffect); ) |
| 165 } | 165 } |
| 166 | 166 |
| 167 #endif | 167 #endif |
| OLD | NEW |