gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-615-gf65ac5d
Date: Mon, 08 Aug 2011 08:26:05 +0000

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  f65ac5d9dddcb9ca2a9f2c3e61067f69b727fe8c (commit)
       via  266533ba1a14390932548a920263e003945a89c1 (commit)
       via  02ca2ae1e96753d603774c1350af46d95952ca93 (commit)
       via  959ef1c13b45c4aa3705a0036b13a4b7e50c7fd1 (commit)
      from  bcbe20ae3aefde22c7f470b0284cba20be373589 (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=f65ac5d9dddcb9ca2a9f2c3e61067f69b727fe8c


commit f65ac5d9dddcb9ca2a9f2c3e61067f69b727fe8c
Author: Benjamin Wolsey <address@hidden>
Date:   Mon Aug 8 10:08:08 2011 +0200

    Output formatting.

diff --git a/libcore/FillStyle.cpp b/libcore/FillStyle.cpp
index 52a3097..1a6d8d1 100644
--- a/libcore/FillStyle.cpp
+++ b/libcore/FillStyle.cpp
@@ -285,11 +285,11 @@ struct FillStyleOutput : boost::static_visitor<>
 {
     FillStyleOutput(std::ostream& o) : _os(o) {}
     void operator()(const BitmapFill& bf) {
-        _os << boost::format("Bitmap fill: type %1%, smoothing %2%,"
+        _os << boost::format("Bitmap fill: type %1%, smoothing %2%, "
                 "matrix %3%") % bf.type() % bf.smoothingPolicy() % bf.matrix();
     }
     void operator()(const GradientFill& gf) {
-        _os << boost::format("Gradient Fill: type %1%, spread mode %2%, "
+        _os << boost::format("Gradient fill: type %1%, spread mode %2%, "
             "interpolation mode %3%, gradient count %4%, matrix %5%")
             % gf.type() % gf.spreadMode % gf.interpolation %
             gf.recordCount() % gf.matrix();
diff --git a/libcore/swf/ShapeRecord.cpp b/libcore/swf/ShapeRecord.cpp
index 37d1552..bbfcb36 100644
--- a/libcore/swf/ShapeRecord.cpp
+++ b/libcore/swf/ShapeRecord.cpp
@@ -699,7 +699,7 @@ readFillStyles(ShapeRecord::FillStyles& styles, SWFStream& 
in,
         OptionalFillPair fp = readFills(in, tag, m, false);
         styles.push_back(fp.first);
         IF_VERBOSE_PARSE(
-            log_parse(_("  Fill style: %1%"), fp.first);
+            log_parse(_("  Read fill: %1%"), fp.first);
         );
     }
 }

http://git.savannah.gnu.org/cgit//commit/?id=266533ba1a14390932548a920263e003945a89c1


commit 266533ba1a14390932548a920263e003945a89c1
Author: Benjamin Wolsey <address@hidden>
Date:   Mon Aug 8 09:44:26 2011 +0200

    Add output operators for fill styles.
    
    Use them too.

diff --git a/libcore/FillStyle.cpp b/libcore/FillStyle.cpp
index b618ab3..52a3097 100644
--- a/libcore/FillStyle.cpp
+++ b/libcore/FillStyle.cpp
@@ -222,7 +222,6 @@ setLerp(FillStyle& f, const FillStyle& a, const FillStyle& 
b, double t)
     boost::apply_visitor(SetLerp(a.fill, b.fill, t), f.fill);
 }
 
-
 std::ostream&
 operator<<(std::ostream& os, const BitmapFill::SmoothingPolicy& p)
 {
@@ -244,6 +243,72 @@ operator<<(std::ostream& os, const 
BitmapFill::SmoothingPolicy& p)
     return os;
 }
 
+std::ostream&
+operator<<(std::ostream& o, GradientFill::Type t)
+{
+    switch (t) {
+        case GradientFill::LINEAR:
+            return o << "linear";
+        default:
+        case GradientFill::RADIAL:
+            return o << "radial";
+    }
+}
+
+std::ostream&
+operator<<(std::ostream& o, GradientFill::SpreadMode t)
+{
+    switch (t) {
+        case GradientFill::PAD:
+            return o << "pad";
+        case GradientFill::REPEAT:
+            return o << "repeat";
+        default:
+        case GradientFill::REFLECT:
+            return o << "reflect";
+    }
+}
+
+std::ostream&
+operator<<(std::ostream& o, GradientFill::InterpolationMode t)
+{
+    switch (t) {
+        case GradientFill::RGB:
+            return o << "rgb";
+        default:
+        case GradientFill::LINEAR_RGB:
+            return o << "linear rgb";
+    }
+}
+
+struct FillStyleOutput : boost::static_visitor<>
+{
+    FillStyleOutput(std::ostream& o) : _os(o) {}
+    void operator()(const BitmapFill& bf) {
+        _os << boost::format("Bitmap fill: type %1%, smoothing %2%,"
+                "matrix %3%") % bf.type() % bf.smoothingPolicy() % bf.matrix();
+    }
+    void operator()(const GradientFill& gf) {
+        _os << boost::format("Gradient Fill: type %1%, spread mode %2%, "
+            "interpolation mode %3%, gradient count %4%, matrix %5%")
+            % gf.type() % gf.spreadMode % gf.interpolation %
+            gf.recordCount() % gf.matrix();
+    }
+    void operator()(const SolidFill& sf) {
+        _os << boost::format("Solid Fill: color %1%") % sf.color();
+    }
+private:
+    std::ostream& _os;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const FillStyle& fs)
+{
+    FillStyleOutput out(os);
+    boost::apply_visitor(out, fs.fill);
+    return os;
+}
+
 } // namespace gnash
 
 
diff --git a/libcore/FillStyle.h b/libcore/FillStyle.h
index c3ce5af..13d7548 100644
--- a/libcore/FillStyle.h
+++ b/libcore/FillStyle.h
@@ -302,9 +302,22 @@ public:
 /// errors are caught by type-checking and will throw an unhandled exception.
 void setLerp(FillStyle& f, const FillStyle& a, const FillStyle& b, double t);
 
+/// Output operator for bitmap smoothing policy.
 DSOEXPORT std::ostream& operator<<(std::ostream& os,
         const BitmapFill::SmoothingPolicy& p);
 
+/// Output operator for FillStyles.
+std::ostream& operator<<(std::ostream& os, const FillStyle& fs);
+
+/// Output operator for GradientFill type.
+std::ostream& operator<<(std::ostream& o, GradientFill::Type t);
+
+/// Output operator for GradientFill spread mode.
+std::ostream& operator<<(std::ostream& o, GradientFill::SpreadMode t);
+
+/// Output operator for GradientFill interpolation mode.
+std::ostream& operator<<(std::ostream& o, GradientFill::InterpolationMode t);
+
 } // namespace gnash
 
 #endif 
diff --git a/libcore/parser/TypesParser.cpp b/libcore/parser/TypesParser.cpp
index a277a8b..2a28018 100644
--- a/libcore/parser/TypesParser.cpp
+++ b/libcore/parser/TypesParser.cpp
@@ -204,7 +204,7 @@ readFills(SWFStream& in, SWF::TagType t, movie_definition& 
md, bool readMorph)
             
             const boost::uint8_t num_gradients = grad_props & 0xF;
             IF_VERBOSE_PARSE(
-               log_parse("  gradients: num_gradients = %d", +num_gradients);
+               log_parse("  gradients count: %d", +num_gradients);
             );
         
             if (!num_gradients) {
diff --git a/libcore/swf/ShapeRecord.cpp b/libcore/swf/ShapeRecord.cpp
index 745da33..37d1552 100644
--- a/libcore/swf/ShapeRecord.cpp
+++ b/libcore/swf/ShapeRecord.cpp
@@ -681,26 +681,26 @@ readFillStyles(ShapeRecord::FillStyles& styles, 
SWFStream& in,
          SWF::TagType tag, movie_definition& m, const RunResources& /*r*/)
 {
     in.ensureBytes(1);
-    boost::uint16_t FillStyle_count = in.read_u8();
-    if (tag != SWF::DEFINESHAPE)
-    {
-        if (FillStyle_count == 0xFF)
-        {
+    boost::uint16_t fillcount = in.read_u8();
+    if (tag != SWF::DEFINESHAPE) {
+        if (fillcount == 0xff) {
             in.ensureBytes(2);
-            FillStyle_count = in.read_u16();
+            fillcount = in.read_u16();
         }
     }
 
-    IF_VERBOSE_PARSE (
-        log_parse(_("  readFillStyles: count = %u"), FillStyle_count);
+    IF_VERBOSE_PARSE(
+        log_parse(_("  fill styles: %1%"), fillcount);
     );
 
     // Read the styles.
-    styles.reserve(styles.size()+FillStyle_count);
-    for (boost::uint16_t i = 0; i < FillStyle_count; ++i) {
-        // TODO: add a FillStyle constructor directly reading from stream
+    styles.reserve(styles.size() + fillcount);
+    for (boost::uint16_t i = 0; i < fillcount; ++i) {
         OptionalFillPair fp = readFills(in, tag, m, false);
         styles.push_back(fp.first);
+        IF_VERBOSE_PARSE(
+            log_parse(_("  Fill style: %1%"), fp.first);
+        );
     }
 }
 
@@ -770,7 +770,12 @@ computeBounds(SWFRect& bounds, const ShapeRecord::Paths& 
paths,
 std::ostream&
 operator<<(std::ostream& o, const ShapeRecord& sh)
 {
-    o << "Shape Record: bounds " << sh.getBounds();
+    o << boost::format("Shape Record: bounds %1%") % sh.getBounds();
+
+    const ShapeRecord::FillStyles& fills = sh.fillStyles();
+    std::copy(fills.begin(), fills.end(),
+            std::ostream_iterator<FillStyle>(o, ","));
+
     return o;
 }
 

http://git.savannah.gnu.org/cgit//commit/?id=02ca2ae1e96753d603774c1350af46d95952ca93


commit 02ca2ae1e96753d603774c1350af46d95952ca93
Author: Benjamin Wolsey <address@hidden>
Date:   Mon Aug 8 09:22:08 2011 +0200

    Code style.

diff --git a/libcore/Shape.cpp b/libcore/Shape.cpp
index f756066..1719236 100644
--- a/libcore/Shape.cpp
+++ b/libcore/Shape.cpp
@@ -21,8 +21,7 @@
 #include "Shape.h"
 #include "Transform.h"
 
-namespace gnash
-{
+namespace gnash {
 
 bool
 Shape::pointInShape(boost::int32_t x, boost::int32_t y) const
diff --git a/libcore/swf/DefineShapeTag.h b/libcore/swf/DefineShapeTag.h
index f3495f3..2291606 100644
--- a/libcore/swf/DefineShapeTag.h
+++ b/libcore/swf/DefineShapeTag.h
@@ -56,8 +56,6 @@ public:
     bool pointTestLocal(boost::int32_t x, boost::int32_t y, 
             const SWFMatrix& wm) const;
 
-protected:
-
 private:
 
     DefineShapeTag(SWFStream& in, TagType tag, movie_definition& m,

http://git.savannah.gnu.org/cgit//commit/?id=959ef1c13b45c4aa3705a0036b13a4b7e50c7fd1


commit 959ef1c13b45c4aa3705a0036b13a4b7e50c7fd1
Author: Benjamin Wolsey <address@hidden>
Date:   Mon Aug 8 09:21:09 2011 +0200

    Make debugging output conditional.

diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 70bb246..4cc3ca2 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -163,12 +163,14 @@ public:
         assert(!_checked);
         if (ch->get_depth() <= _highestHiddenDepth) {
             if (ch->isMaskLayer()) {
+#ifdef DEBUG_MOUSE_ENTITY_FINDING
                 log_debug(_("CHECKME: nested mask in MouseEntityFinder. "
                             "This mask is %s at depth %d outer mask masked "
                             "up to depth %d."),
                             ch->getTarget(), ch->get_depth(),
                             _highestHiddenDepth);
                 // Hiding mask still in effect...
+#endif
             }
             return;
         }
@@ -397,11 +399,13 @@ public:
         assert(!_checked);
         if (ch->get_depth() <= _highestHiddenDepth) {
             if (ch->isMaskLayer()) {
+#ifdef DEBUG_MOUSE_ENTITY_FINDING
                 log_debug(_("CHECKME: nested mask in DropTargetFinder. "
                         "This mask is %s at depth %d outer mask masked "
                         "up to depth %d."),
                         ch->getTarget(), ch->get_depth(), _highestHiddenDepth);
                 // Hiding mask still in effect...
+#endif
             }
             return;
         }

-----------------------------------------------------------------------

Summary of changes:
 libcore/FillStyle.cpp          |   67 +++++++++++++++++++++++++++++++++++++++-
 libcore/FillStyle.h            |   13 ++++++++
 libcore/MovieClip.cpp          |    4 ++
 libcore/Shape.cpp              |    3 +-
 libcore/parser/TypesParser.cpp |    2 +-
 libcore/swf/DefineShapeTag.h   |    2 -
 libcore/swf/ShapeRecord.cpp    |   29 ++++++++++-------
 7 files changed, 102 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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