diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-16 18:36:06 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-16 18:36:06 +0000 |
commit | 1d4edd38f6b62d1cc54cb7bc6f3c6ce10ccb1471 (patch) | |
tree | d5741f59b713220679544c73f522f7b7c49c5f45 /include | |
parent | da17f758442f16747af39f8fbaed9c097048519c (diff) |
Make all GrContext draws go through the draw buffer.
Review URL: http://codereview.appspot.com/6462069/
git-svn-id: http://skia.googlecode.com/svn/trunk@5136 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-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. */ |