| 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 17 matching lines...) Expand all Loading... |
| 28 class GrIndexBuffer; | 28 class GrIndexBuffer; |
| 29 class GrIndexBufferAllocPool; | 29 class GrIndexBufferAllocPool; |
| 30 class GrInOrderDrawBuffer; | 30 class GrInOrderDrawBuffer; |
| 31 class GrOvalRenderer; | 31 class GrOvalRenderer; |
| 32 class GrPath; | 32 class GrPath; |
| 33 class GrPathRenderer; | 33 class GrPathRenderer; |
| 34 class GrResourceEntry; | 34 class GrResourceEntry; |
| 35 class GrResourceCache; | 35 class GrResourceCache; |
| 36 class GrStencilBuffer; | 36 class GrStencilBuffer; |
| 37 class GrTestTarget; | 37 class GrTestTarget; |
| 38 class GrTextContext; |
| 38 class GrTextureParams; | 39 class GrTextureParams; |
| 39 class GrVertexBuffer; | 40 class GrVertexBuffer; |
| 40 class GrVertexBufferAllocPool; | 41 class GrVertexBufferAllocPool; |
| 41 class GrSoftwarePathRenderer; | 42 class GrSoftwarePathRenderer; |
| 42 class SkStrokeRec; | 43 class SkStrokeRec; |
| 43 | 44 |
| 44 class SK_API GrContext : public SkRefCnt { | 45 class SK_API GrContext : public SkRefCnt { |
| 45 public: | 46 public: |
| 46 SK_DECLARE_INST_COUNT(GrContext) | 47 SK_DECLARE_INST_COUNT(GrContext) |
| 47 | 48 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 /** | 110 /** |
| 110 * Returns the number of bytes of GPU memory hosted by the texture cache. | 111 * Returns the number of bytes of GPU memory hosted by the texture cache. |
| 111 */ | 112 */ |
| 112 size_t getGpuTextureCacheBytes() const; | 113 size_t getGpuTextureCacheBytes() const; |
| 113 | 114 |
| 114 /** | 115 /** |
| 115 * Returns the number of resources hosted by the texture cache. | 116 * Returns the number of resources hosted by the texture cache. |
| 116 */ | 117 */ |
| 117 int getGpuTextureCacheResourceCount() const; | 118 int getGpuTextureCacheResourceCount() const; |
| 118 | 119 |
| 120 /** |
| 121 * Creates a new text rendering context that is optimal for the |
| 122 * render target and the context. Caller assumes the ownership |
| 123 * of the returned object. The returned object must be deleted |
| 124 * before the context is destroyed. |
| 125 */ |
| 126 GrTextContext* createTextContext(GrRenderTarget*, |
| 127 const SkDeviceProperties&); |
| 128 |
| 119 /////////////////////////////////////////////////////////////////////////// | 129 /////////////////////////////////////////////////////////////////////////// |
| 120 // Textures | 130 // Textures |
| 121 | 131 |
| 122 /** | 132 /** |
| 123 * Creates a new entry, based on the specified key and texture and returns i
t. The caller owns a | 133 * Creates a new entry, based on the specified key and texture and returns i
t. The caller owns a |
| 124 * ref on the returned texture which must be balanced by a call to unref. | 134 * ref on the returned texture which must be balanced by a call to unref. |
| 125 * | 135 * |
| 126 * @param params The texture params used to draw a texture may help deter
mine | 136 * @param params The texture params used to draw a texture may help deter
mine |
| 127 * the cache entry used. (e.g. different versions may exist | 137 * the cache entry used. (e.g. different versions may exist |
| 128 * for different wrap modes on GPUs with limited NPOT | 138 * for different wrap modes on GPUs with limited NPOT |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 GrTexture* createResizedTexture(const GrTextureDesc& desc, | 950 GrTexture* createResizedTexture(const GrTextureDesc& desc, |
| 941 const GrCacheID& cacheID, | 951 const GrCacheID& cacheID, |
| 942 void* srcData, | 952 void* srcData, |
| 943 size_t rowBytes, | 953 size_t rowBytes, |
| 944 bool filter); | 954 bool filter); |
| 945 | 955 |
| 946 // Needed so GrTexture's returnToCache helper function can call | 956 // Needed so GrTexture's returnToCache helper function can call |
| 947 // addExistingTextureToCache | 957 // addExistingTextureToCache |
| 948 friend class GrTexture; | 958 friend class GrTexture; |
| 949 friend class GrStencilAndCoverPathRenderer; | 959 friend class GrStencilAndCoverPathRenderer; |
| 960 friend class GrStencilAndCoverTextContext; |
| 950 | 961 |
| 951 // Add an existing texture to the texture cache. This is intended solely | 962 // Add an existing texture to the texture cache. This is intended solely |
| 952 // for use with textures released from an GrAutoScratchTexture. | 963 // for use with textures released from an GrAutoScratchTexture. |
| 953 void addExistingTextureToCache(GrTexture* texture); | 964 void addExistingTextureToCache(GrTexture* texture); |
| 954 | 965 |
| 955 /** | 966 /** |
| 956 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair | 967 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair |
| 957 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they | 968 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they |
| 958 * return NULL. | 969 * return NULL. |
| 959 */ | 970 */ |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 } | 1073 } |
| 1063 | 1074 |
| 1064 GrTexture* texture() { return fTexture; } | 1075 GrTexture* texture() { return fTexture; } |
| 1065 | 1076 |
| 1066 private: | 1077 private: |
| 1067 GrContext* fContext; | 1078 GrContext* fContext; |
| 1068 GrTexture* fTexture; | 1079 GrTexture* fTexture; |
| 1069 }; | 1080 }; |
| 1070 | 1081 |
| 1071 #endif | 1082 #endif |
| OLD | NEW |