| Index: include/gpu/GrContext.h
|
| diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
|
| index fcfcb775ce709d7501dd76f62aea3afb2730b15a..97acda1e795a4cc540525d65c805b5d3fd18c3c3 100644
|
| --- a/include/gpu/GrContext.h
|
| +++ b/include/gpu/GrContext.h
|
| @@ -33,6 +33,7 @@
|
| class GrPath;
|
| class GrPathRenderer;
|
| class GrResourceEntry;
|
| +class GrResourceCache;
|
| class GrResourceCache2;
|
| class GrStencilBuffer;
|
| class GrTestTarget;
|
| @@ -882,6 +883,7 @@
|
| GrDrawTarget* getTextTarget();
|
| const GrIndexBuffer* getQuadIndexBuffer() const;
|
| GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; }
|
| + GrResourceCache* getResourceCache() { return fResourceCache; }
|
| GrResourceCache2* getResourceCache2() { return fResourceCache2; }
|
|
|
| // Called by tests that draw directly to the context via GrDrawTarget
|
| @@ -946,6 +948,7 @@
|
| const GrClipData* fClip; // TODO: make this ref counted
|
| GrDrawState* fDrawState;
|
|
|
| + GrResourceCache* fResourceCache;
|
| GrResourceCache2* fResourceCache2;
|
| GrFontCache* fFontCache;
|
| SkAutoTDelete<GrLayerCache> fLayerCache;
|
| @@ -956,6 +959,9 @@
|
| GrVertexBufferAllocPool* fDrawBufferVBAllocPool;
|
| GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
|
| GrInOrderDrawBuffer* fDrawBuffer;
|
| +
|
| + // Set by OverbudgetCB() to request that GrContext flush before exiting a draw.
|
| + bool fFlushToReduceCacheSize;
|
|
|
| GrAARectRenderer* fAARectRenderer;
|
| GrOvalRenderer* fOvalRenderer;
|
| @@ -983,9 +989,10 @@
|
| void setupDrawBuffer();
|
|
|
| class AutoRestoreEffects;
|
| + class AutoCheckFlush;
|
| /// Sets the paint and returns the target to draw into. The paint can be NULL in which case the
|
| /// draw state is left unmodified.
|
| - GrDrawTarget* prepareToDraw(const GrPaint*, AutoRestoreEffects*);
|
| + GrDrawTarget* prepareToDraw(const GrPaint*, AutoRestoreEffects*, AutoCheckFlush*);
|
|
|
| void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path,
|
| const GrStrokeInfo& stroke);
|
| @@ -996,6 +1003,8 @@
|
| size_t rowBytes,
|
| bool filter);
|
|
|
| + GrTexture* createNewScratchTexture(const GrSurfaceDesc& desc);
|
| +
|
| /**
|
| * These functions create premul <-> unpremul effects if it is possible to generate a pair
|
| * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. Otherwise, they
|
| @@ -1006,9 +1015,9 @@
|
|
|
| /**
|
| * This callback allows the resource cache to callback into the GrContext
|
| - * when the cache is still over budget after a purge.
|
| - */
|
| - static void OverBudgetCB(void* data);
|
| + * when the cache is still overbudget after a purge.
|
| + */
|
| + static bool OverbudgetCB(void* data);
|
|
|
| typedef SkRefCnt INHERITED;
|
| };
|
|
|