本文整理汇总了C++中DrawInfo::setDevBounds方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawInfo::setDevBounds方法的具体用法?C++ DrawInfo::setDevBounds怎么用?C++ DrawInfo::setDevBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawInfo
的用法示例。
在下文中一共展示了DrawInfo::setDevBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawNonIndexed
void GrDrawTarget::drawNonIndexed(GrPrimitiveType type,
int startVertex,
int vertexCount,
const SkRect* devBounds) {
if (vertexCount > 0 && this->checkDraw(type, startVertex, -1, vertexCount, -1)) {
DrawInfo info;
info.fPrimitiveType = type;
info.fStartVertex = startVertex;
info.fStartIndex = 0;
info.fVertexCount = vertexCount;
info.fIndexCount = 0;
info.fInstanceCount = 0;
info.fVerticesPerInstance = 0;
info.fIndicesPerInstance = 0;
if (NULL != devBounds) {
info.setDevBounds(*devBounds);
}
// TODO: We should continue with incorrect blending.
if (!this->setupDstReadIfNecessary(&info)) {
return;
}
this->onDraw(info);
}
}
示例2: drawIndexed
void GrDrawTarget::drawIndexed(GrPipelineBuilder* pipelineBuilder,
const GrGeometryProcessor* gp,
GrPrimitiveType type,
int startVertex,
int startIndex,
int vertexCount,
int indexCount,
const SkRect* devBounds) {
SkASSERT(pipelineBuilder);
if (indexCount > 0 &&
this->checkDraw(*pipelineBuilder, gp, type, startVertex, startIndex, vertexCount,
indexCount)) {
// Setup clip
GrScissorState scissorState;
GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
GrPipelineBuilder::AutoRestoreStencil ars;
if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, devBounds)) {
return;
}
DrawInfo info;
info.fPrimitiveType = type;
info.fStartVertex = startVertex;
info.fStartIndex = startIndex;
info.fVertexCount = vertexCount;
info.fIndexCount = indexCount;
info.fInstanceCount = 0;
info.fVerticesPerInstance = 0;
info.fIndicesPerInstance = 0;
if (devBounds) {
info.setDevBounds(*devBounds);
}
GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, gp, devBounds,
this);
if (pipelineInfo.mustSkipDraw()) {
return;
}
this->setDrawBuffers(&info, gp->getVertexStride());
this->onDraw(gp, info, pipelineInfo);
}
}
示例3: drawIndexedInstances
void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type,
int instanceCount,
int verticesPerInstance,
int indicesPerInstance,
const SkRect* devBounds) {
if (!verticesPerInstance || !indicesPerInstance) {
return;
}
int maxInstancesPerDraw = this->indexCountInCurrentSource() / indicesPerInstance;
if (!maxInstancesPerDraw) {
return;
}
DrawInfo info;
info.fPrimitiveType = type;
info.fStartIndex = 0;
info.fStartVertex = 0;
info.fIndicesPerInstance = indicesPerInstance;
info.fVerticesPerInstance = verticesPerInstance;
// Set the same bounds for all the draws.
if (NULL != devBounds) {
info.setDevBounds(*devBounds);
}
// TODO: We should continue with incorrect blending.
if (!this->setupDstReadIfNecessary(&info)) {
return;
}
while (instanceCount) {
info.fInstanceCount = SkTMin(instanceCount, maxInstancesPerDraw);
info.fVertexCount = info.fInstanceCount * verticesPerInstance;
info.fIndexCount = info.fInstanceCount * indicesPerInstance;
if (this->checkDraw(type,
info.fStartVertex,
info.fStartIndex,
info.fVertexCount,
info.fIndexCount)) {
this->onDraw(info);
}
info.fStartVertex += info.fVertexCount;
instanceCount -= info.fInstanceCount;
}
}
示例4: drawIndexedInstances
void GrDrawTarget::drawIndexedInstances(GrPipelineBuilder* pipelineBuilder,
const GrGeometryProcessor* gp,
GrPrimitiveType type,
int instanceCount,
int verticesPerInstance,
int indicesPerInstance,
const SkRect* devBounds) {
SkASSERT(pipelineBuilder);
if (!verticesPerInstance || !indicesPerInstance) {
return;
}
int maxInstancesPerDraw = this->indexCountInCurrentSource() / indicesPerInstance;
if (!maxInstancesPerDraw) {
return;
}
// Setup clip
GrScissorState scissorState;
GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
GrPipelineBuilder::AutoRestoreStencil ars;
if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, devBounds)) {
return;
}
DrawInfo info;
info.fPrimitiveType = type;
info.fStartIndex = 0;
info.fStartVertex = 0;
info.fIndicesPerInstance = indicesPerInstance;
info.fVerticesPerInstance = verticesPerInstance;
// Set the same bounds for all the draws.
if (devBounds) {
info.setDevBounds(*devBounds);
}
while (instanceCount) {
info.fInstanceCount = SkTMin(instanceCount, maxInstancesPerDraw);
info.fVertexCount = info.fInstanceCount * verticesPerInstance;
info.fIndexCount = info.fInstanceCount * indicesPerInstance;
if (this->checkDraw(*pipelineBuilder,
gp,
type,
info.fStartVertex,
info.fStartIndex,
info.fVertexCount,
info.fIndexCount)) {
GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, gp, devBounds,
this);
if (pipelineInfo.mustSkipDraw()) {
return;
}
this->setDrawBuffers(&info, gp->getVertexStride());
this->onDraw(gp, info, pipelineInfo);
}
info.fStartVertex += info.fVertexCount;
instanceCount -= info.fInstanceCount;
}
}