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

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

Issue 26557003: Add a GPU paths to resource cache of the context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkStrokeRec.h ('k') | src/gpu/GrContext.cpp » ('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 11 matching lines...) Expand all
22 class GrAutoScratchTexture; 22 class GrAutoScratchTexture;
23 class GrDrawState; 23 class GrDrawState;
24 class GrDrawTarget; 24 class GrDrawTarget;
25 class GrEffect; 25 class GrEffect;
26 class GrFontCache; 26 class GrFontCache;
27 class GrGpu; 27 class GrGpu;
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 GrPathRenderer; 33 class GrPathRenderer;
33 class GrResourceEntry; 34 class GrResourceEntry;
34 class GrResourceCache; 35 class GrResourceCache;
35 class GrStencilBuffer; 36 class GrStencilBuffer;
36 class GrTestTarget; 37 class GrTestTarget;
37 class GrTextureParams; 38 class GrTextureParams;
38 class GrVertexBuffer; 39 class GrVertexBuffer;
39 class GrVertexBufferAllocPool; 40 class GrVertexBufferAllocPool;
40 class GrSoftwarePathRenderer; 41 class GrSoftwarePathRenderer;
41 class SkStrokeRec; 42 class SkStrokeRec;
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 918
918 GrTexture* createResizedTexture(const GrTextureDesc& desc, 919 GrTexture* createResizedTexture(const GrTextureDesc& desc,
919 const GrCacheID& cacheID, 920 const GrCacheID& cacheID,
920 void* srcData, 921 void* srcData,
921 size_t rowBytes, 922 size_t rowBytes,
922 bool filter); 923 bool filter);
923 924
924 // Needed so GrTexture's returnToCache helper function can call 925 // Needed so GrTexture's returnToCache helper function can call
925 // addExistingTextureToCache 926 // addExistingTextureToCache
926 friend class GrTexture; 927 friend class GrTexture;
928 friend class GrStencilAndCoverPathRenderer;
927 929
928 // Add an existing texture to the texture cache. This is intended solely 930 // Add an existing texture to the texture cache. This is intended solely
929 // for use with textures released from an GrAutoScratchTexture. 931 // for use with textures released from an GrAutoScratchTexture.
930 void addExistingTextureToCache(GrTexture* texture); 932 void addExistingTextureToCache(GrTexture* texture);
931 933
932 /** 934 /**
933 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair 935 * These functions create premul <-> unpremul effects if it is possible to g enerate a pair
934 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they 936 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O therwise, they
935 * return NULL. 937 * return NULL.
936 */ 938 */
937 const GrEffectRef* createPMToUPMEffect(GrTexture* texture, 939 const GrEffectRef* createPMToUPMEffect(GrTexture* texture,
938 bool swapRAndB, 940 bool swapRAndB,
939 const SkMatrix& matrix); 941 const SkMatrix& matrix);
940 const GrEffectRef* createUPMToPMEffect(GrTexture* texture, 942 const GrEffectRef* createUPMToPMEffect(GrTexture* texture,
941 bool swapRAndB, 943 bool swapRAndB,
942 const SkMatrix& matrix); 944 const SkMatrix& matrix);
943 945
944 /** 946 /**
945 * This callback allows the resource cache to callback into the GrContext 947 * This callback allows the resource cache to callback into the GrContext
946 * when the cache is still overbudget after a purge. 948 * when the cache is still overbudget after a purge.
947 */ 949 */
948 static bool OverbudgetCB(void* data); 950 static bool OverbudgetCB(void* data);
949 951
952 /** Creates a new gpu path, based on the specified path and stroke and retur ns it.
953 * The caller owns a ref on the returned path which must be balanced by a ca ll to unref.
954 *
955 * @param skPath the path geometry.
956 * @param stroke the path stroke.
957 * @return a new path or NULL if the operation is not supported by the backe nd.
958 */
959 GrPath* createPath(const SkPath& skPath, const SkStrokeRec& stroke);
960
950 typedef SkRefCnt INHERITED; 961 typedef SkRefCnt INHERITED;
951 }; 962 };
952 963
953 /** 964 /**
954 * Gets and locks a scratch texture from a descriptor using either exact or appr oximate criteria. 965 * Gets and locks a scratch texture from a descriptor using either exact or appr oximate criteria.
955 * Unlocks texture in the destructor. 966 * Unlocks texture in the destructor.
956 */ 967 */
957 class GrAutoScratchTexture : public ::SkNoncopyable { 968 class GrAutoScratchTexture : public ::SkNoncopyable {
958 public: 969 public:
959 GrAutoScratchTexture() 970 GrAutoScratchTexture()
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1041 }
1031 1042
1032 GrTexture* texture() { return fTexture; } 1043 GrTexture* texture() { return fTexture; }
1033 1044
1034 private: 1045 private:
1035 GrContext* fContext; 1046 GrContext* fContext;
1036 GrTexture* fTexture; 1047 GrTexture* fTexture;
1037 }; 1048 };
1038 1049
1039 #endif 1050 #endif
OLDNEW
« no previous file with comments | « include/core/SkStrokeRec.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698