Rewrite assembly magic in GetAlphaRect. Also reformat it a bit.
Extract stuff from Layer::GetFrame to functions