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

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: rebase and fix postext 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
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 18 matching lines...) Expand all
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 GrResourceCache;
37 class GrStencilBuffer; 37 class GrStencilBuffer;
38 class GrTestTarget; 38 class GrTestTarget;
39 class GrTextContext;
39 class GrTextureParams; 40 class GrTextureParams;
40 class GrVertexBuffer; 41 class GrVertexBuffer;
41 class GrVertexBufferAllocPool; 42 class GrVertexBufferAllocPool;
42 class GrSoftwarePathRenderer; 43 class GrSoftwarePathRenderer;
43 class SkStrokeRec; 44 class SkStrokeRec;
44 45
45 class SK_API GrContext : public SkRefCnt { 46 class SK_API GrContext : public SkRefCnt {
46 public: 47 public:
47 SK_DECLARE_INST_COUNT(GrContext) 48 SK_DECLARE_INST_COUNT(GrContext)
48 49
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 */ 185 */
185 void addResourceToCache(const GrResourceKey&, GrCacheable*); 186 void addResourceToCache(const GrResourceKey&, GrCacheable*);
186 187
187 /** 188 /**
188 * Finds a resource in the cache, based on the specified key. This is intend ed for use in 189 * Finds a resource in the cache, based on the specified key. This is intend ed for use in
189 * conjunction with addResourceToCache(). The return value will be NULL if n ot found. The 190 * conjunction with addResourceToCache(). The return value will be NULL if n ot found. The
190 * caller must balance with a call to unref(). 191 * caller must balance with a call to unref().
191 */ 192 */
192 GrCacheable* findAndRefCachedResource(const GrResourceKey&); 193 GrCacheable* findAndRefCachedResource(const GrResourceKey&);
193 194
195 /**
196 * Creates a new text rendering context that is optimal for the
197 * render target and the context. Caller assumes the ownership
198 * of the returned object. The returned object must be deleted
199 * before the context is destroyed.
200 */
201 GrTextContext* createTextContext(GrRenderTarget*,
202 const SkDeviceProperties&,
203 bool enableDistanceFieldFonts);
204
194 /////////////////////////////////////////////////////////////////////////// 205 ///////////////////////////////////////////////////////////////////////////
195 // Textures 206 // Textures
196 207
197 /** 208 /**
198 * Creates a new entry, based on the specified key and texture and returns i t. The caller owns a 209 * Creates a new entry, based on the specified key and texture and returns i t. The caller owns a
199 * ref on the returned texture which must be balanced by a call to unref. 210 * ref on the returned texture which must be balanced by a call to unref.
200 * 211 *
201 * @param params The texture params used to draw a texture may help deter mine 212 * @param params The texture params used to draw a texture may help deter mine
202 * the cache entry used. (e.g. different versions may exist 213 * the cache entry used. (e.g. different versions may exist
203 * for different wrap modes on GPUs with limited NPOT 214 * for different wrap modes on GPUs with limited NPOT
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 GrTexture* createResizedTexture(const GrTextureDesc& desc, 1011 GrTexture* createResizedTexture(const GrTextureDesc& desc,
1001 const GrCacheID& cacheID, 1012 const GrCacheID& cacheID,
1002 const void* srcData, 1013 const void* srcData,
1003 size_t rowBytes, 1014 size_t rowBytes,
1004 bool filter); 1015 bool filter);
1005 1016
1006 // Needed so GrTexture's returnToCache helper function can call 1017 // Needed so GrTexture's returnToCache helper function can call
1007 // addExistingTextureToCache 1018 // addExistingTextureToCache
1008 friend class GrTexture; 1019 friend class GrTexture;
1009 friend class GrStencilAndCoverPathRenderer; 1020 friend class GrStencilAndCoverPathRenderer;
1021 friend class GrStencilAndCoverTextContext;
1010 1022
1011 // Add an existing texture to the texture cache. This is intended solely 1023 // Add an existing texture to the texture cache. This is intended solely
1012 // for use with textures released from an GrAutoScratchTexture. 1024 // for use with textures released from an GrAutoScratchTexture.
1013 void addExistingTextureToCache(GrTexture* texture); 1025 void addExistingTextureToCache(GrTexture* texture);
1014 1026
1015 /** 1027 /**
1016 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair 1028 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair
1017 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they 1029 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they
1018 * return NULL. 1030 * return NULL.
1019 */ 1031 */
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 } 1134 }
1123 1135
1124 GrTexture* texture() { return fTexture; } 1136 GrTexture* texture() { return fTexture; }
1125 1137
1126 private: 1138 private:
1127 GrContext* fContext; 1139 GrContext* fContext;
1128 GrTexture* fTexture; 1140 GrTexture* fTexture;
1129 }; 1141 };
1130 1142
1131 #endif 1143 #endif
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkDraw.cpp » ('j') | src/core/SkDrawProcs.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698