Return-Path: X-Original-To: apmail-flex-dev-archive@www.apache.org Delivered-To: apmail-flex-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10110106F2 for ; Fri, 28 Feb 2014 05:23:25 +0000 (UTC) Received: (qmail 39836 invoked by uid 500); 28 Feb 2014 05:23:24 -0000 Delivered-To: apmail-flex-dev-archive@flex.apache.org Received: (qmail 39643 invoked by uid 500); 28 Feb 2014 05:23:23 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 39635 invoked by uid 99); 28 Feb 2014 05:23:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 05:23:22 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of aharui@adobe.com) Received: from [207.46.163.235] (HELO na01-by2-obe.outbound.protection.outlook.com) (207.46.163.235) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 05:23:15 +0000 Received: from BLUPR02MB502.namprd02.prod.outlook.com (10.141.82.18) by BLUPR02MB100.namprd02.prod.outlook.com (10.242.188.26) with Microsoft SMTP Server (TLS) id 15.0.883.10; Fri, 28 Feb 2014 05:22:52 +0000 Received: from BLUPR02MB502.namprd02.prod.outlook.com ([10.141.82.18]) by BLUPR02MB502.namprd02.prod.outlook.com ([10.141.82.18]) with mapi id 15.00.0883.010; Fri, 28 Feb 2014 05:22:52 +0000 From: Alex Harui To: "dev@flex.apache.org" Subject: Re: [FlexJS] Building SVG skins from existing Spark component skins Thread-Topic: [FlexJS] Building SVG skins from existing Spark component skins Thread-Index: AQHPM5kwndqAadnhzEaJCRo0ObeT6JrI1CaA///9wYCAALIoAP//mGiAgACVroD//+rNAA== Date: Fri, 28 Feb 2014 05:22:52 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.9.131030 x-originating-ip: [63.231.22.12] x-forefront-prvs: 0136C1DDA4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019001)(6009001)(428001)(51704005)(479174003)(189002)(199002)(24454002)(43544003)(52314003)(377454003)(47736001)(49866001)(47976001)(81542001)(83072002)(56816005)(19580405001)(19580395003)(90146001)(83322001)(46102001)(81816001)(85306002)(83506001)(2656002)(59766001)(36756003)(87266001)(81686001)(92566001)(31966008)(74876001)(74706001)(4396001)(87936001)(80976001)(95666003)(77982001)(47446002)(74502001)(51856001)(85852003)(76796001)(81342001)(76482001)(92726001)(66066001)(80022001)(79102001)(69226001)(63696002)(50986001)(65816001)(74662001)(93136001)(76786001)(56776001)(86362001)(54356001)(94946001)(54316002)(53806001)(93516002)(94316002)(95416001)(74366001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB100;H:BLUPR02MB502.namprd02.prod.outlook.com;CLIP:63.231.22.12;FPR:CC07FE24.7E65999.B1C4AE4B.56E9E15D.20502;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (: adobe.com does not designate permitted sender hosts) Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: adobe.com X-Virus-Checked: Checked by ClamAV on apache.org On 2/27/14 2:38 PM, "OmPrakash Muppirala" wrote: >On Thu, Feb 27, 2014 at 1:43 PM, Alex Harui wrote: > >> >> >> On 2/27/14 11:53 AM, "OmPrakash Muppirala" wrote: >> >> > >> >Lets do it! Where do we start? I want to start building some JS side >>SVG >> >drawing APIs that I want to use with our Charts. The BarChart on the >>JS >> >side uses CSS to draw, which will become limited very soon. Having a >> >robust JS based SVG drawing API will definitely help us in the long >>run. >> >Do you mind starting with an SVG parser in Falcon? We could just do >>with >> >the primitives for now: BitmapImage, Ellipse, Line, Path and Rect. >>Then >> >we can do the fills, strokes, gradients, etc. No need to deal with the >> >whole SVG spec. >> >> An SVG Parser or emitter (output to SVG from the tree)? I'll try to >>find >> the relevant code this evening. >> >> I'm not sure what you mean by a drawing library. What pops into my mind >> is a component called Graphics that creates a DOM element and draws >>Flash >> in AS and SVG in JS. You shouldn't need any compiler changes for that. >> >> >The Graphics component is what I had in my mind. I thought you had >mentioned some compiler changes in your last email. If that is not >required, ignore what I said. > >If I understand the flow correctly, we will have an AS skin class that >references an SVG document. The compiler parses the SVG document (like it >does with FXG today) and will generate AS code that uses the Graphics >component to draw stuff in Flash. > >On the JS side, we will have a similar Graphics component with same >drawing >API, except that the code draws SVG onto the HTML DOM. > >I believe you will figure out the SVG parser part. I can take care of >creating the Graphics component on AS and JS versions. > >Am I on the right track? Well, can we start with FXG first? Then I don't have to worry about how to handle SVG on the AS side. IMO, the output doesn't have to be the same for AS and JS. On the AS side the compiler already converts FXG to a Sprite and Shapes and TextField. IMO, that is the most efficient representation of FXG in terms of performance. Someday, I would have the compiler convert SVG to Sprite and Shapes and TextField. I believe the mapping isn't clean for all of SVG, but could be for many graphic primitives. The question is: what is the most efficient representation of FXG/SVG on the JS side? Should it be SVG markup, or data structures that you can use to call the createElementNS/setAttributes in a loop? Or just linear JS code making those calls? We stopped using linear AS code for MXML codegen because it is faster/smaller to generate a data structure and run a loop where the JIT-compilation is re-used. So, if it were up to me, we'd start with a test case where an MXML or AS skin points to an fxg file for each state. The Falcon compiler should already generate the right thing for the AS side. Then, we have to apply a similar hook to the FXG compiler that we did to get JS output for FalconJX and start coding up however we want the JS/SVG output to look like. It could call this Graphics component, but may not need to, it may just generate SVG or JS calls. But for sure, you're welcome to write the Graphics class for both AS and JS and teach BarChart to use it. We'll need that no matter what. Anyway, if this plan is acceptable to you, what I'd prefer to do is this: I would apply the hooks to the FXG compiler and get it to output "something". I'd point you to the change list so you can see what files need to be modified. Then you can try your hand at modifying those Java source files to get whatever output you want. You really don't have to know much about compilation, you are basically taking a tree structure and converting it to some textual representation. Then we don't have to do as much coordination between the two of us. I'm working on getting mustella to run with FlexJS right now (and fixing installer issues) but I'll stop to try to apply those hooks if you are game. -Alex