http://codereview.appspot.com/6251049/diff/1/include/gpu/GrContext.h File include/gpu/GrContext.h (right): http://codereview.appspot.com/6251049/diff/1/include/gpu/GrContext.h#newcode862 include/gpu/GrContext.h:862: Having the reset function made this a bit clearer ...
12 years, 6 months ago
(2012-05-24 19:04:44 UTC)
#1
PTAL I have "fixed" the Android crash. In the original delivery I was greatly extending ...
12 years, 5 months ago
(2012-06-12 15:29:39 UTC)
#9
PTAL
I have "fixed" the Android crash. In the original delivery I was greatly
extending the life span of some of the textures. A texture allocated in 1 GM
might live well into the following GM. When these textures were being freed in
the following GM a crash would ensue. The "fix" is to force the drawstate to
relinquish its ref of the textures once drawing is complete. This restores the
texture's lifespans to what they were before this CL (and "fixes" the Android
crash)
http://codereview.appspot.com/6251049/diff/18001/src/gpu/GrDrawState.h
File src/gpu/GrDrawState.h (right):
http://codereview.appspot.com/6251049/diff/18001/src/gpu/GrDrawState.h#newcod...
src/gpu/GrDrawState.h:847:
Moved fFirstCoverageStage here to fix Linux alignment issue (the assert on line
125 was failing)
Can we see the release textures part separately? I think it interacts with stuff Tom ...
12 years, 5 months ago
(2012-06-13 13:21:35 UTC)
#10
Can we see the release textures part separately? I think it interacts with stuff
Tom is or will be working on to move texture ownership out of GrDrawState and
into the custom effects.
Here is my proposal for how it could work, though I'd like Tom to comment on
whether this will work for him:
GrDrawState gets a releaseTextures method. Today it safe-set-nulls the fTextures
array. In the future it passes the signal to the list of custom effects to
release their textures.
Rather than adding a GrContext::releaseTextures function (and calls to
setTexture(i, NULL)) it seems like we could have
GrDrawState::AutoReleaseTextures that each GrContext::draw* call instantiates
before SetPaint is called.
The infinite loop prevention is a bit hairy. However, the call setTexture(NULL)/setRenderTarget(NULL) calls in the ...
12 years, 5 months ago
(2012-06-13 19:46:46 UTC)
#13
The infinite loop prevention is a bit hairy. However, the call
setTexture(NULL)/setRenderTarget(NULL) calls in the notify functions were
workarounds for the fact that draw state doesn't ref count. If the objects can't
disappear while GrGpu's drawState has a pointer to them, then we don't need the
checks/set-to-null code anymore. (We do still need to zero out the fHW* values
since they aren't ref counted and a new object could be created at the same
address).
http://codereview.appspot.com/6251049/diff/13003/src/gpu/GrContext.cpp
File src/gpu/GrContext.cpp (right):
http://codereview.appspot.com/6251049/diff/13003/src/gpu/GrContext.cpp#newcode77
src/gpu/GrContext.cpp:77: fDrawState->reset();
Are we sure this is a problem? Can't the cache just do its unref() before
GrDrawState does its unref()?
http://codereview.appspot.com/6251049/diff/13003/src/gpu/GrContext.cpp#newcode79
src/gpu/GrContext.cpp:79: fGpu->setDrawState(NULL);
I'm not sure I understand. It's draw state is the one above (that we just
reset).
LGTM (feel free to ignore or take the GrSafeAssign suggestion.) http://codereview.appspot.com/6251049/diff/14008/src/gpu/GrDrawState.h File src/gpu/GrDrawState.h (right): http://codereview.appspot.com/6251049/diff/14008/src/gpu/GrDrawState.h#newcode70 ...
12 years, 5 months ago
(2012-06-13 21:04:44 UTC)
#17
Issue 6251049: Altered GrDrawState to always ref texture and render target
(Closed)
Created 12 years, 6 months ago by robertphillips
Modified 12 years, 5 months ago
Reviewers: bsalomon, TomH
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 29