DescriptionWork (in progress) to make SkShader immutable.
Rename SkShader to SkShaderGenerator (not positive we should stick
with the new name, but it's a better way to think about the way it
works now). The object will eventually be immutable, and it will
create the object that does the work at draw time: a ShaderImpl.
Replace setContext with a series of calls:
validContext() - returns false if the old setContext call would have.
shaderImplSize() - returns the size needed by the SkShader subclass.
createShaderImpl() - return a new ShaderImpl object, which holds many
of the functions that were previously on SkShader. This should always
succeed if validContext() returned true (I think... need to look
at all shaders just in case). It has a const reference to the
SkShaderGenerator, so data need not be duplicated between the two.
createShaderImpl will place the new object in storage provided by
an SkSmallAllocator, in general.
BUG=skia:1976
Patch Set 1 #
Total comments: 5
Messages
Total messages: 7 (0 generated)
|