gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, openvg, updated. 76f0bd89013ccb16d112


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, openvg, updated. 76f0bd89013ccb16d112e9b614fcbf8113bf77f9
Date: Tue, 28 Dec 2010 01:15:47 +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, openvg has been updated
       via  76f0bd89013ccb16d112e9b614fcbf8113bf77f9 (commit)
      from  72a14c765d49f465f450faa3da27017bcb6827c6 (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=76f0bd89013ccb16d112e9b614fcbf8113bf77f9


commit 76f0bd89013ccb16d112e9b614fcbf8113bf77f9
Author: Rob Savoye <address@hidden>
Date:   Mon Dec 27 17:05:52 2010 -0700

    implement GetType() to return the Fill style associated with the style.

diff --git a/librender/openvg/Renderer_ovg.cpp 
b/librender/openvg/Renderer_ovg.cpp
index d02860c..e58c4b3 100644
--- a/librender/openvg/Renderer_ovg.cpp
+++ b/librender/openvg/Renderer_ovg.cpp
@@ -101,6 +101,48 @@ public:
     }
 };
 
+/// Get the fill type. Each fill type has it's own sub types,
+/// so we map the sub type name to the fill type name.
+class GetType : public boost::static_visitor<SWF::FillType>
+{
+public:
+    SWF::FillType operator()(const SolidFill& f) const {
+        return SWF::FILL_SOLID;
+    }
+    SWF::FillType operator()(const GradientFill& g) const {
+        switch (g.type()) {
+          case GradientFill::LINEAR:
+              return SWF::FILL_LINEAR_GRADIENT;
+              break;
+          case GradientFill::RADIAL:
+              return SWF::FILL_RADIAL_GRADIENT;
+              break;
+          default:
+              break;              
+        }
+    }
+    SWF::FillType operator()(const BitmapFill& b) const {
+        switch (b.type()) {
+          case BitmapFill::TILED:
+              if (b.smoothingPolicy() == BitmapFill::SMOOTHING_OFF) {
+                  return SWF::FILL_TILED_BITMAP_HARD;
+              } else {
+                  return SWF::FILL_TILED_BITMAP;
+              }
+              break;
+          case BitmapFill::CLIPPED:
+              if (b.smoothingPolicy() == BitmapFill::SMOOTHING_OFF) {
+                  return SWF::FILL_CLIPPED_BITMAP_HARD;
+              } else {
+                  return SWF::FILL_CLIPPED_BITMAP;
+              }
+              break;
+          default:
+              break;
+        }
+    }
+};
+
 /// Get the bitmap data of a style from the variant
 class GetBitmap : public boost::static_visitor<const CachedBitmap *>
 {
@@ -841,11 +883,9 @@ void
 Renderer_ovg::apply_fill_style(const FillStyle& style, const SWFMatrix& mat,
                                const SWFCxForm& cx)
 {
-    //    GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
 
-    //    FIXME fill_style changed to FillStyle
-    SWF::FillType fill_type = SWF::FILL_SOLID; // style.get_type();
-    
+    SWF::FillType fill_type = boost::apply_visitor(GetType(), style.fill);
     switch (fill_type) {
         
       case SWF::FILL_LINEAR_GRADIENT:

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

Summary of changes:
 librender/openvg/Renderer_ovg.cpp |   48 +++++++++++++++++++++++++++++++++---
 1 files changed, 44 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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