本文整理汇总了C++中GrPrimitiveProcessor::texture方法的典型用法代码示例。如果您正苦于以下问题:C++ GrPrimitiveProcessor::texture方法的具体用法?C++ GrPrimitiveProcessor::texture怎么用?C++ GrPrimitiveProcessor::texture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrPrimitiveProcessor
的用法示例。
在下文中一共展示了GrPrimitiveProcessor::texture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setData
virtual void setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& proc,
const GrBatchTracker& bt) override {
SkASSERT(fTextureSizeUni.isValid());
GrTexture* texture = proc.texture(0);
if (texture->width() != fTextureSize.width() ||
texture->height() != fTextureSize.height()) {
fTextureSize = SkISize::Make(texture->width(), texture->height());
pdman.set2f(fTextureSizeUni,
SkIntToScalar(fTextureSize.width()),
SkIntToScalar(fTextureSize.height()));
}
const GrDistanceFieldPathGeoProc& dfpgp = proc.cast<GrDistanceFieldPathGeoProc>();
if (!dfpgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfpgp.viewMatrix())) {
fViewMatrix = dfpgp.viewMatrix();
GrGLfloat viewMatrix[3 * 3];
GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
if (dfpgp.color() != fColor) {
GrGLfloat c[4];
GrColorToRGBAFloat(dfpgp.color(), c);
pdman.set4fv(fColorUniform, 1, c);
fColor = dfpgp.color();
}
}
示例2: setData
void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& proc,
FPCoordTransformIter&& transformIter) override {
SkASSERT(fTextureSizeUni.isValid());
GrTexture* texture = proc.texture(0);
if (texture->width() != fTextureSize.width() ||
texture->height() != fTextureSize.height()) {
fTextureSize = SkISize::Make(texture->width(), texture->height());
pdman.set2f(fTextureSizeUni,
SkIntToScalar(fTextureSize.width()),
SkIntToScalar(fTextureSize.height()));
}
const GrDistanceFieldPathGeoProc& dfpgp = proc.cast<GrDistanceFieldPathGeoProc>();
if (!dfpgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfpgp.viewMatrix())) {
fViewMatrix = dfpgp.viewMatrix();
float viewMatrix[3 * 3];
GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter);
}
示例3: setData
virtual void setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& proc,
const GrBatchTracker& bt) override {
SkASSERT(fTextureSizeUni.isValid());
GrTexture* texture = proc.texture(0);
if (texture->width() != fTextureSize.width() ||
texture->height() != fTextureSize.height()) {
fTextureSize = SkISize::Make(texture->width(), texture->height());
pdman.set2f(fTextureSizeUni,
SkIntToScalar(fTextureSize.width()),
SkIntToScalar(fTextureSize.height()));
}
this->setUniformViewMatrix(pdman, proc.viewMatrix());
const DistanceFieldNoGammaBatchTracker& local = bt.cast<DistanceFieldNoGammaBatchTracker>();
if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
GrGLfloat c[4];
GrColorToRGBAFloat(local.fColor, c);
pdman.set4fv(fColorUniform, 1, c);
fColor = local.fColor;
}
}