| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 for (int m = 0; m < GrConstColorProcessor::kInputModeCnt; ++m) { | 84 for (int m = 0; m < GrConstColorProcessor::kInputModeCnt; ++m) { |
| 85 // translate by x,y for the canvas draws and the test target
draws. | 85 // translate by x,y for the canvas draws and the test target
draws. |
| 86 canvas->save(); | 86 canvas->save(); |
| 87 canvas->translate(x, y); | 87 canvas->translate(x, y); |
| 88 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); | 88 const SkMatrix viewMatrix = SkMatrix::MakeTrans(x, y); |
| 89 | 89 |
| 90 // rect to draw | 90 // rect to draw |
| 91 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS
ize); | 91 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS
ize); |
| 92 | 92 |
| 93 GrTestTarget tt; | 93 GrTestTarget tt; |
| 94 context->getTestTarget(&tt); | 94 context->getTestTarget(&tt, rt); |
| 95 if (nullptr == tt.target()) { | 95 if (nullptr == tt.target()) { |
| 96 SkDEBUGFAIL("Couldn't get Gr test target."); | 96 SkDEBUGFAIL("Couldn't get Gr test target."); |
| 97 return; | 97 return; |
| 98 } | 98 } |
| 99 | 99 |
| 100 GrPaint grPaint; | 100 GrPaint grPaint; |
| 101 SkPaint skPaint; | 101 SkPaint skPaint; |
| 102 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { | 102 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { |
| 103 skPaint.setShader(fShader); | 103 skPaint.setShader(fShader); |
| 104 } else { | 104 } else { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 typedef GM INHERITED; | 188 typedef GM INHERITED; |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 const SkScalar ConstColorProcessor::kPad = 10.f; | 191 const SkScalar ConstColorProcessor::kPad = 10.f; |
| 192 const SkScalar ConstColorProcessor::kRectSize = 20.f; | 192 const SkScalar ConstColorProcessor::kRectSize = 20.f; |
| 193 | 193 |
| 194 DEF_GM(return new ConstColorProcessor;) | 194 DEF_GM(return new ConstColorProcessor;) |
| 195 } | 195 } |
| 196 | 196 |
| 197 #endif | 197 #endif |
| OLD | NEW |