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 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 13 #if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
14 | 14 |
15 #include "gl/GrGpuGL.h" | 15 #include "gl/GrGpuGL.h" |
16 #include "GrBackendEffectFactory.h" | 16 #include "GrBackendEffectFactory.h" |
17 #include "GrContextFactory.h" | 17 #include "GrContextFactory.h" |
18 #include "GrDrawEffect.h" | 18 #include "GrDrawEffect.h" |
19 #include "effects/GrConfigConversionEffect.h" | 19 #include "effects/GrConfigConversionEffect.h" |
20 | 20 |
21 #include "SkChecksum.h" | 21 #include "SkChecksum.h" |
22 #include "SkRandom.h" | 22 #include "SkRandom.h" |
23 #include "Test.h" | 23 #include "Test.h" |
24 | 24 |
25 void GrGLProgramDesc::setRandom(SkMWCRandom* random, | 25 void GrGLProgramDesc::setRandom(SkRandom* random, |
26 const GrGpuGL* gpu, | 26 const GrGpuGL* gpu, |
27 const GrRenderTarget* dstRenderTarget, | 27 const GrRenderTarget* dstRenderTarget, |
28 const GrTexture* dstCopyTexture, | 28 const GrTexture* dstCopyTexture, |
29 const GrEffectStage* stages[], | 29 const GrEffectStage* stages[], |
30 int numColorStages, | 30 int numColorStages, |
31 int numCoverageStages, | 31 int numCoverageStages, |
32 int currAttribIndex) { | 32 int currAttribIndex) { |
33 int numEffects = numColorStages + numCoverageStages; | 33 int numEffects = numColorStages + numCoverageStages; |
34 size_t keyLength = KeyLength(numEffects); | 34 size_t keyLength = KeyLength(numEffects); |
35 fKey.reset(keyLength); | 35 fKey.reset(keyLength); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 dummyDesc.fHeight = 18; | 125 dummyDesc.fHeight = 18; |
126 SkAutoTUnref<GrTexture> dummyTexture1(this->createTexture(dummyDesc, NULL, 0
)); | 126 SkAutoTUnref<GrTexture> dummyTexture1(this->createTexture(dummyDesc, NULL, 0
)); |
127 dummyDesc.fFlags = kNone_GrTextureFlags; | 127 dummyDesc.fFlags = kNone_GrTextureFlags; |
128 dummyDesc.fConfig = kAlpha_8_GrPixelConfig; | 128 dummyDesc.fConfig = kAlpha_8_GrPixelConfig; |
129 dummyDesc.fWidth = 16; | 129 dummyDesc.fWidth = 16; |
130 dummyDesc.fHeight = 22; | 130 dummyDesc.fHeight = 22; |
131 SkAutoTUnref<GrTexture> dummyTexture2(this->createTexture(dummyDesc, NULL, 0
)); | 131 SkAutoTUnref<GrTexture> dummyTexture2(this->createTexture(dummyDesc, NULL, 0
)); |
132 | 132 |
133 static const int NUM_TESTS = 512; | 133 static const int NUM_TESTS = 512; |
134 | 134 |
135 SkMWCRandom random; | 135 SkRandom random; |
136 for (int t = 0; t < NUM_TESTS; ++t) { | 136 for (int t = 0; t < NUM_TESTS; ++t) { |
137 | 137 |
138 #if 0 | 138 #if 0 |
139 GrPrintf("\nTest Program %d\n-------------\n", t); | 139 GrPrintf("\nTest Program %d\n-------------\n", t); |
140 static const int stop = -1; | 140 static const int stop = -1; |
141 if (t == stop) { | 141 if (t == stop) { |
142 int breakpointhere = 9; | 142 int breakpointhere = 9; |
143 } | 143 } |
144 #endif | 144 #endif |
145 | 145 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 GrConfigConversionEffect::Create(NULL, | 238 GrConfigConversionEffect::Create(NULL, |
239 false, | 239 false, |
240 GrConfigConversionEffect::kNone_PMConversio
n, | 240 GrConfigConversionEffect::kNone_PMConversio
n, |
241 SkMatrix::I()); | 241 SkMatrix::I()); |
242 SkScalar matrix[20]; | 242 SkScalar matrix[20]; |
243 SkColorMatrixFilter cmf(matrix); | 243 SkColorMatrixFilter cmf(matrix); |
244 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80); | 244 SkBitmapAlphaThresholdShader::Create(SkBitmap(), SkRegion(), 0x80); |
245 } | 245 } |
246 | 246 |
247 #endif | 247 #endif |
OLD | NEW |