Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2538)

Issue 6954047: Simplify cache IDs and keys. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 12 months ago by bsalomon
Modified:
11 years, 11 months ago
Reviewers:
robertphillips
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Simplify cache IDs and keys. R=robertphillips@google.com

Patch Set 1 #

Patch Set 2 : #

Total comments: 36

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+367 lines, -497 lines) Patch
M gyp/gpu.gypi View 1 2 1 chunk +0 lines, -1 line 0 comments Download
D include/gpu/GrCacheID.h View 1 2 3 4 1 chunk +0 lines, -99 lines 0 comments Download
M include/gpu/GrContext.h View 1 2 3 7 chunks +11 lines, -15 lines 2 comments Download
M include/gpu/GrTexture.h View 1 2 3 3 chunks +3 lines, -9 lines 0 comments Download
M include/gpu/GrTypes.h View 1 2 3 4 1 chunk +39 lines, -30 lines 4 comments Download
M include/gpu/SkGpuDevice.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M include/gpu/SkGr.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/gpu/GrBinHashKey.h View 1 2 4 chunks +21 lines, -15 lines 2 comments Download
M src/gpu/GrCacheID.cpp View 1 2 3 4 1 chunk +10 lines, -29 lines 0 comments Download
M src/gpu/GrClipMaskManager.h View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M src/gpu/GrClipMaskManager.cpp View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M src/gpu/GrContext.cpp View 1 2 3 7 chunks +21 lines, -24 lines 2 comments Download
M src/gpu/GrResourceCache.h View 1 2 3 4 chunks +106 lines, -70 lines 0 comments Download
M src/gpu/GrResourceCache.cpp View 1 2 2 chunks +14 lines, -30 lines 2 comments Download
M src/gpu/GrStencilBuffer.h View 1 2 2 chunks +0 lines, -2 lines 0 comments Download
M src/gpu/GrStencilBuffer.cpp View 1 2 2 chunks +17 lines, -20 lines 0 comments Download
M src/gpu/GrTHashCache.h View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
M src/gpu/GrTexture.cpp View 1 2 3 2 chunks +45 lines, -70 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 3 chunks +5 lines, -21 lines 0 comments Download
M src/gpu/SkGr.cpp View 1 2 3 5 chunks +61 lines, -33 lines 0 comments Download
M src/gpu/effects/GrTextureStripAtlas.h View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M src/gpu/effects/GrTextureStripAtlas.cpp View 1 2 3 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 6
bsalomon
I still have to check whether this would break WK at all.
11 years, 12 months ago (2012-12-19 17:03:42 UTC) #1
robertphillips
I'm a bit unsure about including the match criteria in the key itself. https://codereview.appspot.com/6954047/diff/2001/include/gpu/GrTypes.h File ...
11 years, 12 months ago (2012-12-19 18:49:58 UTC) #2
bsalomon
Uploaded a version to address smaller comments. I'm going to try to rewrite the scratch ...
11 years, 12 months ago (2012-12-19 19:33:21 UTC) #3
bsalomon
Refactored to remove knowledge of scratch domain and match criteria from GrCacheID. https://codereview.appspot.com/6954047/diff/2001/src/gpu/GrResourceCache.h File src/gpu/GrResourceCache.h ...
11 years, 12 months ago (2012-12-19 20:57:36 UTC) #4
robertphillips
LGTM + some questions & suggestions/nits https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrContext.h File include/gpu/GrContext.h (right): https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrContext.h#newcode120 include/gpu/GrContext.h:120: /** returns -> ...
11 years, 12 months ago (2012-12-20 14:02:42 UTC) #5
bsalomon
11 years, 12 months ago (2012-12-20 14:21:09 UTC) #6
https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrContext.h
File include/gpu/GrContext.h (right):

https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrContext.h#newc...
include/gpu/GrContext.h:120: /**
On 2012/12/20 14:02:43, robertphillips wrote:
> returns -> return

Done.

https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrTypes.h
File include/gpu/GrTypes.h (right):

https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrTypes.h#newcod...
include/gpu/GrTypes.h:481: */
On 2012/12/20 14:02:43, robertphillips wrote:
> Add an kInvalid_Key and init here? We could then call
> "this->reset(kInvalid_Domain, kInvalid_Key)".

The key's meaning is domain-specific. If we say some value is illegal then all
domains have to respect that restriction. It seems like it adds little value and
a burden on domains.

I added some asserts to the getters that the domain is valid.

https://codereview.appspot.com/6954047/diff/1023/include/gpu/GrTypes.h#newcod...
include/gpu/GrTypes.h:507: 
On 2012/12/20 14:02:43, robertphillips wrote:
> Why this friend? If needed add a comment like "// needs access to XXX in order
> to YYY"?

No longer necessary after refactor of match criteria, removed.

https://codereview.appspot.com/6954047/diff/1023/src/gpu/GrBinHashKey.h
File src/gpu/GrBinHashKey.h (right):

https://codereview.appspot.com/6954047/diff/1023/src/gpu/GrBinHashKey.h#newco...
src/gpu/GrBinHashKey.h:95: const uint8_t* getData() const {
On 2012/12/20 14:02:43, robertphillips wrote:
> GrAssert(fIsValid)?

Done.

https://codereview.appspot.com/6954047/diff/1023/src/gpu/GrContext.cpp
File src/gpu/GrContext.cpp (right):

https://codereview.appspot.com/6954047/diff/1023/src/gpu/GrContext.cpp#newcod...
src/gpu/GrContext.cpp:435: if (NULL != texture) {
On 2012/12/20 14:02:43, robertphillips wrote:
> Is it kosher to switch from texture->desc to desc in this call?
Hmm.. should be, but will change back.

https://codereview.appspot.com/6954047/diff/1023/src/gpu/GrResourceCache.cpp
File src/gpu/GrResourceCache.cpp (right):

https://codereview.appspot.com/6954047/diff/1023/src/gpu/GrResourceCache.cpp#...
src/gpu/GrResourceCache.cpp:15: GrResourceKey::ResourceType
GrResourceKey::GenerateResourceType() {
On 2012/12/20 14:02:43, robertphillips wrote:
> Ignore this if you like: Do we want to proactively reserve an invalid resource
> type (e.g., ID 0)?

It seems like we just add such a thing when we need it... the IDs are runtime
assigned so no other code would need to change if we were to reserve a value.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b