Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 375823005: Remove gpu shader optimatization for solid white or trans black colors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change ignore function name Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL_program.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL_program.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698