Fall back to older inorder buffer if we have NVPR
authorjoshualitt <joshualitt@chromium.org>
Wed, 27 May 2015 17:31:12 +0000 (10:31 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 27 May 2015 17:31:12 +0000 (10:31 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1143153008

src/gpu/GrInOrderDrawBuffer.cpp

index 3827830..0d838e1 100644 (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 GrShaderCaps* caps) {
+    return !caps->pathRenderingSupport();
+}
 
 GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context)
     : INHERITED(context)
-    , fCommands(GrCommandBuilder::Create(context->getGpu(), kEnableReordering))
+    , fCommands(GrCommandBuilder::Create(context->getGpu(),
+                                         allow_reordering(context->getGpu()->caps()->shaderCaps())))
     , fPathIndexBuffer(kPathIdxBufferMinReserve * sizeof(char)/4)
     , fPathTransformBuffer(kPathXformBufferMinReserve * sizeof(float)/4)
     , fPipelineBuffer(kPipelineBufferMinReserve)