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

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

Issue 196133014: Implement text rendering with NVPR (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix VS "performance warning" converting int to bool Created 6 years, 6 months 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/core/SkPaint.h ('k') | include/gpu/GrPaint.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 20 matching lines...) Expand all
31 class GrIndexBufferAllocPool; 31 class GrIndexBufferAllocPool;
32 class GrInOrderDrawBuffer; 32 class GrInOrderDrawBuffer;
33 class GrLayerCache; 33 class GrLayerCache;
34 class GrOvalRenderer; 34 class GrOvalRenderer;
35 class GrPath; 35 class GrPath;
36 class GrPathRenderer; 36 class GrPathRenderer;
37 class GrResourceEntry; 37 class GrResourceEntry;
38 class GrResourceCache; 38 class GrResourceCache;
39 class GrStencilBuffer; 39 class GrStencilBuffer;
40 class GrTestTarget; 40 class GrTestTarget;
41 class GrTextContext;
41 class GrTextureParams; 42 class GrTextureParams;
42 class GrVertexBuffer; 43 class GrVertexBuffer;
43 class GrVertexBufferAllocPool; 44 class GrVertexBufferAllocPool;
44 class GrStrokeInfo; 45 class GrStrokeInfo;
45 class GrSoftwarePathRenderer; 46 class GrSoftwarePathRenderer;
46 class SkStrokeRec; 47 class SkStrokeRec;
47 48
48 class SK_API GrContext : public SkRefCnt { 49 class SK_API GrContext : public SkRefCnt {
49 public: 50 public:
50 SK_DECLARE_INST_COUNT(GrContext) 51 SK_DECLARE_INST_COUNT(GrContext)
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 */ 188 */
188 void addResourceToCache(const GrResourceKey&, GrCacheable*); 189 void addResourceToCache(const GrResourceKey&, GrCacheable*);
189 190
190 /** 191 /**
191 * Finds a resource in the cache, based on the specified key. This is intend ed for use in 192 * Finds a resource in the cache, based on the specified key. This is intend ed for use in
192 * conjunction with addResourceToCache(). The return value will be NULL if n ot found. The 193 * conjunction with addResourceToCache(). The return value will be NULL if n ot found. The
193 * caller must balance with a call to unref(). 194 * caller must balance with a call to unref().
194 */ 195 */
195 GrCacheable* findAndRefCachedResource(const GrResourceKey&); 196 GrCacheable* findAndRefCachedResource(const GrResourceKey&);
196 197
198 /**
199 * Creates a new text rendering context that is optimal for the
200 * render target and the context. Caller assumes the ownership
201 * of the returned object. The returned object must be deleted
202 * before the context is destroyed.
203 */
204 GrTextContext* createTextContext(GrRenderTarget*,
205 const SkDeviceProperties&,
206 bool enableDistanceFieldFonts);
207
197 /////////////////////////////////////////////////////////////////////////// 208 ///////////////////////////////////////////////////////////////////////////
198 // Textures 209 // Textures
199 210
200 /** 211 /**
201 * Creates a new entry, based on the specified key and texture and returns i t. The caller owns a 212 * Creates a new entry, based on the specified key and texture and returns i t. The caller owns a
202 * ref on the returned texture which must be balanced by a call to unref. 213 * ref on the returned texture which must be balanced by a call to unref.
203 * 214 *
204 * @param params The texture params used to draw a texture may help deter mine 215 * @param params The texture params used to draw a texture may help deter mine
205 * the cache entry used. (e.g. different versions may exist 216 * the cache entry used. (e.g. different versions may exist
206 * for different wrap modes on GPUs with limited NPOT 217 * for different wrap modes on GPUs with limited NPOT
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 GrTexture* createResizedTexture(const GrTextureDesc& desc, 1022 GrTexture* createResizedTexture(const GrTextureDesc& desc,
1012 const GrCacheID& cacheID, 1023 const GrCacheID& cacheID,
1013 const void* srcData, 1024 const void* srcData,
1014 size_t rowBytes, 1025 size_t rowBytes,
1015 bool filter); 1026 bool filter);
1016 1027
1017 // Needed so GrTexture's returnToCache helper function can call 1028 // Needed so GrTexture's returnToCache helper function can call
1018 // addExistingTextureToCache 1029 // addExistingTextureToCache
1019 friend class GrTexture; 1030 friend class GrTexture;
1020 friend class GrStencilAndCoverPathRenderer; 1031 friend class GrStencilAndCoverPathRenderer;
1032 friend class GrStencilAndCoverTextContext;
1021 1033
1022 // Add an existing texture to the texture cache. This is intended solely 1034 // Add an existing texture to the texture cache. This is intended solely
1023 // for use with textures released from an GrAutoScratchTexture. 1035 // for use with textures released from an GrAutoScratchTexture.
1024 void addExistingTextureToCache(GrTexture* texture); 1036 void addExistingTextureToCache(GrTexture* texture);
1025 1037
1026 /** 1038 /**
1027 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair 1039 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair
1028 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they 1040 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they
1029 * return NULL. 1041 * return NULL.
1030 */ 1042 */
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 } 1145 }
1134 1146
1135 GrTexture* texture() { return fTexture; } 1147 GrTexture* texture() { return fTexture; }
1136 1148
1137 private: 1149 private:
1138 GrContext* fContext; 1150 GrContext* fContext;
1139 GrTexture* fTexture; 1151 GrTexture* fTexture;
1140 }; 1152 };
1141 1153
1142 #endif 1154 #endif
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | include/gpu/GrPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698