DescriptionRemove 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 : '' #
MessagesTotal messages: 6
|