| 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 "GrTBackendProcessorFactory.h" | 15 #include "GrTBackendProcessorFactory.h" | 
| 16 #include "GrContextFactory.h" | 16 #include "GrContextFactory.h" | 
| 17 #include "GrOptDrawState.h" | 17 #include "GrOptDrawState.h" | 
| 18 #include "effects/GrConfigConversionEffect.h" | 18 #include "effects/GrConfigConversionEffect.h" | 
| 19 #include "gl/builders/GrGLProgramBuilder.h" | 19 #include "gl/builders/GrGLProgramBuilder.h" | 
| 20 #include "gl/GrGLPathRendering.h" | 20 #include "gl/GrGLPathRendering.h" | 
| 21 #include "gl/GrGpuGL.h" | 21 #include "gl/GrGpuGL.h" | 
| 22 #include "SkChecksum.h" | 22 #include "SkChecksum.h" | 
| 23 #include "SkRandom.h" | 23 #include "SkRandom.h" | 
| 24 #include "Test.h" | 24 #include "Test.h" | 
| 25 | 25 | 
| 26 /* | 26 /* | 
| 27  * A dummy effect which just tries to insert a massive key and verify that it ca
     n retrieve the | 27  * A dummy processor which just tries to insert a massive key and verify that it
      can retrieve the | 
| 28  * whole thing correctly | 28  * whole thing correctly | 
| 29  */ | 29  */ | 
| 30 static const uint32_t kMaxKeySize = 1024; | 30 static const uint32_t kMaxKeySize = 1024; | 
| 31 | 31 | 
| 32 class GLBigKeyProcessor; | 32 class GLBigKeyProcessor; | 
| 33 | 33 | 
| 34 class BigKeyProcessor : public GrFragmentProcessor { | 34 class BigKeyProcessor : public GrFragmentProcessor { | 
| 35 public: | 35 public: | 
| 36     static GrFragmentProcessor* Create() { | 36     static GrFragmentProcessor* Create() { | 
| 37         GR_CREATE_STATIC_FRAGMENT_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, (
     )) | 37         GR_CREATE_STATIC_PROCESSOR(gBigKeyProcessor, BigKeyProcessor, ()) | 
| 38         return SkRef(gBigKeyProcessor); | 38         return SkRef(gBigKeyProcessor); | 
| 39     } | 39     } | 
| 40 | 40 | 
| 41     static const char* Name() { return "Big ol' Key"; } | 41     static const char* Name() { return "Big ol' Key"; } | 
| 42 | 42 | 
| 43     virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
     IDE { | 43     virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
     IDE { | 
| 44         return GrTBackendFragmentProcessorFactory<BigKeyProcessor>::getInstance(
     ); | 44         return GrTBackendFragmentProcessorFactory<BigKeyProcessor>::getInstance(
     ); | 
| 45     } | 45     } | 
| 46 | 46 | 
| 47     typedef GLBigKeyProcessor GLProcessor; | 47     typedef GLBigKeyProcessor GLProcessor; | 
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 514             if (type == GrContextFactory::kANGLE_GLContextType) { | 514             if (type == GrContextFactory::kANGLE_GLContextType) { | 
| 515                 maxStages = 3; | 515                 maxStages = 3; | 
| 516             } | 516             } | 
| 517 #endif | 517 #endif | 
| 518             REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages)); | 518             REPORTER_ASSERT(reporter, gpu->programUnitTest(maxStages)); | 
| 519         } | 519         } | 
| 520     } | 520     } | 
| 521 } | 521 } | 
| 522 | 522 | 
| 523 #endif | 523 #endif | 
| OLD | NEW | 
|---|