From bf5cad4e9c5808493b35cb9b0000a2d36b7f9b78 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Thu, 10 May 2012 12:40:40 +0000 Subject: [PATCH] Added documentation of stage/TU allocation http://codereview.appspot.com/6199058/ git-svn-id: http://skia.googlecode.com/svn/trunk@3888 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/gpu/GrTextContext.h | 5 +++++ src/gpu/GrDrawState.h | 5 +++++ src/gpu/GrPathRenderer.h | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/include/gpu/GrTextContext.h b/include/gpu/GrTextContext.h index 588ae6ee3..ab1a34453 100644 --- a/include/gpu/GrTextContext.h +++ b/include/gpu/GrTextContext.h @@ -22,6 +22,11 @@ class GrPaint; class SkGpuDevice; class SkPaint; +/** + * Derived classes can use stages GrPaint::kTotalStages through + * GrDrawState::kNumStages-1. The stages before GrPaint::kTotalStages + * are reserved for setting up the draw (i.e., textures and filter masks). + */ class GrTextContext: public GrRefCnt { protected: GrContext* fContext; diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index 386aebdfe..357f864c1 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -36,6 +36,11 @@ public: * the last enabled stage. The presence or absence of texture coordinates * for each stage in the vertex layout indicates whether a stage is enabled * or not. + * + * Stages 0 through GrPaint::kTotalStages-1 are reserved for setting up + * the draw (i.e., textures and filter masks). Stages GrPaint::kTotalStages + * through kNumStages-1 are earmarked for use by GrTextContext and + * GrPathRenderer-derived classes. */ enum { kNumStages = 4, diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index 6a6cea6a3..ff9fdbbc0 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -21,6 +21,10 @@ struct GrPoint; /** * Base class for drawing paths into a GrDrawTarget. + * + * Derived classes can use stages GrPaint::kTotalStages through + * GrDrawState::kNumStages-1. The stages before GrPaint::kTotalStages + * are reserved for setting up the draw (i.e., textures and filter masks). */ class GR_API GrPathRenderer : public GrRefCnt { public: