diff options
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrConfig.h | 8 | ||||
-rw-r--r-- | include/gpu/GrContext.h | 12 | ||||
-rw-r--r-- | include/gpu/GrUserConfig.h | 10 |
3 files changed, 22 insertions, 8 deletions
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h index eecce79d2b..ffab237f41 100644 --- a/include/gpu/GrConfig.h +++ b/include/gpu/GrConfig.h @@ -337,6 +337,14 @@ inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); } #endif /** + * GR_DISABLE_DRAW_BUFFERING prevents GrContext from queueing draws in a + * GrInOrderDrawBuffer. + */ +#if !defined(GR_DISABLE_DRAW_BUFFERING) + #define GR_DISABLE_DRAW_BUFFERING 0 +#endif + +/** * GR_AGGRESSIVE_SHADER_OPTS controls how aggressively shaders are optimized * for special cases. On systems where program changes are expensive this * may not be advantageous. Consecutive draws may no longer use the same diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 0c4d73c7fb..c32b908625 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -748,12 +748,12 @@ public: bool allowSW); private: - // used to keep track of when we need to flush the draw buffer - enum DrawCategory { - kBuffered_DrawCategory, // last draw was inserted in draw buffer - kUnbuffered_DrawCategory, // last draw was not inserted in the draw buffer + // Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer. + enum BufferedDraw { + kYes_BufferedDraw, + kNo_BufferedDraw, }; - DrawCategory fLastDrawCategory; + BufferedDraw fLastDrawWasBuffered; GrGpu* fGpu; GrDrawState* fDrawState; @@ -778,7 +778,7 @@ private: void setPaint(const GrPaint& paint); - GrDrawTarget* prepareToDraw(const GrPaint& paint, DrawCategory drawType); + GrDrawTarget* prepareToDraw(const GrPaint&, BufferedDraw); void internalDrawPath(const GrPaint& paint, const SkPath& path, GrPathFill fill, const GrPoint* translate); diff --git a/include/gpu/GrUserConfig.h b/include/gpu/GrUserConfig.h index 657f74f028..d514486d24 100644 --- a/include/gpu/GrUserConfig.h +++ b/include/gpu/GrUserConfig.h @@ -22,8 +22,8 @@ #endif /* - * To diagnose texture cache performance, define this to 1 if you want to see - * a log statement everytime we upload an image to create a texture. + * To diagnose texture cache performance, define this to 1 if you want to see + * a log statement everytime we upload an image to create a texture. */ //#define GR_DUMP_TEXTURE_UPLOAD 1 @@ -36,6 +36,12 @@ //#define GR_STATIC_RECT_VB 1 /* + * This causes the GrContext to execute all draws immediately in the 3D API + * rather than internally queuing draws. + */ +//#define GR_DISABLE_DRAW_BUFFERING 1 + +/* * This causes more aggressive shader optimization. May hurt performance if * switching shaders is expensive. */ |