Hello, strk

> Suppose in a displayList we have 2 layer masks:

>  mask1: at depth 1 masks up to layer 3
>  mask2: at depth 2 (masked by mask1) masks up to layer 5
>  maskee: at depth 4

> Is maskee masked by both mask1 and mask2 or only by mask2 ?

yes, the maskee should be masked by both mask1 and mask2.  I am pretty
sure about this, otherwise the stack based algorithm won't work.

I'v tested the above case, see attached Ming source(only for visual check).

--zou
/*
 *   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */ 

/*
 * Zou Lunkai, [EMAIL PROTECTED]
 *
 *  Test for nested masks
 */

#include <stdlib.h>
#include <stdio.h>
#include <ming.h>

#include "ming_utils.h"

#define OUTPUT_VERSION 6
#define OUTPUT_FILENAME "masks_test3.swf"

SWFMovieClip defineMovieclip(int x, int y, int w, int h);

SWFMovieClip defineMovieclip(int x, int y, int w, int h)
{
    SWFMovieClip mc;
    SWFShape  sh;
    mc = newSWFMovieClip();
    sh = make_fill_square (x, y, w, h, 255, 0, 0, 255, 0, 0);
    SWFMovieClip_add(mc, (SWFBlock)sh);  
    SWFMovieClip_nextFrame(mc);
    return mc;
}

int
main(int argc, char** argv)
{
  SWFMovie mo;
  SWFMovieClip  mc1, mc2, mc3, mc4, mc5, mc6, mc7, dejagnuclip;
  
  SWFDisplayItem it;
    
  Ming_init();
  mo = newSWFMovieWithVersion(OUTPUT_VERSION);
  SWFMovie_setDimension(mo, 800, 600);
  SWFMovie_setRate (mo, 1.0);
  
  mc1 = defineMovieclip(0, 0, 30, 30);
  mc2 = defineMovieclip(0, 0, 60, 60);
  mc3 = defineMovieclip(0, 0, 90, 90);

  it = SWFMovie_add(mo, (SWFBlock)mc1);  
  SWFDisplayItem_setDepth(it, 1); 
  SWFDisplayItem_setMaskLevel(it, 3);
  
  it = SWFMovie_add(mo, (SWFBlock)mc2);  
  SWFDisplayItem_setDepth(it, 2); 
  SWFDisplayItem_setMaskLevel(it, 5);
  
  it = SWFMovie_add(mo, (SWFBlock)mc3);  
  SWFDisplayItem_setDepth(it, 4); 
                   
  SWFMovie_nextFrame(mo); 

  //Output movie
  puts("Saving " OUTPUT_FILENAME );
  SWFMovie_save(mo, OUTPUT_FILENAME);

  return 0;
}



_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to