Extract render target logic out of renderer to be target agnostic

This commit is contained in:
MoyuScript
2017-08-06 20:21:35 +08:00
parent 2d23b7ef07
commit fd9cb379da
6 changed files with 652 additions and 523 deletions

View File

@@ -27,7 +27,10 @@ export type Gradient = {
colorStops: Array<ColorStop>
};
export const parseGradient = ({args, method, prefix}: BackgroundSource, bounds: Bounds) => {
export const parseGradient = (
{args, method, prefix}: BackgroundSource,
bounds: Bounds
): ?Gradient => {
if (method === 'linear-gradient') {
return parseLinearGradient(args, bounds);
}