This is mostly done to put reset in the "right" place as a member. But ...
12 years, 11 months ago
(2012-01-14 19:40:59 UTC)
#1
This is mostly done to put reset in the "right" place as a member. But it also
very slightly (but consistently) improved the perf of the chrome_scrollGmail
NULLGPU bench. I played with making fields in GrDrawState bitfields and not. Not
was a definite win over bitfields.
Closed with r3043. http://codereview.appspot.com/5543059/diff/2003/src/gpu/GrContext.cpp File src/gpu/GrContext.cpp (right): http://codereview.appspot.com/5543059/diff/2003/src/gpu/GrContext.cpp#newcode776 src/gpu/GrContext.cpp:776: *drawState->viewMatrix() = vm; On 2012/01/17 15:17:45, ...
12 years, 11 months ago
(2012-01-17 16:02:05 UTC)
#3
Closed with r3043.
http://codereview.appspot.com/5543059/diff/2003/src/gpu/GrContext.cpp
File src/gpu/GrContext.cpp (right):
http://codereview.appspot.com/5543059/diff/2003/src/gpu/GrContext.cpp#newcode776
src/gpu/GrContext.cpp:776: *drawState->viewMatrix() = vm;
On 2012/01/17 15:17:45, TomH wrote:
> Do we want to note that calling this->setPaint() with a default paint is
> equivalent to calling this->reset() & setting the viewMatrix? Or is it?
They aren't really equivalent. The GrPaint is a subset of the GrDrawState. There
are several differences (that happen not to matter here). This code was written
before there was any way to reset the GrDrawState (or even a GrDrawState at all)
and so used a default GrPaint to get to a known baseline state for most of the
draw state.
>
> Is it significant that sometimes we do both and sometimes we do only one? Or I
> note that we frequently call reset() and setRenderTarget() as a pair; should
> those be combined? Here we set the viewMatrix to something different, which
> seems like an unusual use case?
We might want to have a reset that takes a rt and vm since these frequently set
right after reset. I experimented with a flag on reset to preserve the rt and
vm but the conditional added a measurable slow down.
http://codereview.appspot.com/5543059/diff/2003/src/gpu/GrDrawState.h
File src/gpu/GrDrawState.h (right):
http://codereview.appspot.com/5543059/diff/2003/src/gpu/GrDrawState.h#newcode56
src/gpu/GrDrawState.h:56: void reset() {
On 2012/01/17 15:17:45, TomH wrote:
> Could we not inline this?
Isn't it inline? (this is a header file)
Issue 5543059: Add GrDrawState::reset() function
(Closed)
Created 12 years, 11 months ago by bsalomon
Modified 12 years, 11 months ago
Reviewers: TomH
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 6