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

Issue 6498064: Begin moving locking out of GrResourceCache (Closed)

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

Description

This CL starts the process of moving locking out of the Resource Cache. It isn't complete but this CL alone should be plenty to consider. It also removes GrResourceCache::attach (which was no longer used). It originally also removed GrResourceCache::LockType (which was only used for stencil buffer and isn't compatible with where we are going) but naively removing it caused huge differences in the cache usage.

Patch Set 1 #

Patch Set 2 : Removed unneeded purge parameter to unlock #

Patch Set 3 : Reinstated LockType #

Total comments: 6

Patch Set 4 : removed \n #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -47 lines) Patch
M src/gpu/GrResourceCache.h View 1 2 2 chunks +1 line, -15 lines 0 comments Download
M src/gpu/GrResourceCache.cpp View 1 2 3 7 chunks +22 lines, -31 lines 0 comments Download
M src/gpu/SkGrPixelRef.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
robertphillips
11 years, 8 months ago (2012-08-30 18:47:09 UTC) #1
bsalomon
LGTM http://codereview.appspot.com/6498064/diff/4001/src/gpu/GrResourceCache.cpp File src/gpu/GrResourceCache.cpp (right): http://codereview.appspot.com/6498064/diff/4001/src/gpu/GrResourceCache.cpp#newcode207 src/gpu/GrResourceCache.cpp:207: this->attachToHead(entry, false); Just curious, was this reorder necessary ...
11 years, 8 months ago (2012-08-30 19:09:57 UTC) #2
robertphillips
11 years, 8 months ago (2012-08-30 19:22:53 UTC) #3
committed as r5354

http://codereview.appspot.com/6498064/diff/4001/src/gpu/GrResourceCache.cpp
File src/gpu/GrResourceCache.cpp (right):

http://codereview.appspot.com/6498064/diff/4001/src/gpu/GrResourceCache.cpp#n...
src/gpu/GrResourceCache.cpp:207: this->attachToHead(entry, false);
findAndLock is going to go away - replaced with a call to find followed
(temporarily) by a call to lock in GrContext::findAndLockTexture. This
re-ordering was to move the lock to a better place from which to move it out.

Note that this CL also makes it so the only place GrResourceEntry::lock is
called is from within GrResourceCache::lock.

http://codereview.appspot.com/6498064/diff/4001/src/gpu/GrResourceCache.cpp#n...
src/gpu/GrResourceCache.cpp:444: for ( ; NULL != entry; entry = iter.next()) {
That's a bit problematic in this case since the DLinkedList allows both forward
& reverse iteration. For 'next' we wouldn't know if we had hit the end of the
list or if it was the first call & we should snap to the start.

http://codereview.appspot.com/6498064/diff/4001/src/gpu/GrResourceCache.cpp#n...
src/gpu/GrResourceCache.cpp:450: EntryList::Iter::kHead_IterStart);
On 2012/08/30 19:09:57, bsalomon wrote:
> doesn't fit on one line?

Done.
Sign in to reply to this message.

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