gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [Fwd: Mail delivery failed: returning message to sender]


From: Benjamin Wolsey
Subject: [Gnash-commit] [Fwd: Mail delivery failed: returning message to sender]
Date: Wed, 15 Dec 2010 13:11:27 +0100

-------- Weitergeleitete Nachricht --------
> Von: Mail Delivery System <address@hidden>
> An: address@hidden
> Betreff: Mail delivery failed: returning message to sender
> Datum: Wed, 15 Dec 2010 07:04:23 -0500
> 
> This message was created automatically by mail delivery software.
> 
> A message that you sent could not be delivered to one or more of its
> recipients. This is a permanent error. The following address(es) failed:
> 
>   address@hidden
>     local delivery failed
> 
> ------ This is a copy of the message, including all the headers. ------
> 
> Return-path: <address@hidden>
> Received: from colonialone.fsf.org ([140.186.70.51]:43436 
> helo=internal.in.savannah.gnu.org)
>       by eggs.gnu.org with esmtp (Exim 4.71)
>       (envelope-from <address@hidden>)
>       id 1PSq0w-00087y-Se
>       for address@hidden; Wed, 15 Dec 2010 06:59:22 -0500
> Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
>       by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
>       (envelope-from <address@hidden>)
>       id 1PSq1S-00066h-3q
>       for address@hidden; Wed, 15 Dec 2010 11:59:54 +0000
> Received: from bwy by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
>       (envelope-from <address@hidden>)
>       id 1PSq1P-0006zR-Qu
>       for address@hidden; Wed, 15 Dec 2010 11:59:54 +0000
> To: address@hidden
> Subject: [SCM] Gnash branch, master, updated. 
> 7b9f12c490e496fe66fabd48c4f1dd555c954301
> X-Git-Refname: refs/heads/master
> X-Git-Reftype: branch
> X-Git-Oldrev: a8234360e4a96120a2286f6634379864ef94f9ac
> X-Git-Newrev: 7b9f12c490e496fe66fabd48c4f1dd555c954301
> Message-Id: <address@hidden>
> From: Benjamin Wolsey <address@hidden>
> Date: Wed, 15 Dec 2010 11:59:52 +0000
> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
> 
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "Gnash".
> 
> The branch, master has been updated
>        via  7b9f12c490e496fe66fabd48c4f1dd555c954301 (commit)
>        via  2d8ba30f65c59cc6d6321d15057419f6e67dff2d (commit)
>        via  46c8bf6bbce250ab389b8395cd466d22fd4562cb (commit)
>        via  6790792886e3fbf9fa0e846bf17583fd75f920be (commit)
>        via  9f18073be3f95e4a60324ea402f5ff7f087dd39f (commit)
>       from  a8234360e4a96120a2286f6634379864ef94f9ac (commit)
> 
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
> 
> - Log -----------------------------------------------------------------
> http://git.savannah.gnu.org/cgit//commit/?id=7b9f12c490e496fe66fabd48c4f1dd555c954301
> 
> 
> commit 7b9f12c490e496fe66fabd48c4f1dd555c954301
> Author: Benjamin Wolsey <address@hidden>
> Date:   Wed Dec 15 12:20:41 2010 +0100
> 
>     Run gradient tests.
> 
> diff --git a/testsuite/misc-ming.all/Makefile.am 
> b/testsuite/misc-ming.all/Makefile.am
> index 7e4bf5b..39eac37 100644
> --- a/testsuite/misc-ming.all/Makefile.am
> +++ b/testsuite/misc-ming.all/Makefile.am
> @@ -222,6 +222,7 @@ check_PROGRAMS += \
>  endif
>  
>  check_SCRIPTS = \
> +     GradientFillTestRunner \
>       BitmapDataDrawRunner \
>       DeviceFontTestRunner \
>       EmbeddedFontTestRunner \
> @@ -1441,6 +1442,10 @@ XMLSocketTester: $(srcdir)/XMLSocketTester.sh 
> XMLSocketTest.swf
>  GradientFillTest.swf: $(srcdir)/GradientFillTest.as 
>       $(MAKESWF) -v 8 -r 1 -o $@  $(srcdir)/empty.as 
> $(srcdir)/GradientFillTest.as
>  
> +GradientFillTestRunner: $(srcdir)/../generic-testrunner.sh 
> GradientFillTest.swf
> +     sh $< $(top_builddir) GradientFillTest.swf > $@
> +     chmod 755 $@
> +
>  DrawingApiTest.swf: $(srcdir)/DrawingApiTest.as 
>       $(MAKESWF) -r 1 -o $@  $(srcdir)/empty.as $(srcdir)/DrawingApiTest.as
>  
> @@ -1660,6 +1665,7 @@ clean-local:
>  
>  TEST_DRIVERS = ../simple.exp
>  TEST_CASES = \
> +     GradientFillTestRunner \
>       BeginBitmapFillRunner \
>       BitmapDataTestRunner \
>       BitmapDataDrawRunner \
> 
> http://git.savannah.gnu.org/cgit//commit/?id=2d8ba30f65c59cc6d6321d15057419f6e67dff2d
> 
> 
> commit 2d8ba30f65c59cc6d6321d15057419f6e67dff2d
> Author: Benjamin Wolsey <address@hidden>
> Date:   Wed Dec 15 12:10:40 2010 +0100
> 
>     Add automatic testing for gradient fills.
> 
> diff --git a/testsuite/misc-ming.all/GradientFillTest.as 
> b/testsuite/misc-ming.all/GradientFillTest.as
> index db480bd..366c596 100644
> --- a/testsuite/misc-ming.all/GradientFillTest.as
> +++ b/testsuite/misc-ming.all/GradientFillTest.as
> @@ -299,19 +299,134 @@ with(grad) {
>      // Shape 22
>      x += 100;
>      
> -    // Test a focal gradient with SWF8 args
>      fillType = "radial";
>      colors = [0xffff00, 0x0000ff, 0x00ffff];
>      alphas = [100, 100, 100];
>      ratios = [0, 0xa0, 0xff];
>      matrix.createGradientBox(90, 90, 0, x, y);
>      beginGradientFill(fillType, colors, alphas, ratios, matrix, "pad",
> -            "RGB", 3.5);
> +            "rgb", 3.5);
> +    draw100x100Box(x, y, grad);
> +
> +    // Shape 23
> +    x += 100;
> +    
> +    fillType = "linear";
> +    colors = [0xff0000, 0x00ff00];
> +    alphas = [100, 100];
> +    ratios = [0, 0xff];
> +    matrix.createGradientBox(90, 90, 0, x, y);
> +    beginGradientFill(fillType, colors, alphas, ratios, matrix, "pad",
> +            "linearRGB", 3.5);
>      draw100x100Box(x, y, grad);
>  
>  };
>  grad.onRollOver = function() {};
>  
> +testbmp = new flash.display.BitmapData(1000, 1000, false);
> +testbmp.draw(grad);
> +
> +searchArray = function(ar, el) {
> +    for (var i in ar) {
> +        if (ar[i] == el) return true;
> +    };
> +    return false;
> +};
> +
> +nearColor = function(a, b, exfail) {
> +   tolerance = 32;
> +   ra = (a & 0xff0000) >> 16;
> +   ba = (a & 0xff00) >> 8;
> +   ga = (a & 0xff);
> +   rb = (b & 0xff0000) >> 16;
> +   bb = (b & 0xff00) >> 8;
> +   gb = (b & 0xff);
> +   dist = Math.sqrt(Math.pow(ra - rb, 2) + Math.pow(ba - bb, 2) + 
> Math.pow(ga - gb, 2));
> +   if (dist > tolerance) {
> +       str = "Expected: 0x" + b.toString(16) + ", got: 0x" + a.toString(16);
> +       str += " (Allowed tolerance: " + tolerance + ", distance: " + dist + 
> ")";
> +       if (exfail) xfail_check(str);
> +       else fail_check(str);
> +       return;
> +   }
> +   str = "0x" + b.toString(16) + " is near to 0x" + a.toString(16);
> +   if (exfail) xpass_check(str);
> +   else pass_check(str);
> +};
> +
> +// Array is:
> +// 0: top left
> +// 1: top centre
> +// 2: top right
> +// 3: centre left
> +// 4: centre centre
> +// 5: centre right
> +// 6: bottom left
> +// 7: bottom centre
> +// 8: bottom right
> +
> +// Passes is an optional array of the index of the tests that
> +// fail.
> +checkSquare = function(x, y, ar, bmp, fails) {
> +    trace("Checking square at " + x + "x" + y);
> +    size = 90;
> +    low = 4;
> +    high = size - low;
> +    mid = size / 2;
> +#if 0
> +    t = [
> +        "0x" + testbmp.getPixel(x + low, y + low).toString(16),
> +        "0x" + testbmp.getPixel(x + low, y + mid).toString(16),
> +        "0x" + testbmp.getPixel(x + low, y + high).toString(16),
> +        "0x" + testbmp.getPixel(x + mid, y + low).toString(16),
> +        "0x" + testbmp.getPixel(x + mid, y + mid).toString(16),
> +        "0x" + testbmp.getPixel(x + mid, y + high).toString(16),
> +        "0x" + testbmp.getPixel(x + high, y + low).toString(16),
> +        "0x" + testbmp.getPixel(x + high, y + mid).toString(16),
> +        "0x" + testbmp.getPixel(x + high, y + high).toString(16)
> +    ];
> +    trace(t);
> +#endif 
> +    nearColor(testbmp.getPixel(x + low, y + low), ar[0], searchArray(fails, 
> 0));
> +    nearColor(testbmp.getPixel(x + low, y + mid), ar[1], searchArray(fails, 
> 1));
> +    nearColor(testbmp.getPixel(x + low, y + high), ar[2], searchArray(fails, 
> 2));
> +    nearColor(testbmp.getPixel(x + mid, y + low), ar[3], searchArray(fails, 
> 3));
> +    nearColor(testbmp.getPixel(x + mid, y + mid), ar[4], searchArray(fails, 
> 4));
> +    nearColor(testbmp.getPixel(x + mid, y + high), ar[5], searchArray(fails, 
> 5));
> +    nearColor(testbmp.getPixel(x + high, y + low), ar[6], searchArray(fails, 
> 6));
> +    nearColor(testbmp.getPixel(x + high, y + mid), ar[7], searchArray(fails, 
> 7));
> +    nearColor(testbmp.getPixel(x + high, y + high), ar[8], 
> searchArray(fails, 8));
> +};
> +
> +checkSquare(0, 0, 
> [0x8080ff,0x8080ff,0x8080ff,0x8787ff,0x8787ff,0x8787ff,0x8d8dff,0x8d8dff,0x8d8dff],
>  bmp);
> +checkSquare(100, 0, 
> [0xb0bff,0xb0bff,0xb0bff,0x7f7fff,0x7f7fff,0x7f7fff,0xf4f4ff,0xf4f4ff,0xf4f4ff],
>  bmp);
> +checkSquare(200, 0, 
> [0xff,0x5a5aff,0xfffdff,0x5a5aff,0xffffff,0xff59ff,0xffffff,0xff59ff,0xff00ff],
>  bmp);
> +checkSquare(300, 0, 
> [0xff,0xff,0x4a4aff,0xff,0x4a4aff,0x9c9cff,0x4a4aff,0x9c9cff,0xeeeeff], bmp);
> +checkSquare(400, 0, 
> [0xffffff,0xabffab,0x59ff59,0xacacff,0xffffff,0xabffab,0x5a5aff,0xacacff,0xffffff],
>  bmp);
> +checkSquare(500, 0, 
> [0x3737ff,0xa29ea2,0xd1ff57,0x3737ff,0xa29ea2,0xd1ff57,0x3737ff,0xa29ea2,0xd1ff57],
>  bmp);
> +
> +checkSquare(0, 100, 
> [0x2020ff,0x2d2dff,0x3a3aff,0x2323ff,0x2f2fff,0x3b3bff,0x2a2aff,0x3434ff,0x4040ff],
>  bmp);
> +checkSquare(100, 100, 
> [0xffffff,0xe9e9ff,0xffffff,0xe9e9ff,0xff,0xe9e9ff,0xffffff,0xe9e9ff,0xffffff],
>  bmp);
> +checkSquare(200, 100, 
> [0xff00ff,0xff2bff,0xff00ff,0xff2bff,0xff,0xff2bff,0xff00ff,0xff2bff,0xff00ff],
>  bmp);
> +checkSquare(300, 100, 
> [0xff00ff,0xff00ff,0xff15ff,0xff00ff,0xff93ff,0xfffdff,0xff15ff,0xfffdff,0x2020ff],
>  bmp);
> +checkSquare(400, 100, 
> [0x2020ff,0xfdfffd,0x15ff15,0xfdfffd,0x93ff93,0xff00,0x15ff15,0xff00,0xff00], 
> bmp);
> +checkSquare(500, 100, 
> [0xffff00,0xb4ff9d,0xffff00,0xb4ff9d,0xff,0xb4ff9d,0xffff00,0xb4ff9d,0xffff00],
>  bmp);
> +
> +checkSquare(0, 200, 
> [0xafafff,0xafafff,0xafafff,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00], bmp);
> +checkSquare(100, 200, 
> [0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000,0xff0000],
>  bmp);
> +checkSquare(200, 200, 
> [0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00], bmp);
> +checkSquare(300, 200, 
> [0xffff,0xc3ff,0xffff,0xc3ff,0xffff00,0xc3ff,0xffff,0xc3ff,0xffff], bmp);
> +checkSquare(400, 200, 
> [0x55ff,0xa9ff,0x43ff,0xb6ff,0xeded11,0xd1ff,0x30ff,0xdeff,0x1dff], bmp);
> +checkSquare(500, 200, 
> [0x9d9d61,0xa3ff,0x91916d,0xb6ff,0xeaea14,0xd1ff,0x82827c,0xe4ff,0x757589], 
> bmp, [7]);
> +
> +checkSquare(0, 300, 
> [0xffff,0xc3ff,0xffff,0xc3ff,0xffff00,0xc3ff,0xffff,0xc3ff,0xffff], bmp);
> +checkSquare(100, 300, 
> [0xffff,0xc3ff,0xffff,0xc3ff,0xffff00,0xc3ff,0xffff,0xc3ff,0xffff], bmp);
> +checkSquare(200, 300, 
> [0xfefe,0xe2fe,0xfefe,0xe2fe,0xfefe00,0xe2fe,0xfefe,0xe2fe,0xfefe], bmp, [4]);
> +checkSquare(300, 300, 
> [0xffff,0xc3ff,0xffff,0xc3ff,0xffff00,0xc3ff,0xffff,0xc3ff,0xffff], bmp);
> +checkSquare(400, 300, 
> [0xffff,0xe1ff,0xffff,0xc6ff,0x3636c8,0xc6ff,0xffff,0xf2f20c,0xffff], bmp);
> +checkSquare(500, 300, 
> [0xfa3a00,0xfa3a00,0xfa3a00,0xbbbb00,0xbbbb00,0xbbbb00,0x3afa00,0x3afa00,0x3afa00],
>  bmp);
> +totals();
> +
>  stop();
>  
> 
> 
> http://git.savannah.gnu.org/cgit//commit/?id=46c8bf6bbce250ab389b8395cd466d22fd4562cb
> 
> 
> commit 46c8bf6bbce250ab389b8395cd466d22fd4562cb
> Author: Benjamin Wolsey <address@hidden>
> Date:   Wed Dec 15 10:11:34 2010 +0100
> 
>     Minor cleanups.
> 
> diff --git a/librender/agg/LinearRGB.h b/librender/agg/LinearRGB.h
> index 84d574e..71f501d 100644
> --- a/librender/agg/LinearRGB.h
> +++ b/librender/agg/LinearRGB.h
> @@ -25,7 +25,7 @@ namespace gnash {
>  
>  /// Convert linear RGB colorspace to sRGB
>  double
> -linearToRGB(double s)
> +linearToSRGB(double s)
>  {
>      const double a = 0.055;
>      if (s <= 0.0031308) return 12.92 * s;
> @@ -37,13 +37,18 @@ T
>  cdiff(T a, T b, double ratio)
>  {
>      const int diff = b - a;
> -    const double d = linearToRGB((diff < 0) ? 1 - ratio : ratio);
> +    const double d = linearToSRGB((diff < 0) ? 1 - ratio : ratio);
>      if (diff < 0) {
>          return b - d * diff;
>      }
>      return a + d * diff;
>  }
>  
> +/// Interpolate in the linear RGB colorspace
> +//
> +/// This is an inefficient interpolation method because the
> +/// ratio is transformed on the fly to convert between linear RGB
> +/// and sRGB colorspaces.
>  template<class ColorT>
>  struct linear_rgb_interpolator
>  {
> @@ -51,7 +56,8 @@ public:
>      typedef ColorT color_type;
>  
>      linear_rgb_interpolator(const color_type& c1, const color_type& c2, 
> -        size_t len) :
> +        size_t len)
> +        :
>          _c1(c1),
>          _c2(c2),
>          _len(len),
> @@ -63,7 +69,7 @@ public:
>      }
>  
>      color_type color() const {
> -        const double ratio = double(_count) / _len;
> +        const double ratio = static_cast<double>(_count) / _len;
>          return color_type(
>                  cdiff(_c1.r, _c2.r, ratio),
>                  cdiff(_c1.g, _c2.g, ratio),
> 
> http://git.savannah.gnu.org/cgit//commit/?id=6790792886e3fbf9fa0e846bf17583fd75f920be
> 
> 
> commit 6790792886e3fbf9fa0e846bf17583fd75f920be
> Author: Benjamin Wolsey <address@hidden>
> Date:   Wed Dec 15 10:03:44 2010 +0100
> 
>     Implement linearRGB for agg renderer.
> 
> diff --git a/librender/agg/LinearRGB.h b/librender/agg/LinearRGB.h
> new file mode 100644
> index 0000000..84d574e
> --- /dev/null
> +++ b/librender/agg/LinearRGB.h
> @@ -0,0 +1,82 @@
> +// 
> +//   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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 3 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
> +
> +#ifndef GNASH_AGG_LINEAR_INTERPOLATOR_H
> +#define GNASH_AGG_LINEAR_INTERPOLATOR_H
> +
> +#include <cmath>
> +
> +namespace gnash {
> +
> +/// Convert linear RGB colorspace to sRGB
> +double
> +linearToRGB(double s)
> +{
> +    const double a = 0.055;
> +    if (s <= 0.0031308) return 12.92 * s;
> +    return (1 + a) * std::pow(s, 1 / 2.4) - a;
> +}
> +
> +template<typename T>
> +T
> +cdiff(T a, T b, double ratio)
> +{
> +    const int diff = b - a;
> +    const double d = linearToRGB((diff < 0) ? 1 - ratio : ratio);
> +    if (diff < 0) {
> +        return b - d * diff;
> +    }
> +    return a + d * diff;
> +}
> +
> +template<class ColorT>
> +struct linear_rgb_interpolator
> +{
> +public:
> +    typedef ColorT color_type;
> +
> +    linear_rgb_interpolator(const color_type& c1, const color_type& c2, 
> +        size_t len) :
> +        _c1(c1),
> +        _c2(c2),
> +        _len(len),
> +        _count(0)
> +    {}
> +
> +    void operator++() {
> +        ++_count;
> +    }
> +
> +    color_type color() const {
> +        const double ratio = double(_count) / _len;
> +        return color_type(
> +                cdiff(_c1.r, _c2.r, ratio),
> +                cdiff(_c1.g, _c2.g, ratio),
> +                cdiff(_c1.b, _c2.b, ratio));
> +    }
> +
> +private:
> +    color_type _c1;
> +    color_type _c2;
> +    size_t _len;
> +    size_t _count;
> +};
> +
> +}
> +
> +#endif
> diff --git a/librender/agg/Renderer_agg_style.h 
> b/librender/agg/Renderer_agg_style.h
> index 4392852..360436b 100644
> --- a/librender/agg/Renderer_agg_style.h
> +++ b/librender/agg/Renderer_agg_style.h
> @@ -35,7 +35,9 @@
>  #include <agg_span_image_filter_rgba.h>
>  #include <agg_pixfmt_rgb.h>
>  #include <agg_pixfmt_rgba.h>
> +#include <iostream>
>  
> +#include "LinearRGB.h"
>  #include "Renderer_agg_bitmap.h"
>  #include "GnashAlgorithm.h"
>  #include "FillStyle.h"
> @@ -209,6 +211,14 @@ struct Pad
>  };
>  
>  /// The default RGB color interpolator
> +struct InterpolatorLinearRGB
> +{
> +    template<typename Pixel> struct Type {
> +        typedef agg::gradient_lut<linear_rgb_interpolator<Pixel>, 256> type;
> +    };
> +};
> +
> +/// The default RGB color interpolator
>  struct InterpolatorRGB
>  {
>      template<typename Pixel> struct Type {
> @@ -252,8 +262,8 @@ public:
>          for (size_t i = 0; i != size; ++i) { 
>              const GradientRecord& gr = fs.record(i); 
>              const rgba tr = m_cx.transform(gr.color);
> -            if (tr.m_a < 255) m_need_premultiply = true;    
> -            m_gradient_lut.add_color(gr.ratio/255.0,
> +            if (tr.m_a < 0xff) m_need_premultiply = true;    
> +            m_gradient_lut.add_color(gr.ratio / 255.0,
>                      agg::rgba8(tr.m_r, tr.m_g, tr.m_b, tr.m_a));
>          } 
>          m_gradient_lut.build_lut();
> @@ -589,7 +599,8 @@ struct AddStyles : boost::static_visitor<>
>          _cx(c),
>          _sh(sh),
>          _quality(q)
> -    {}
> +    {
> +    }
>  
>      void operator()(const GradientFill& f) const {
>            SWFMatrix m = f.matrix();
> @@ -713,11 +724,13 @@ void
>  storeGradient(StyleHandler& st, const GradientFill& fs, const SWFMatrix& mat,
>          const SWFCxForm& cx)
>  {
> -    // TODO: provide and use a linearRGB interpolator.
>      switch (fs.interpolation) {
> -        default:
> -          storeGradient<Spread, InterpolatorRGB>(st, fs, mat, cx);
> -          break;
> +        case SWF::GRADIENT_INTERPOLATION_NORMAL:
> +            storeGradient<Spread, InterpolatorRGB>(st, fs, mat, cx);
> +            break;
> +        case SWF::GRADIENT_INTERPOLATION_LINEAR:
> +            storeGradient<Spread, InterpolatorLinearRGB>(st, fs, mat, cx);
> +            break;
>      }
>  
>  }
> 
> http://git.savannah.gnu.org/cgit//commit/?id=9f18073be3f95e4a60324ea402f5ff7f087dd39f
> 
> 
> commit 9f18073be3f95e4a60324ea402f5ff7f087dd39f
> Author: Benjamin Wolsey <address@hidden>
> Date:   Wed Dec 15 08:29:31 2010 +0100
> 
>     Add actionscript support for interpolation mode.
> 
> diff --git a/libcore/FillStyle.cpp b/libcore/FillStyle.cpp
> index d160e6b..70b97c0 100644
> --- a/libcore/FillStyle.cpp
> +++ b/libcore/FillStyle.cpp
> @@ -85,7 +85,7 @@ GradientFill::GradientFill(Type t, const SWFMatrix& m,
>          const GradientRecords& recs)
>      :
>      spreadMode(PAD),
> -    interpolation(SWF::GRADIENT_INTERPOLATION_NORMAL),
> +    interpolation(RGB),
>      _focalPoint(0.0),
>      _gradients(recs),
>      _type(t),
> diff --git a/libcore/FillStyle.h b/libcore/FillStyle.h
> index 927a3c7..96083d4 100644
> --- a/libcore/FillStyle.h
> +++ b/libcore/FillStyle.h
> @@ -51,7 +51,6 @@ public:
>      rgba color;
>  };
>  
> -
>  /// A BitmapFill
>  //
>  /// BitmapFills can refer to a parsed bitmap tag or be constructed from
> @@ -151,8 +150,6 @@ private:
>  };
>  
>  /// A GradientFill
> -//
> -/// TODO: clean this up!
>  class DSOEXPORT GradientFill
>  {
>  public:
> @@ -171,6 +168,11 @@ public:
>          REFLECT
>      };
>  
> +    enum InterpolationMode {
> +        RGB,
> +        LINEAR_RGB
> +    };
> +
>      typedef std::vector<GradientRecord> GradientRecords;
>  
>      /// Construct a GradientFill
> @@ -224,7 +226,7 @@ public:
>      }
>  
>      SpreadMode spreadMode;
> -    SWF::InterpolationMode interpolation;
> +    InterpolationMode interpolation;
>  
>  private:
>  
> diff --git a/libcore/asobj/MovieClip_as.cpp b/libcore/asobj/MovieClip_as.cpp
> index 8d586de..7c2f782 100644
> --- a/libcore/asobj/MovieClip_as.cpp
> +++ b/libcore/asobj/MovieClip_as.cpp
> @@ -1863,7 +1863,12 @@ movieclip_beginGradientFill(const fn_call& fn)
>          else assert(fd.spreadMode == GradientFill::PAD);
>      }
>  
> -    /// TODO: set interpolation mode and spread mode.
> +    if (fn.nargs > 6) {
> +        const std::string& inter = fn.arg(6).to_string();
> +        if (inter == "rgb") fd.interpolation = GradientFill::RGB;
> +        else if (inter == "linearRGB") fd.interpolation = 
> GradientFill::LINEAR_RGB;
> +        else assert(fd.interpolation == GradientFill::RGB);
> +    }
>  
>      /// Add a focus if present.
>      if (fn.nargs > 7) {
> diff --git a/libcore/parser/TypesParser.cpp b/libcore/parser/TypesParser.cpp
> index a6d5062..e896f91 100644
> --- a/libcore/parser/TypesParser.cpp
> +++ b/libcore/parser/TypesParser.cpp
> @@ -268,14 +268,16 @@ readFills(SWFStream& in, SWF::TagType t, 
> movie_definition& md, bool readMorph)
>                          );
>                  }
>          
> -                // TODO: handle in GradientFill.
>                  const SWF::InterpolationMode i =
>                      static_cast<SWF::InterpolationMode>((grad_props >> 4) & 
> 3);
>  
>                  switch (i) {
>                      case SWF::GRADIENT_INTERPOLATION_NORMAL:
> +                        gf.interpolation = GradientFill::RGB;
> +                        break;
>                      case SWF::GRADIENT_INTERPOLATION_LINEAR:
> -                        gf.interpolation = i;
> +                        gf.interpolation = GradientFill::LINEAR_RGB;
> +                        break;
>                      default:
>                          IF_VERBOSE_MALFORMED_SWF(
>                              log_swferror("Illegal interpolation mode in "
> 
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  libcore/FillStyle.cpp                       |    2 +-
>  libcore/FillStyle.h                         |   10 ++-
>  libcore/asobj/MovieClip_as.cpp              |    7 ++-
>  libcore/parser/TypesParser.cpp              |    6 +-
>  librender/agg/LinearRGB.h                   |   88 ++++++++++++++++++++
>  librender/agg/Renderer_agg_style.h          |   27 +++++--
>  testsuite/misc-ming.all/GradientFillTest.as |  119 
> ++++++++++++++++++++++++++-
>  testsuite/misc-ming.all/Makefile.am         |    6 ++
>  8 files changed, 248 insertions(+), 17 deletions(-)
>  create mode 100644 librender/agg/LinearRGB.h
> 
> 
> hooks/post-receive
> -- 
> Gnash

-- 
--
Use Gnash, the GNU Flash Player!
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de
C++ and Open-Source Flash blog - http://www.benjaminwolsey.de/bwysblog

xmpp:address@hidden
http://identi.ca/bwy

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]