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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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 | « tests/GLInterfaceValidationTest.cpp ('k') | tests/GpuLayerCacheTest.cpp » ('j') | 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 26 matching lines...) Expand all
37 fKey.reset(); 37 fKey.reset();
38 38
39 GR_STATIC_ASSERT(0 == kEffectKeyOffsetsAndLengthOffset % sizeof(uint32_t)); 39 GR_STATIC_ASSERT(0 == kEffectKeyOffsetsAndLengthOffset % sizeof(uint32_t));
40 40
41 // Make room for everything up to and including the array of offsets to effe ct keys. 41 // Make room for everything up to and including the array of offsets to effe ct keys.
42 fKey.push_back_n(kEffectKeyOffsetsAndLengthOffset + 2 * sizeof(uint16_t) * ( numStages + 42 fKey.push_back_n(kEffectKeyOffsetsAndLengthOffset + 2 * sizeof(uint16_t) * ( numStages +
43 (geometryProcessor ? 1 : 0))); 43 (geometryProcessor ? 1 : 0)));
44 44
45 bool dstRead = false; 45 bool dstRead = false;
46 bool fragPos = false; 46 bool fragPos = false;
47 bool vertexShader = (NULL != geometryProcessor); 47 bool vertexShader = SkToBool(geometryProcessor);
48 int offset = 0; 48 int offset = 0;
49 if (NULL != geometryProcessor) { 49 if (geometryProcessor) {
50 const GrEffectStage* stage = geometryProcessor; 50 const GrEffectStage* stage = geometryProcessor;
51 uint16_t* offsetAndSize = reinterpret_cast<uint16_t*>(fKey.begin() + 51 uint16_t* offsetAndSize = reinterpret_cast<uint16_t*>(fKey.begin() +
52 kEffectKeyOffsetsA ndLengthOffset + 52 kEffectKeyOffsetsA ndLengthOffset +
53 offset * 2 * sizeo f(uint16_t)); 53 offset * 2 * sizeo f(uint16_t));
54 uint32_t effectKeyOffset = fKey.count(); 54 uint32_t effectKeyOffset = fKey.count();
55 if (effectKeyOffset > SK_MaxU16) { 55 if (effectKeyOffset > SK_MaxU16) {
56 fKey.reset(); 56 fKey.reset();
57 return false; 57 return false;
58 } 58 }
59 GrDrawEffect drawEffect(*stage, useLocalCoords); 59 GrDrawEffect drawEffect(*stage, useLocalCoords);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if (NULL == program.get()) { 288 if (NULL == program.get()) {
289 return false; 289 return false;
290 } 290 }
291 } 291 }
292 return true; 292 return true;
293 } 293 }
294 294
295 DEF_GPUTEST(GLPrograms, reporter, factory) { 295 DEF_GPUTEST(GLPrograms, reporter, factory) {
296 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { 296 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
297 GrContext* context = factory->get(static_cast<GrContextFactory::GLContex tType>(type)); 297 GrContext* context = factory->get(static_cast<GrContextFactory::GLContex tType>(type));
298 if (NULL != context) { 298 if (context) {
299 GrGpuGL* gpu = static_cast<GrGpuGL*>(context->getGpu()); 299 GrGpuGL* gpu = static_cast<GrGpuGL*>(context->getGpu());
300 int maxStages = 6; 300 int maxStages = 6;
301 #if SK_ANGLE 301 #if SK_ANGLE
302 // Some long shaders run out of temporary registers in the D3D compi ler on ANGLE. 302 // Some long shaders run out of temporary registers in the D3D compi ler on ANGLE.
303 if (type == GrContextFactory::kANGLE_GLContextType) { 303 if (type == GrContextFactory::kANGLE_GLContextType) {
304 maxStages = 3; 304 maxStages = 3;
305 } 305 }
306 #endif 306 #endif
307 REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages)); 307 REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages));
308 } 308 }
(...skipping 19 matching lines...) Expand all
328 SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1)); 328 SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1));
329 GrConfigConversionEffect::Create(NULL, 329 GrConfigConversionEffect::Create(NULL,
330 false, 330 false,
331 GrConfigConversionEffect::kNone_PMConversio n, 331 GrConfigConversionEffect::kNone_PMConversio n,
332 SkMatrix::I()); 332 SkMatrix::I());
333 SkScalar matrix[20]; 333 SkScalar matrix[20];
334 SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix)); 334 SkAutoTUnref<SkColorMatrixFilter> cmf(SkColorMatrixFilter::Create(matrix));
335 } 335 }
336 336
337 #endif 337 #endif
OLDNEW
« no previous file with comments | « tests/GLInterfaceValidationTest.cpp ('k') | tests/GpuLayerCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698