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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
892 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); | 892 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); |
893 | 893 |
894 GrPathRenderer* getPathRenderer( | 894 GrPathRenderer* getPathRenderer( |
895 const SkPath& path, | 895 const SkPath& path, |
896 const SkStrokeRec& stroke, | 896 const SkStrokeRec& stroke, |
897 const GrDrawTarget* target, | 897 const GrDrawTarget* target, |
898 bool allowSW, | 898 bool allowSW, |
899 GrPathRendererChain::DrawType drawType = GrPathRendererChain ::kColor_DrawType, | 899 GrPathRendererChain::DrawType drawType = GrPathRendererChain ::kColor_DrawType, |
900 GrPathRendererChain::StencilSupport* stencilSupport = NULL); | 900 GrPathRendererChain::StencilSupport* stencilSupport = NULL); |
901 | 901 |
902 /** | |
903 * Client code can store custom resources in the cache using | |
904 * addResourceToCache() and findCachedResource(). findCachedResource() does | |
905 * not modify the object's ref count, so the caller does not need to call | |
906 * unref(). | |
bsalomon
2014/04/30 20:19:52
I think this has to ref the object to be safe. Wha
Chris Dalton
2014/04/30 21:11:29
Right, that wording is confusing come to think of
| |
907 */ | |
908 void addResourceToCache(const GrResourceKey&, GrCacheable*); | |
909 GrCacheable* findCachedResource(const GrResourceKey& key); | |
910 | |
902 | 911 |
903 #if GR_CACHE_STATS | 912 #if GR_CACHE_STATS |
904 void printCacheStats() const; | 913 void printCacheStats() const; |
905 #endif | 914 #endif |
906 | 915 |
907 private: | 916 private: |
908 // Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer. | 917 // Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer. |
909 enum BufferedDraw { | 918 enum BufferedDraw { |
910 kYes_BufferedDraw, | 919 kYes_BufferedDraw, |
911 kNo_BufferedDraw, | 920 kNo_BufferedDraw, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1089 } | 1098 } |
1090 | 1099 |
1091 GrTexture* texture() { return fTexture; } | 1100 GrTexture* texture() { return fTexture; } |
1092 | 1101 |
1093 private: | 1102 private: |
1094 GrContext* fContext; | 1103 GrContext* fContext; |
1095 GrTexture* fTexture; | 1104 GrTexture* fTexture; |
1096 }; | 1105 }; |
1097 | 1106 |
1098 #endif | 1107 #endif |
OLD | NEW |