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

Issue 5616051: Remove on static initializer in GrGpu.cpp (Closed)

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

Description

Remove on static initializer in GrGpu.cpp This is another go for the patch that was initially submitted at http://codereview.appspot.com/5504073/ but crashed the 'gm' unit test. A problem with the previous implementation is that the GrStencilSettings ::isDisabled() and ::doesWrite() methods can modify the object's fFlags member if it is 0, and this will crash at runtime when doing this for a static constant object/structure. I'm not sure why this wasn't triggered previously. We solve the issue by modifying the implementation of GR_STATIC_CONST_STENCIL and GR_STATIC_CONST_STENCIL macros to compute the correct default values for fFlags (which prevents any member modifications in the above methods). This requires moving the definition of the disabled/write flags out of the GrStencilSettings class definition's private section. Note that the flags are renamed to avoid any confusion and conflicts, i.e.: SkIsDisabled_Flag -> SkIsDisabled_StencilFlag SkNotDisabled_Flag -> SkNotDisabled_StencilFlag ...

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -45 lines) Patch
M src/gpu/GrGpu.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrGpu.cpp View 1 1 chunk +11 lines, -9 lines 0 comments Download
M src/gpu/GrGpuGL.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrStencil.h View 1 6 chunks +92 lines, -34 lines 0 comments Download

Messages

Total messages: 6
digit
ping?
12 years, 10 months ago (2012-02-07 08:54:20 UTC) #1
DerekS
12 years, 10 months ago (2012-02-07 13:52:34 UTC) #2
bsalomon
On 2012/02/07 13:52:34, djsollen wrote: Yikes. LGTM.
12 years, 10 months ago (2012-02-07 14:03:04 UTC) #3
reed1
http://codereview.appspot.com/5616051/diff/1/src/gpu/GrGpu.h File src/gpu/GrGpu.h (left): http://codereview.appspot.com/5616051/diff/1/src/gpu/GrGpu.h#oldcode358 src/gpu/GrGpu.h:358: static const GrStencilSettings& gClipStencilSettings; nit: skia doesn't say "void" ...
12 years, 10 months ago (2012-02-07 14:16:38 UTC) #4
digit
On 2012/02/07 14:16:38, reed1 wrote: > http://codereview.appspot.com/5616051/diff/1/src/gpu/GrGpu.h > File src/gpu/GrGpu.h (left): > > http://codereview.appspot.com/5616051/diff/1/src/gpu/GrGpu.h#oldcode358 > ...
12 years, 10 months ago (2012-02-07 14:27:52 UTC) #5
reed1
12 years, 10 months ago (2012-02-15 21:49:14 UTC) #6
Sorry, I didn't see the lovely nit fixes :)

lgtm
Sign in to reply to this message.

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