DescriptionIn image filters, apply the CTM and offset to the crop rect. This is necessary to compensate for both clipping applied by the compositor (communicated via the CTM) and for cropping applied in upstream image filters (communicated via the offset). This requires a few ugly conversions, since the crop rect is an SkIRect, and the ctm is an SkMatrix.
I also had to offset the matrix passed to filter evaluation by drawSprite() and internalDrawBitmap() by the primitive position. This is the same offset that is applied when drawing the primitive, to compensate for the internal saveLayer().
Also apply the total matrix to the filter params in asNewEffect(), so that (for example) lighting params are offset by both the compositor clipping and upstream crop rects.
R=reed@google.com
Committed: https://code.google.com/p/skia/source/detail?r=10961
Patch Set 1 #Patch Set 2 : Reset the translation component of the matrix passed to image filters. #Patch Set 3 : New version using "global" positioning for crop rects and light positions #Patch Set 4 : New approach: simply offset the CTM by the primitive origin. Revert changes to internalDrawBitmap(). #Patch Set 5 : Use SkIntToScalar() where necessary. Remove unused operator+. #Patch Set 6 : Cleanup #Patch Set 7 : Fix typo in SkSpotlight::transform() (caught by GM/lighting). #Patch Set 8 : Back out changes to adjust matrix by parent's crop rect. #Patch Set 9 : Modify comment to reflect new API. #Patch Set 10 : Use SkLight::transform() for transforming lights in GPU backend as well. #
Total comments: 3
Patch Set 11 : Fix documentation comment. #
Messages
Total messages: 6 (0 generated)
|