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

Issue 5908062: Make GrDrawState object used by GrDrawTarget be settable; set in GrInOrderDrawBuffer playback (Closed)

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

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -15 lines) Patch
M src/gpu/GrDrawTarget.h View 3 chunks +21 lines, -4 lines 0 comments Download
M src/gpu/GrDrawTarget.cpp View 5 chunks +19 lines, -5 lines 6 comments Download
M src/gpu/GrInOrderDrawBuffer.cpp View 4 chunks +7 lines, -3 lines 2 comments Download
M src/gpu/gl/GrGpuGL.cpp View 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 3
bsalomon
This avoids copies of GrDrawState during the draw buffer playback. Instead we just point the ...
12 years, 7 months ago (2012-03-26 20:59:50 UTC) #1
TomH
LGTM http://codereview.appspot.com/5908062/diff/1/src/gpu/GrDrawTarget.cpp File src/gpu/GrDrawTarget.cpp (right): http://codereview.appspot.com/5908062/diff/1/src/gpu/GrDrawTarget.cpp#newcode477 src/gpu/GrDrawTarget.cpp:477: fDrawState = &fDefaultDrawState; It's dangerous to have a ...
12 years, 7 months ago (2012-03-26 21:11:01 UTC) #2
bsalomon
12 years, 7 months ago (2012-03-27 17:23:07 UTC) #3
Closed with r3506.

http://codereview.appspot.com/5908062/diff/1/src/gpu/GrDrawTarget.cpp
File src/gpu/GrDrawTarget.cpp (right):

http://codereview.appspot.com/5908062/diff/1/src/gpu/GrDrawTarget.cpp#newcode477
src/gpu/GrDrawTarget.cpp:477: fDrawState = &fDefaultDrawState;
On 2012/03/26 21:11:01, TomH wrote:
> It's dangerous to have a reference-counted object that isn't independently
> heap-allocated, isn't it? Yeah, I know we're being careful and it's not going
to
> get accidentally unrefed, I just want to be explicit here...

I thought we had stack allocated ref count objects frequently in Skia (though I
could be wrong about that). I'll add a comment.

http://codereview.appspot.com/5908062/diff/1/src/gpu/GrDrawTarget.cpp#newcode519
src/gpu/GrDrawTarget.cpp:519: fDrawState->unref();
On 2012/03/26 21:11:01, TomH wrote:
> Need to check for idempotency before we unref.

nice catch

http://codereview.appspot.com/5908062/diff/1/src/gpu/GrDrawTarget.cpp#newcode529
src/gpu/GrDrawTarget.cpp:529: state->fState.set(this->getDrawState());
On 2012/03/26 21:11:01, TomH wrote:
> I know we want our clients to use the API, but is there a particular reason
> you're having us use the API instead of referring to the member?

I was thinking that in the future we might change to having a stack of
prealloc'ed GrDrawState objects or something along those lines. If everybody
calls the (currently inlined) function then it would easier to experiment /
change.
Sign in to reply to this message.

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