This CL adds more structure to the cacheID. The resource type is now explicitly represented (instead of being a bit flag) and a new domain field has been added.
This patch makes the resource type & domain explicitly extensible. It also separates the GrCacheID ...
12 years, 3 months ago
(2012-08-07 12:55:38 UTC)
#2
This patch makes the resource type & domain explicitly extensible. It also
separates the GrCacheID class from GrTextureDesc and moves it to its own files.
It also makes greater use of the GrCacheID class in the GrTexture and
GrStencilBuffer classes.
It looks like the GrCacheID class may replace the GrResourceKey class.
The private/public switch was to protect the member variable from inadvertent changes. Moving the static ...
12 years, 3 months ago
(2012-08-07 17:58:49 UTC)
#6
The private/public switch was to protect the member variable from inadvertent
changes. Moving the static var into the accessor functions is much safer.
http://codereview.appspot.com/6458089/diff/8001/src/gpu/GrCacheID.h
File src/gpu/GrCacheID.h (right):
http://codereview.appspot.com/6458089/diff/8001/src/gpu/GrCacheID.h#newcode14
src/gpu/GrCacheID.h:14: #define SK_DECLARE_RESOURCE_TYPE()
\
On 2012/08/07 15:26:25, bsalomon wrote:
> I think we should use the GR_ prefix since these macros only make sense in
> GR-land.
>
> Also, maybe we should use the word cache, esp since we use the word "domain"
in
> at least one other context (texture domain).
>
> GR_DECLARE_RESOURCE_CACHE_TYPE
> GR_DECLARE_RESOURCE_CACHE_DOMAIN
>
> ?
>
>
> I don't love saying public: and private: in macros. But it may not be easily
> avoided here. Do we need the types/domains in the headers? It looks like the
> current changes could work with non-member static functions in the cpp files
> without declaring the type/domain ids in their headers.
Done.
Issue 6458089: Refactored cacheID in preparation for clip mask caching changes
(Closed)
Created 12 years, 3 months ago by robertphillips
Modified 12 years, 3 months ago
Reviewers: bsalomon
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 26