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_start-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-85-gaab6f25
Date: Fri, 18 Feb 2011 16:11:22 +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  aab6f25286f4718526cc5d7ee2a33b9e0d012145 (commit)
       via  63d54ca57cf23a7e8380cf11303447b8ea84d09e (commit)
       via  63cd7ed72b4c168bcf873b79f992eab03c738e4e (commit)
      from  f34e22064873c87fdca291af1737c49a1392c3b6 (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=aab6f25286f4718526cc5d7ee2a33b9e0d012145


commit aab6f25286f4718526cc5d7ee2a33b9e0d012145
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 18 16:53:35 2011 +0100

    Fonts are ref_counted, so store by intrusive_ptr.

diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index 30a3c87..f358b43 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -1426,7 +1426,7 @@ TextField::handleChar(std::wstring::const_iterator& it,
                         }
                         else if (s == "B") {
                             //bold
-                            Font* boldfont = new Font(rec.getFont()->name(),
+                            boost::intrusive_ptr<Font> boldfont = new 
Font(rec.getFont()->name(),
                                     true, rec.getFont()->isItalic());
                             newrec.setFont(boldfont);
                             handleChar(it, e, x, y, newrec, last_code,
@@ -1460,7 +1460,7 @@ TextField::handleChar(std::wstring::const_iterator& it,
                                     log_aserror("Expected a font name in FACE 
attribute.");
                                 } else {
                                     //font FACE attribute
-                                    Font* newfont = new Font(attloc->second,
+                                    boost::intrusive_ptr<Font> newfont = new 
Font(attloc->second,
                                         rec.getFont()->isBold(), 
rec.getFont()->isItalic());
                                     newrec.setFont(newfont);
                                 }
@@ -1514,7 +1514,7 @@ TextField::handleChar(std::wstring::const_iterator& it,
                         }
                         else if (s == "I") {
                             //italic
-                            Font* italicfont = new Font(rec.getFont()->name(),
+                            boost::intrusive_ptr<Font> italicfont = new 
Font(rec.getFont()->name(),
                                     rec.getFont()->isBold(), true);
                             newrec.setFont(italicfont);
                             handleChar(it, e, x, y, newrec, last_code,
diff --git a/libcore/swf/TextRecord.cpp b/libcore/swf/TextRecord.cpp
index d4cdd18..ca85dee 100644
--- a/libcore/swf/TextRecord.cpp
+++ b/libcore/swf/TextRecord.cpp
@@ -77,7 +77,7 @@ TextRecord::read(SWFStream& in, movie_definition& m, int 
glyphBits,
         {
             IF_VERBOSE_PARSE(
                 log_parse(_("  has_font: font id = %d (%p)"), fontID,
-                    (void*)_font);
+                    _font.get());
             );
         } 
     }
diff --git a/libcore/swf/TextRecord.h b/libcore/swf/TextRecord.h
index 730a21a..89d07ec 100644
--- a/libcore/swf/TextRecord.h
+++ b/libcore/swf/TextRecord.h
@@ -19,10 +19,13 @@
 #ifndef GNASH_SWF_TEXTRECORD_H
 #define GNASH_SWF_TEXTRECORD_H
 
-#include "RGBA.h"
-#include "SWF.h"
 #include <string>
 #include <vector>
+#include <boost/intrusive_ptr.hpp>
+
+#include "RGBA.h"
+#include "SWF.h"
+#include "Font.h"
 
 namespace gnash {
     class movie_definition;
@@ -107,7 +110,7 @@ public:
     }
 
     // TODO: check font properly.
-    void setFont(const Font* f) {
+    void setFont(boost::intrusive_ptr<const Font> f) {
         _font = f;
     }
 
@@ -128,7 +131,7 @@ public:
        }
        
     const Font* getFont() const {
-        return _font;
+        return _font.get();
     }
 
     void setTextHeight(boost::uint16_t height) {
@@ -213,7 +216,7 @@ private:
     float _yOffset;
 
     /// The font associated with the TextRecord. Can be NULL.
-    const Font* _font;
+    boost::intrusive_ptr<const Font> _font;
 
        std::string _htmlURL;
        std::string _htmlTarget;

http://git.savannah.gnu.org/cgit//commit/?id=63d54ca57cf23a7e8380cf11303447b8ea84d09e


commit 63d54ca57cf23a7e8380cf11303447b8ea84d09e
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 18 14:55:06 2011 +0100

    Drop unused functions.

diff --git a/libcore/DisplayList.cpp b/libcore/DisplayList.cpp
index 969d833..7c7ebb9 100644
--- a/libcore/DisplayList.cpp
+++ b/libcore/DisplayList.cpp
@@ -445,32 +445,6 @@ DisplayList::swapDepths(DisplayObject* ch1, int newdepth)
 
     testInvariant();
 }
-
-DisplayObject*
-DisplayList::removeDisplayObjectAt(int index)
-{
-    container_type::iterator it =
-        std::find_if(_charsByDepth.begin(), _charsByDepth.end(),
-            boost::bind(DepthEquals(), _1, index));
-
-    if (it == _charsByDepth.end()) return 0;
-   
-    DisplayObject* obj = *it;
-    _charsByDepth.erase(it);
-    return obj;
-}
-
-void
-DisplayList::removeDisplayObject(DisplayObject* obj)
-{
-    container_type::iterator it = std::find(_charsByDepth.begin(),
-            _charsByDepth.end(), obj);
-    
-    if (it != _charsByDepth.end()) {
-        _charsByDepth.erase(it);
-    }
-}
-
 void
 DisplayList::insertDisplayObject(DisplayObject* obj, int index)
 {
@@ -499,28 +473,6 @@ DisplayList::insertDisplayObject(DisplayObject* obj, int 
index)
     testInvariant();
 }
 
-void
-DisplayList::addDisplayObject(DisplayObject* obj)
-{
-    testInvariant();
-
-    assert(!obj->unloaded());
-
-    obj->set_invalidated();
-    if (_charsByDepth.empty()) {
-        obj->set_depth(0);
-    }
-    else {
-        container_type::const_reverse_iterator it = _charsByDepth.rbegin();
-        obj->set_depth((*it)->get_depth() + 1);
-    }
-
-    // Insert the DisplayObject at the end
-    _charsByDepth.insert(_charsByDepth.end(), obj);
-
-    testInvariant();
-}
-
 
 bool
 DisplayList::unload()
@@ -591,6 +543,8 @@ DisplayList::display(Renderer& renderer, const Transform& 
base)
 {
     testInvariant();
 
+    //log_debug("Displaying list: %s", *this);
+
     std::stack<int> clipDepthStack;
     
     // We only display DisplayObjects which are out of the "removed" zone
diff --git a/libcore/DisplayList.h b/libcore/DisplayList.h
index 307ac25..78f68b4 100644
--- a/libcore/DisplayList.h
+++ b/libcore/DisplayList.h
@@ -195,23 +195,6 @@ public:
        ///     pre-existing DisplayObject at the same depth.
        void add(DisplayObject* ch, bool replace);
 
-    /// Removes the specified DisplayObject
-    //
-    /// Other DisplayObjects are left untouched.
-    /// This implements AS3 DisplayObjectContainer.removeChild().
-    //
-    /// @param obj      The DisplayObject to remove.
-    void removeDisplayObject(DisplayObject* obj);
-
-    /// Removes the DisplayObject at the specified index
-    //
-    /// Other DisplayObjects are left untouched.
-    /// This implements AS3 DisplayObjectContainer.removeChildAt().
-    //
-    /// @param index    The index from which to remove the DisplayObject.
-    /// @return         The DisplayObject removed, or 0 if none was removed.
-    DisplayObject* removeDisplayObjectAt(int index);
-
     /// Inserts a DisplayObject at the specified index (depth)
     //
     /// If a DisplayObject is already at that index, it is moved up.
@@ -224,16 +207,6 @@ public:
     /// @param index    The index at which to insert the DisplayObject.
     void insertDisplayObject(DisplayObject* obj, int index);
 
-    /// Adds a DisplayObject at the top of the DisplayList.
-    //
-    /// This implements AS3 DisplayObjectContainer.addChild().
-    //
-    /// @param obj      The DisplayObject to insert. This should already be
-    ///                 removed from any other DisplayLists. It should not be
-    ///                 the owner of this DisplayList or any parent of that
-    ///                 owner.
-    void addDisplayObject(DisplayObject* obj);
-
        /// Display the list's DisplayObjects.
     //
        /// Lower depths are obscured by higher depths.

http://git.savannah.gnu.org/cgit//commit/?id=63cd7ed72b4c168bcf873b79f992eab03c738e4e


commit 63cd7ed72b4c168bcf873b79f992eab03c738e4e
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Feb 18 14:54:25 2011 +0100

    Remove unused functions.

diff --git a/libcore/DisplayObjectContainer.cpp 
b/libcore/DisplayObjectContainer.cpp
index d851b5d..17157f5 100644
--- a/libcore/DisplayObjectContainer.cpp
+++ b/libcore/DisplayObjectContainer.cpp
@@ -37,51 +37,6 @@ DisplayObjectContainer::~DisplayObjectContainer()
 {
 }
 
-DisplayObject*
-DisplayObjectContainer::removeChild(DisplayObject* obj)
-{
-    _displayList.removeDisplayObject(obj);
-    obj->set_parent(0);
-    return obj;
-}
-
-DisplayObject*
-DisplayObjectContainer::removeChildAt(int index)
-{
-    DisplayObject* obj = _displayList.removeDisplayObjectAt(index);
-    if (obj) obj->set_parent(0);
-
-    return obj;
-}
-
-DisplayObject*
-DisplayObjectContainer::addChild(DisplayObject* obj)
-{
-    // TODO: parent should be a DisplayObjectContainer; remove dynamic_cast.
-    DisplayObjectContainer* parent =
-        dynamic_cast<DisplayObjectContainer*>(obj->parent());
-    if (parent) parent->removeChild(obj);
-
-    _displayList.addDisplayObject(obj);
-    obj->set_parent(this);
-    return obj;
-}
-
-
-DisplayObject*
-DisplayObjectContainer::addChildAt(DisplayObject* obj, int index)
-{
-    // TODO: parent should be a DisplayObjectContainer; remove dynamic_cast.
-    DisplayObjectContainer* parent =
-        dynamic_cast<DisplayObjectContainer*>(obj->parent());
-    if (parent) parent->removeChild(obj);
-    
-    _displayList.insertDisplayObject(obj, index);
-    obj->set_parent(this);
-    return obj;
-}
-
-
 #ifdef USE_SWFTREE
 
 namespace {
diff --git a/libcore/DisplayObjectContainer.h b/libcore/DisplayObjectContainer.h
index 62087f3..f5dd164 100644
--- a/libcore/DisplayObjectContainer.h
+++ b/libcore/DisplayObjectContainer.h
@@ -53,49 +53,6 @@ public:
 
     virtual ~DisplayObjectContainer();
 
-    /// Remove the DisplayObject at the specified depth.
-    //
-    /// This is the implementation of the AS3-only method
-    /// DisplayObjectContainer.removeChildAt().
-    //
-    /// @param index    The depth from which to remove a DisplayObject.
-    /// @return         The removed DisplayObject (reflects the AS return)
-    DisplayObject* removeChildAt(int index);
-    
-    /// Remove the specified child DisplayObject.
-    //
-    /// TODO: should be a function of DisplayObjectContainer
-    /// This is the implementation of the AS3-only method
-    /// DisplayObjectContainer.removeChild(), but can also be used for
-    /// AS2.
-    //
-    /// @param obj      The DisplayObject to remove.
-    /// @return         The removed DisplayObject (reflects the AS return)
-    DisplayObject* removeChild(DisplayObject* obj);
-    
-    /// Add a child DisplayObject at the next suitable index (AS2: depth).
-    //
-    /// TODO: should be a function of DisplayObjectContainer
-    /// This is the implementation of the AS3-only method
-    /// DisplayObjectContainer.addChild(), but can also be used for
-    /// AS2.
-    //
-    /// @param obj      The DisplayObject to add.
-    /// @return         The added DisplayObject (reflects the AS return)
-    DisplayObject* addChild(DisplayObject* obj);
-
-    /// Add a child DisplayObject at the specified index (AS2: depth).
-    //
-    /// TODO: should be a function of DisplayObjectContainer
-    /// This is the implementation of the AS3-only method
-    /// DisplayObjectContainer.addChild(), but can also be used for
-    /// AS2.
-    //
-    /// @param obj      The DisplayObject to add.
-    /// @param index    The index (depth) at which to add the DisplayObject.
-    /// @return         The added DisplayObject (reflects the AS return)
-    DisplayObject* addChildAt(DisplayObject* obj, int index);
-
     size_t numChildren() const {
         return _displayList.size();
     }

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

Summary of changes:
 libcore/DisplayList.cpp            |   50 +----------------------------------
 libcore/DisplayList.h              |   27 -------------------
 libcore/DisplayObjectContainer.cpp |   45 --------------------------------
 libcore/DisplayObjectContainer.h   |   43 -------------------------------
 libcore/TextField.cpp              |    6 ++--
 libcore/swf/TextRecord.cpp         |    2 +-
 libcore/swf/TextRecord.h           |   13 ++++++---
 7 files changed, 14 insertions(+), 172 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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