Fall back to older inorder buffer if we have NVPR

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/b72ec98b2090e5728354dac66eb1886a28e4da6b

Review URL: https://codereview.chromium.org/1143153008
This commit is contained in:
joshualitt 2015-05-27 10:56:40 -07:00 committed by Commit bot
parent d8e2d28913
commit 24a366a037

View File

@ -7,11 +7,16 @@
#include "GrInOrderDrawBuffer.h"
static const bool kEnableReordering = true;
// We will use the reordering buffer, unless we have NVPR.
// TODO move NVPR to batch so we can reorder
static inline bool allow_reordering(const GrGpu* gpu) {
const GrCaps* caps = gpu->caps();
return caps && caps->shaderCaps() && !caps->shaderCaps()->pathRenderingSupport();
}
GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context)
: INHERITED(context)
, fCommands(GrCommandBuilder::Create(context->getGpu(), kEnableReordering))
, fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(context->getGpu())))
, fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
, fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4)
, fPipelineBuffer(kPipelineBufferMinReserve)