예제 #1
0
 static inline void GenKey(const GrGeometryProcessor& gp,
                           const GrBatchTracker& bt,
                           const GrGLSLCaps&,
                           GrProcessorKeyBuilder* b) {
     const BatchTracker& local = bt.cast<BatchTracker>();
     uint32_t key = local.fInputColorType << 16;
     key |= local.fUsesLocalCoords && gp.localMatrix().hasPerspective() ? 0x1 : 0x0;
     key |= ComputePosKey(gp.viewMatrix()) << 1;
     b->add32(key);
 }
 static inline void GenKey(const GrGeometryProcessor& gp,
                           const GrBatchTracker& bt,
                           const GrGLCaps&,
                           GrProcessorKeyBuilder* b) {
     const GrDistanceFieldTextureEffect& dfTexEffect = gp.cast<GrDistanceFieldTextureEffect>();
     const DistanceFieldBatchTracker& local = bt.cast<DistanceFieldBatchTracker>();
     uint32_t key = dfTexEffect.getFlags();
     key |= local.fInputColorType << 16;
     key |= local.fUsesLocalCoords && gp.localMatrix().hasPerspective() ? 0x1 << 24: 0x0;
     key |= ComputePosKey(gp.viewMatrix()) << 25;
     b->add32(key);
 }
예제 #3
0
 static inline void GenKey(const GrGeometryProcessor& gp,
                           const GrBatchTracker& bt,
                           const GrGLCaps&,
                           GrProcessorKeyBuilder* b) {
     const DefaultGeoProc& def = gp.cast<DefaultGeoProc>();
     const BatchTracker& local = bt.cast<BatchTracker>();
     uint32_t key = def.fFlags;
     key |= local.fInputColorType << 8 | local.fInputCoverageType << 16;
     key |= local.fUsesLocalCoords && gp.localMatrix().hasPerspective() ? 0x1 << 24 : 0x0;
     key |= ComputePosKey(gp.viewMatrix()) << 25;
     b->add32(key);
 }
예제 #4
0
 static inline void GenKey(const GrGeometryProcessor& proc,
                           const GrBatchTracker& bt,
                           const GrGLCaps&,
                           GrProcessorKeyBuilder* b) {
     const BitmapTextBatchTracker& local = bt.cast<BitmapTextBatchTracker>();
     // We have to put the optional vertex attribute as part of the key.  See the comment
     // on addVertexAttrib.
     // TODO When we have deferred geometry we can fix this
     const GrBitmapTextGeoProc& gp = proc.cast<GrBitmapTextGeoProc>();
     uint32_t key = 0;
     key |= SkToBool(gp.inColor()) ? 0x1 : 0x0;
     key |= local.fUsesLocalCoords && proc.localMatrix().hasPerspective() ? 0x2 : 0x0;
     key |= gp.maskFormat() == kARGB_GrMaskFormat ? 0x4 : 0x0;
     key |= ComputePosKey(gp.viewMatrix()) << 3;
     b->add32(local.fInputColorType << 16 | key);
 }