| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 is a GPU-backend specific test. It relies on static intializers to work | 9 // This is a GPU-backend specific test. It relies on static intializers to work |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 KeyHeader* header = this->header(); | 67 KeyHeader* header = this->header(); |
| 68 memset(header, 0, kHeaderSize); | 68 memset(header, 0, kHeaderSize); |
| 69 header->fEmitsPointSize = random->nextBool(); | 69 header->fEmitsPointSize = random->nextBool(); |
| 70 | 70 |
| 71 header->fPositionAttributeIndex = 0; | 71 header->fPositionAttributeIndex = 0; |
| 72 | 72 |
| 73 // if the effects have used up all off the available attributes, | 73 // if the effects have used up all off the available attributes, |
| 74 // don't try to use color or coverage attributes as input | 74 // don't try to use color or coverage attributes as input |
| 75 do { | 75 do { |
| 76 header->fColorInput = static_cast<GrGLProgramDesc::ColorInput>( | 76 uint32_t colorRand = random->nextULessThan(2); |
| 77 random->nextULessThan(kColorInputCnt)); | 77 header->fColorInput = (0 == colorRand) ? GrGLProgramDesc::kAttribute_Col
orInput : |
| 78 GrGLProgramDesc::kUniform_Color
Input; |
| 78 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && | 79 } while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex && |
| 79 kAttribute_ColorInput == header->fColorInput); | 80 kAttribute_ColorInput == header->fColorInput); |
| 80 | 81 |
| 81 header->fColorAttributeIndex = (header->fColorInput == kAttribute_ColorInput
) ? | 82 header->fColorAttributeIndex = (header->fColorInput == kAttribute_ColorInput
) ? |
| 82 currAttribIndex++ : | 83 currAttribIndex++ : |
| 83 -1; | 84 -1; |
| 84 | 85 |
| 85 do { | 86 do { |
| 86 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>( | 87 header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>( |
| 87 random->nextULessThan(kColorInputCnt)); | 88 random->nextULessThan(kColorInputCnt)); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1)); | 278 SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1)); |
| 278 GrConfigConversionEffect::Create(NULL, | 279 GrConfigConversionEffect::Create(NULL, |
| 279 false, | 280 false, |
| 280 GrConfigConversionEffect::kNone_PMConversio
n, | 281 GrConfigConversionEffect::kNone_PMConversio
n, |
| 281 SkMatrix::I()); | 282 SkMatrix::I()); |
| 282 SkScalar matrix[20]; | 283 SkScalar matrix[20]; |
| 283 SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix)); | 284 SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix)); |
| 284 } | 285 } |
| 285 | 286 |
| 286 #endif | 287 #endif |
| OLD | NEW |