Add proj() intrinsic (XY / Z), fix bug with perspective matrix sampling

Previously, we'd declare a new temporary variable using the matrix
expression. For GrSkSLFP in particular, that would happen *before*
any other code had been emitted, so if the expression referred to
local variables, it would produce SkSL that used a not-yet-defined
variable, and not compile.

Change-Id: I1cdd8920b0c659b905809c126d10c01b996e6a55
Reviewed-by: Michael Ludwig <>
Reviewed-by: Brian Salomon <>
Commit-Queue: Brian Osman <>
3 files changed