buildSrc/src/main/resources/com/sun/scenario/effect/compiler/backend/sw/java/JSWGlue.stg

Print this page


   1 group JSWGlue;
   2 
   3 glue(effectName,peerName,interfaceDecl,
   4      usercode,samplers,cleanup,srcRects,constants,
   5      pixInitY,pixInitX,posDecls,posInitY,posIncrY,posInitX,posIncrX,
   6      body) ::= <<
   7 /*
   8  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
   9  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  10  *
  11  * This code is free software; you can redistribute it and/or modify it
  12  * under the terms of the GNU General Public License version 2 only, as
  13  * published by the Free Software Foundation.  Oracle designates this
  14  * particular file as subject to the "Classpath" exception as provided
  15  * by Oracle in the LICENSE file that accompanied this code.
  16  *
  17  * This code is distributed in the hope that it will be useful, but WITHOUT
  18  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  19  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  20  * version 2 for more details (a copy is included in the LICENSE file that
  21  * accompanied this code).
  22  *
  23  * You should have received a copy of the GNU General Public License version


  32 /*
  33  * This file was generated by JSLC -- DO NOT EDIT MANUALLY!
  34  */
  35 
  36 package com.sun.scenario.effect.impl.sw.java;
  37 
  38 import java.nio.FloatBuffer;
  39 import java.nio.IntBuffer;
  40 import com.sun.scenario.effect.Effect;
  41 import com.sun.scenario.effect.FilterContext;
  42 import com.sun.scenario.effect.FloatMap;
  43 import com.sun.scenario.effect.ImageData;
  44 import com.sun.scenario.effect.$effectName$;
  45 import com.sun.scenario.effect.impl.BufferUtil;
  46 import com.sun.scenario.effect.impl.HeapImage;
  47 import com.sun.scenario.effect.impl.Renderer;
  48 import com.sun.scenario.effect.impl.state.*;
  49 import com.sun.javafx.geom.Rectangle;
  50 import com.sun.javafx.geom.transform.BaseTransform;
  51 
  52 public class JSW$peerName$Peer extends JSWEffectPeer $interfaceDecl$ {
  53 
  54     public JSW$peerName$Peer(FilterContext fctx, Renderer r, String uniqueName) {
  55         super(fctx, r, uniqueName);
  56     }
  57 
  58     @Override
  59     protected final $effectName$ getEffect() {
  60         return ($effectName$)super.getEffect();
  61     }
  62 
  63     $usercode$
  64 
  65     @Override
  66     public ImageData filter(Effect effect,

  67                             BaseTransform transform,
  68                             Rectangle outputClip,
  69                             ImageData... inputs)
  70     {
  71         setEffect(effect);
  72         Rectangle dstBounds = getResultBounds(transform, outputClip, inputs);
  73         setDestBounds(dstBounds);
  74 
  75         // TODO: for now, all input images must be TYPE_INT_ARGB_PRE
  76         $samplers$
  77 
  78         $srcRects$
  79 
  80         final int dstx = 0;
  81         final int dsty = 0;
  82         final int dstw = dstBounds.width;
  83         final int dsth = dstBounds.height;
  84 
  85         HeapImage dst = (HeapImage)getRenderer().getCompatibleImage(dstw, dsth);
  86         setDestNativeBounds(dst.getPhysicalWidth(), dst.getPhysicalHeight());


   1 group JSWGlue;
   2 
   3 glue(effectName,peerName,genericsDecl,interfaceDecl,
   4      usercode,samplers,cleanup,srcRects,constants,
   5      pixInitY,pixInitX,posDecls,posInitY,posIncrY,posInitX,posIncrX,
   6      body) ::= <<
   7 /*
   8  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
   9  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  10  *
  11  * This code is free software; you can redistribute it and/or modify it
  12  * under the terms of the GNU General Public License version 2 only, as
  13  * published by the Free Software Foundation.  Oracle designates this
  14  * particular file as subject to the "Classpath" exception as provided
  15  * by Oracle in the LICENSE file that accompanied this code.
  16  *
  17  * This code is distributed in the hope that it will be useful, but WITHOUT
  18  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  19  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  20  * version 2 for more details (a copy is included in the LICENSE file that
  21  * accompanied this code).
  22  *
  23  * You should have received a copy of the GNU General Public License version


  32 /*
  33  * This file was generated by JSLC -- DO NOT EDIT MANUALLY!
  34  */
  35 
  36 package com.sun.scenario.effect.impl.sw.java;
  37 
  38 import java.nio.FloatBuffer;
  39 import java.nio.IntBuffer;
  40 import com.sun.scenario.effect.Effect;
  41 import com.sun.scenario.effect.FilterContext;
  42 import com.sun.scenario.effect.FloatMap;
  43 import com.sun.scenario.effect.ImageData;
  44 import com.sun.scenario.effect.$effectName$;
  45 import com.sun.scenario.effect.impl.BufferUtil;
  46 import com.sun.scenario.effect.impl.HeapImage;
  47 import com.sun.scenario.effect.impl.Renderer;
  48 import com.sun.scenario.effect.impl.state.*;
  49 import com.sun.javafx.geom.Rectangle;
  50 import com.sun.javafx.geom.transform.BaseTransform;
  51 
  52 public class JSW$peerName$Peer extends JSWEffectPeer$genericsDecl$ $interfaceDecl$ {
  53 
  54     public JSW$peerName$Peer(FilterContext fctx, Renderer r, String uniqueName) {
  55         super(fctx, r, uniqueName);
  56     }
  57 
  58     @Override
  59     protected final $effectName$ getEffect() {
  60         return ($effectName$)super.getEffect();
  61     }
  62 
  63     $usercode$
  64 
  65     @Override
  66     public ImageData filter(Effect effect,
  67                             RenderState rstate,
  68                             BaseTransform transform,
  69                             Rectangle outputClip,
  70                             ImageData... inputs)
  71     {
  72         setEffect(effect);
  73         Rectangle dstBounds = getResultBounds(transform, outputClip, inputs);
  74         setDestBounds(dstBounds);
  75 
  76         // TODO: for now, all input images must be TYPE_INT_ARGB_PRE
  77         $samplers$
  78 
  79         $srcRects$
  80 
  81         final int dstx = 0;
  82         final int dsty = 0;
  83         final int dstw = dstBounds.width;
  84         final int dsth = dstBounds.height;
  85 
  86         HeapImage dst = (HeapImage)getRenderer().getCompatibleImage(dstw, dsth);
  87         setDestNativeBounds(dst.getPhysicalWidth(), dst.getPhysicalHeight());