simple.rs revision dcecc0c8d22e894525e25a122ce25129b51338f2
1dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo#pragma version(1) 2dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo#pragma rs java_package_name(com.android.rs.jninodebugwaitattach) 3dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo 4dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leofloat4 gColor = {0.299f, 0.587f, 0.114f, 1.f}; 5dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo 6dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo/* RenderScript kernel that just sets the colour of the screen and does some 7dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo * simple operations so it is not completely empty 8dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo * (and can therefore be debugged). 9dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo */ 10dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leouchar4 __attribute__((kernel)) simple_kernel(uchar4 in) 11dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo{ 12dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo float4 temp = rsUnpackColor8888(in); 13dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo temp = gColor; 14dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo uchar4 result = rsPackColorTo8888(temp); 15dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo return result; 16dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo}