| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrProcessor_DEFINED | 8 #ifndef GrProcessor_DEFINED |
| 9 #define GrProcessor_DEFINED | 9 #define GrProcessor_DEFINED |
| 10 | 10 |
| 11 #include "GrColor.h" | 11 #include "GrColor.h" |
| 12 #include "GrProcessorUnitTest.h" | 12 #include "GrProcessorUnitTest.h" |
| 13 #include "GrProgramElement.h" | 13 #include "GrProgramElement.h" |
| 14 #include "GrTextureAccess.h" | 14 #include "GrTextureAccess.h" |
| 15 #include "SkMath.h" | 15 #include "SkMath.h" |
| 16 #include "SkString.h" |
| 16 | 17 |
| 17 class GrContext; | 18 class GrContext; |
| 18 class GrCoordTransform; | 19 class GrCoordTransform; |
| 19 class GrInvariantOutput; | 20 class GrInvariantOutput; |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * Used by processors to build their keys. It incorporates each per-processor ke
y into a larger | 23 * Used by processors to build their keys. It incorporates each per-processor ke
y into a larger |
| 23 * shader key. | 24 * shader key. |
| 24 */ | 25 */ |
| 25 class GrProcessorKeyBuilder { | 26 class GrProcessorKeyBuilder { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 55 processor must reach 0 before the thread terminates and the pool is destroye
d. | 56 processor must reach 0 before the thread terminates and the pool is destroye
d. |
| 56 */ | 57 */ |
| 57 class GrProcessor : public GrProgramElement { | 58 class GrProcessor : public GrProgramElement { |
| 58 public: | 59 public: |
| 59 virtual ~GrProcessor(); | 60 virtual ~GrProcessor(); |
| 60 | 61 |
| 61 /** Human-meaningful string to identify this prcoessor; may be embedded | 62 /** Human-meaningful string to identify this prcoessor; may be embedded |
| 62 in generated shader code. */ | 63 in generated shader code. */ |
| 63 virtual const char* name() const = 0; | 64 virtual const char* name() const = 0; |
| 64 | 65 |
| 66 // Human-readable dump of all information |
| 67 virtual SkString dumpInfo() const { |
| 68 SkString str; |
| 69 str.appendf("Missing data"); |
| 70 return str; |
| 71 } |
| 72 |
| 65 int numTextures() const { return fTextureAccesses.count(); } | 73 int numTextures() const { return fTextureAccesses.count(); } |
| 66 | 74 |
| 67 /** Returns the access pattern for the texture at index. index must be valid
according to | 75 /** Returns the access pattern for the texture at index. index must be valid
according to |
| 68 numTextures(). */ | 76 numTextures(). */ |
| 69 const GrTextureAccess& textureAccess(int index) const { return *fTextureAcce
sses[index]; } | 77 const GrTextureAccess& textureAccess(int index) const { return *fTextureAcce
sses[index]; } |
| 70 | 78 |
| 71 /** Shortcut for textureAccess(index).texture(); */ | 79 /** Shortcut for textureAccess(index).texture(); */ |
| 72 GrTexture* texture(int index) const { return this->textureAccess(index).getT
exture(); } | 80 GrTexture* texture(int index) const { return this->textureAccess(index).getT
exture(); } |
| 73 | 81 |
| 74 /** Will this processor read the fragment position? */ | 82 /** Will this processor read the fragment position? */ |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 kIllegalProcessorClassID = 0, | 144 kIllegalProcessorClassID = 0, |
| 137 }; | 145 }; |
| 138 static int32_t gCurrProcessorClassID; | 146 static int32_t gCurrProcessorClassID; |
| 139 | 147 |
| 140 bool fWillReadFragmentPosition; | 148 bool fWillReadFragmentPosition; |
| 141 | 149 |
| 142 typedef GrProgramElement INHERITED; | 150 typedef GrProgramElement INHERITED; |
| 143 }; | 151 }; |
| 144 | 152 |
| 145 #endif | 153 #endif |
| OLD | NEW |