OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 class GrGpu; | 26 class GrGpu; |
27 class GrGpuTraceMarker; | 27 class GrGpuTraceMarker; |
28 class GrIndexBuffer; | 28 class GrIndexBuffer; |
29 class GrIndexBufferAllocPool; | 29 class GrIndexBufferAllocPool; |
30 class GrInOrderDrawBuffer; | 30 class GrInOrderDrawBuffer; |
31 class GrLayerCache; | 31 class GrLayerCache; |
32 class GrOvalRenderer; | 32 class GrOvalRenderer; |
33 class GrPath; | 33 class GrPath; |
34 class GrPathRenderer; | 34 class GrPathRenderer; |
35 class GrResourceEntry; | 35 class GrResourceEntry; |
36 class GrResourceCache; | |
37 class GrResourceCache2; | 36 class GrResourceCache2; |
38 class GrStencilBuffer; | 37 class GrStencilBuffer; |
39 class GrTestTarget; | 38 class GrTestTarget; |
40 class GrTextContext; | 39 class GrTextContext; |
41 class GrTextureParams; | 40 class GrTextureParams; |
42 class GrVertexBuffer; | 41 class GrVertexBuffer; |
43 class GrVertexBufferAllocPool; | 42 class GrVertexBufferAllocPool; |
44 class GrStrokeInfo; | 43 class GrStrokeInfo; |
45 class GrSoftwarePathRenderer; | 44 class GrSoftwarePathRenderer; |
46 class SkStrokeRec; | 45 class SkStrokeRec; |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 875 |
877 /////////////////////////////////////////////////////////////////////////// | 876 /////////////////////////////////////////////////////////////////////////// |
878 // Functions intended for internal use only. | 877 // Functions intended for internal use only. |
879 GrGpu* getGpu() { return fGpu; } | 878 GrGpu* getGpu() { return fGpu; } |
880 const GrGpu* getGpu() const { return fGpu; } | 879 const GrGpu* getGpu() const { return fGpu; } |
881 GrFontCache* getFontCache() { return fFontCache; } | 880 GrFontCache* getFontCache() { return fFontCache; } |
882 GrLayerCache* getLayerCache() { return fLayerCache.get(); } | 881 GrLayerCache* getLayerCache() { return fLayerCache.get(); } |
883 GrDrawTarget* getTextTarget(); | 882 GrDrawTarget* getTextTarget(); |
884 const GrIndexBuffer* getQuadIndexBuffer() const; | 883 const GrIndexBuffer* getQuadIndexBuffer() const; |
885 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } | 884 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } |
886 GrResourceCache* getResourceCache() { return fResourceCache; } | |
887 GrResourceCache2* getResourceCache2() { return fResourceCache2; } | 885 GrResourceCache2* getResourceCache2() { return fResourceCache2; } |
888 | 886 |
889 // Called by tests that draw directly to the context via GrDrawTarget | 887 // Called by tests that draw directly to the context via GrDrawTarget |
890 void getTestTarget(GrTestTarget*); | 888 void getTestTarget(GrTestTarget*); |
891 | 889 |
892 void addGpuTraceMarker(const GrGpuTraceMarker* marker); | 890 void addGpuTraceMarker(const GrGpuTraceMarker* marker); |
893 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); | 891 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); |
894 | 892 |
895 /** | 893 /** |
896 * Stencil buffers add themselves to the cache using addStencilBuffer. findS
tencilBuffer is | 894 * Stencil buffers add themselves to the cache using addStencilBuffer. findS
tencilBuffer is |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 const GPUStats* gpuStats() const; | 939 const GPUStats* gpuStats() const; |
942 #endif | 940 #endif |
943 | 941 |
944 private: | 942 private: |
945 GrGpu* fGpu; | 943 GrGpu* fGpu; |
946 SkMatrix fViewMatrix; | 944 SkMatrix fViewMatrix; |
947 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 945 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
948 const GrClipData* fClip; // TODO: make this ref counted | 946 const GrClipData* fClip; // TODO: make this ref counted |
949 GrDrawState* fDrawState; | 947 GrDrawState* fDrawState; |
950 | 948 |
951 GrResourceCache* fResourceCache; | |
952 GrResourceCache2* fResourceCache2; | 949 GrResourceCache2* fResourceCache2; |
953 GrFontCache* fFontCache; | 950 GrFontCache* fFontCache; |
954 SkAutoTDelete<GrLayerCache> fLayerCache; | 951 SkAutoTDelete<GrLayerCache> fLayerCache; |
955 | 952 |
956 GrPathRendererChain* fPathRendererChain; | 953 GrPathRendererChain* fPathRendererChain; |
957 GrSoftwarePathRenderer* fSoftwarePathRenderer; | 954 GrSoftwarePathRenderer* fSoftwarePathRenderer; |
958 | 955 |
959 GrVertexBufferAllocPool* fDrawBufferVBAllocPool; | 956 GrVertexBufferAllocPool* fDrawBufferVBAllocPool; |
960 GrIndexBufferAllocPool* fDrawBufferIBAllocPool; | 957 GrIndexBufferAllocPool* fDrawBufferIBAllocPool; |
961 GrInOrderDrawBuffer* fDrawBuffer; | 958 GrInOrderDrawBuffer* fDrawBuffer; |
962 | 959 |
963 // Set by OverbudgetCB() to request that GrContext flush before exiting a dr
aw. | 960 // Set by OverbudgetCB() to request that GrContext flush before exiting a dr
aw. |
964 bool fFlushToReduceCacheSize; | 961 bool fFlushToReduceCacheSize; |
965 | |
966 GrAARectRenderer* fAARectRenderer; | 962 GrAARectRenderer* fAARectRenderer; |
967 GrOvalRenderer* fOvalRenderer; | 963 GrOvalRenderer* fOvalRenderer; |
968 | 964 |
969 bool fDidTestPMConversions; | 965 bool fDidTestPMConversions; |
970 int fPMToUPMConversion; | 966 int fPMToUPMConversion; |
971 int fUPMToPMConversion; | 967 int fUPMToPMConversion; |
972 | 968 |
973 struct CleanUpData { | 969 struct CleanUpData { |
974 PFCleanUpFunc fFunc; | 970 PFCleanUpFunc fFunc; |
975 void* fInfo; | 971 void* fInfo; |
(...skipping 20 matching lines...) Expand all Loading... |
996 | 992 |
997 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, | 993 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, |
998 const GrStrokeInfo& stroke); | 994 const GrStrokeInfo& stroke); |
999 | 995 |
1000 GrTexture* createResizedTexture(const GrSurfaceDesc& desc, | 996 GrTexture* createResizedTexture(const GrSurfaceDesc& desc, |
1001 const GrCacheID& cacheID, | 997 const GrCacheID& cacheID, |
1002 const void* srcData, | 998 const void* srcData, |
1003 size_t rowBytes, | 999 size_t rowBytes, |
1004 bool filter); | 1000 bool filter); |
1005 | 1001 |
1006 GrTexture* createNewScratchTexture(const GrSurfaceDesc& desc); | |
1007 | |
1008 /** | 1002 /** |
1009 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair | 1003 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair |
1010 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they | 1004 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they |
1011 * return NULL. | 1005 * return NULL. |
1012 */ | 1006 */ |
1013 const GrFragmentProcessor* createPMToUPMEffect(GrTexture*, bool swapRAndB, c
onst SkMatrix&); | 1007 const GrFragmentProcessor* createPMToUPMEffect(GrTexture*, bool swapRAndB, c
onst SkMatrix&); |
1014 const GrFragmentProcessor* createUPMToPMEffect(GrTexture*, bool swapRAndB, c
onst SkMatrix&); | 1008 const GrFragmentProcessor* createUPMToPMEffect(GrTexture*, bool swapRAndB, c
onst SkMatrix&); |
1015 | 1009 |
1016 /** | 1010 /** |
1017 * This callback allows the resource cache to callback into the GrContext | 1011 * This callback allows the resource cache to callback into the GrContext |
1018 * when the cache is still overbudget after a purge. | 1012 * when the cache is still over budget after a purge. |
1019 */ | 1013 */ |
1020 static bool OverbudgetCB(void* data); | 1014 static void OverBudgetCB(void* data); |
1021 | 1015 |
1022 typedef SkRefCnt INHERITED; | 1016 typedef SkRefCnt INHERITED; |
1023 }; | 1017 }; |
1024 | 1018 |
1025 #endif | 1019 #endif |
OLD | NEW |