Make updateLocalMatrix replace the current Matrix.
Fixes a bug introduced in I3c3316377874e89fccc85afb864bc038b0ef3890. CreateLocalMatrixShader combines the existing matrix with the new matrix, which is not what we want. Keep track of the original SkShader at all times, and always create the local matrix shader with the original. Store the SkShader with a local matrix as Shader.native_with_local_matrix. Make Shader.native_instance private. Instead of allowing direct access, add an init() method which sets it, and getNativeInstance(), which returns either native_instance or native_with_local_matrix, as appropriate. Make Shader subclasses call init(), instead of setting native_instance directly. Pass native_with_local_matrix pointer to nativeSetLocalMatrix and nativeDestructor, which unrefs it (if not null). Since nativeSetLocalMatrix no longer replaces the original, do not unref it. Add a comment to Shader.updateLocalMatrix that it does not affect ComposeShaders created with this Shader. (This should have been a part of I3c3316377874e89fccc85afb864bc038b0ef3890.) BUG:16293121 Change-Id: Ieb31c7e1fe99081f6b81493178f4a18d3c5df643
Loading
Please register or sign in to comment