Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: include/gpu/GrContext.h

Issue 726913002: Revert of Replace GrResourceCache with GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrConfig.h ('k') | include/gpu/GrGpuResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
36 class GrResourceCache2; 37 class GrResourceCache2;
37 class GrStencilBuffer; 38 class GrStencilBuffer;
38 class GrTestTarget; 39 class GrTestTarget;
39 class GrTextContext; 40 class GrTextContext;
40 class GrTextureParams; 41 class GrTextureParams;
41 class GrVertexBuffer; 42 class GrVertexBuffer;
42 class GrVertexBufferAllocPool; 43 class GrVertexBufferAllocPool;
43 class GrStrokeInfo; 44 class GrStrokeInfo;
44 class GrSoftwarePathRenderer; 45 class GrSoftwarePathRenderer;
45 class SkStrokeRec; 46 class SkStrokeRec;
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 876
876 /////////////////////////////////////////////////////////////////////////// 877 ///////////////////////////////////////////////////////////////////////////
877 // Functions intended for internal use only. 878 // Functions intended for internal use only.
878 GrGpu* getGpu() { return fGpu; } 879 GrGpu* getGpu() { return fGpu; }
879 const GrGpu* getGpu() const { return fGpu; } 880 const GrGpu* getGpu() const { return fGpu; }
880 GrFontCache* getFontCache() { return fFontCache; } 881 GrFontCache* getFontCache() { return fFontCache; }
881 GrLayerCache* getLayerCache() { return fLayerCache.get(); } 882 GrLayerCache* getLayerCache() { return fLayerCache.get(); }
882 GrDrawTarget* getTextTarget(); 883 GrDrawTarget* getTextTarget();
883 const GrIndexBuffer* getQuadIndexBuffer() const; 884 const GrIndexBuffer* getQuadIndexBuffer() const;
884 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } 885 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; }
886 GrResourceCache* getResourceCache() { return fResourceCache; }
885 GrResourceCache2* getResourceCache2() { return fResourceCache2; } 887 GrResourceCache2* getResourceCache2() { return fResourceCache2; }
886 888
887 // Called by tests that draw directly to the context via GrDrawTarget 889 // Called by tests that draw directly to the context via GrDrawTarget
888 void getTestTarget(GrTestTarget*); 890 void getTestTarget(GrTestTarget*);
889 891
890 void addGpuTraceMarker(const GrGpuTraceMarker* marker); 892 void addGpuTraceMarker(const GrGpuTraceMarker* marker);
891 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); 893 void removeGpuTraceMarker(const GrGpuTraceMarker* marker);
892 894
893 /** 895 /**
894 * Stencil buffers add themselves to the cache using addStencilBuffer. findS tencilBuffer is 896 * Stencil buffers add themselves to the cache using addStencilBuffer. findS tencilBuffer is
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 const GPUStats* gpuStats() const; 941 const GPUStats* gpuStats() const;
940 #endif 942 #endif
941 943
942 private: 944 private:
943 GrGpu* fGpu; 945 GrGpu* fGpu;
944 SkMatrix fViewMatrix; 946 SkMatrix fViewMatrix;
945 SkAutoTUnref<GrRenderTarget> fRenderTarget; 947 SkAutoTUnref<GrRenderTarget> fRenderTarget;
946 const GrClipData* fClip; // TODO: make this ref counted 948 const GrClipData* fClip; // TODO: make this ref counted
947 GrDrawState* fDrawState; 949 GrDrawState* fDrawState;
948 950
951 GrResourceCache* fResourceCache;
949 GrResourceCache2* fResourceCache2; 952 GrResourceCache2* fResourceCache2;
950 GrFontCache* fFontCache; 953 GrFontCache* fFontCache;
951 SkAutoTDelete<GrLayerCache> fLayerCache; 954 SkAutoTDelete<GrLayerCache> fLayerCache;
952 955
953 GrPathRendererChain* fPathRendererChain; 956 GrPathRendererChain* fPathRendererChain;
954 GrSoftwarePathRenderer* fSoftwarePathRenderer; 957 GrSoftwarePathRenderer* fSoftwarePathRenderer;
955 958
956 GrVertexBufferAllocPool* fDrawBufferVBAllocPool; 959 GrVertexBufferAllocPool* fDrawBufferVBAllocPool;
957 GrIndexBufferAllocPool* fDrawBufferIBAllocPool; 960 GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
958 GrInOrderDrawBuffer* fDrawBuffer; 961 GrInOrderDrawBuffer* fDrawBuffer;
959 962
960 // Set by OverbudgetCB() to request that GrContext flush before exiting a dr aw. 963 // Set by OverbudgetCB() to request that GrContext flush before exiting a dr aw.
961 bool fFlushToReduceCacheSize; 964 bool fFlushToReduceCacheSize;
965
962 GrAARectRenderer* fAARectRenderer; 966 GrAARectRenderer* fAARectRenderer;
963 GrOvalRenderer* fOvalRenderer; 967 GrOvalRenderer* fOvalRenderer;
964 968
965 bool fDidTestPMConversions; 969 bool fDidTestPMConversions;
966 int fPMToUPMConversion; 970 int fPMToUPMConversion;
967 int fUPMToPMConversion; 971 int fUPMToPMConversion;
968 972
969 struct CleanUpData { 973 struct CleanUpData {
970 PFCleanUpFunc fFunc; 974 PFCleanUpFunc fFunc;
971 void* fInfo; 975 void* fInfo;
(...skipping 20 matching lines...) Expand all
992 996
993 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, 997 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path,
994 const GrStrokeInfo& stroke); 998 const GrStrokeInfo& stroke);
995 999
996 GrTexture* createResizedTexture(const GrSurfaceDesc& desc, 1000 GrTexture* createResizedTexture(const GrSurfaceDesc& desc,
997 const GrCacheID& cacheID, 1001 const GrCacheID& cacheID,
998 const void* srcData, 1002 const void* srcData,
999 size_t rowBytes, 1003 size_t rowBytes,
1000 bool filter); 1004 bool filter);
1001 1005
1006 GrTexture* createNewScratchTexture(const GrSurfaceDesc& desc);
1007
1002 /** 1008 /**
1003 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair 1009 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair
1004 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they 1010 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they
1005 * return NULL. 1011 * return NULL.
1006 */ 1012 */
1007 const GrFragmentProcessor* createPMToUPMEffect(GrTexture*, bool swapRAndB, c onst SkMatrix&); 1013 const GrFragmentProcessor* createPMToUPMEffect(GrTexture*, bool swapRAndB, c onst SkMatrix&);
1008 const GrFragmentProcessor* createUPMToPMEffect(GrTexture*, bool swapRAndB, c onst SkMatrix&); 1014 const GrFragmentProcessor* createUPMToPMEffect(GrTexture*, bool swapRAndB, c onst SkMatrix&);
1009 1015
1010 /** 1016 /**
1011 * This callback allows the resource cache to callback into the GrContext 1017 * This callback allows the resource cache to callback into the GrContext
1012 * when the cache is still over budget after a purge. 1018 * when the cache is still overbudget after a purge.
1013 */ 1019 */
1014 static void OverBudgetCB(void* data); 1020 static bool OverbudgetCB(void* data);
1015 1021
1016 typedef SkRefCnt INHERITED; 1022 typedef SkRefCnt INHERITED;
1017 }; 1023 };
1018 1024
1019 #endif 1025 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrConfig.h ('k') | include/gpu/GrGpuResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698