gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog backend/render_handler_agg_style.h


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog backend/render_handler_agg_style.h
Date: Mon, 03 Sep 2007 10:08:55 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   07/09/03 10:08:55

Modified files:
        .              : ChangeLog 
        backend        : render_handler_agg_style.h 

Log message:
        render_handler_agg_style.h: Some fixes for focal gradients

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4196&r2=1.4197
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg_style.h?cvsroot=gnash&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.4196
retrieving revision 1.4197
diff -u -b -r1.4196 -r1.4197
--- ChangeLog   3 Sep 2007 09:40:20 -0000       1.4196
+++ ChangeLog   3 Sep 2007 10:08:55 -0000       1.4197
@@ -1,3 +1,7 @@
+2007-09-03 Udo Giacomozzi <address@hidden>
+
+       * render_handler_agg_style.h: Some fixes for focal gradients
+
 2007-09-03 Sandro Santilli <address@hidden>
 
        * server/edit_text_character.cpp (unload): don't forget to call

Index: backend/render_handler_agg_style.h
===================================================================
RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg_style.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- backend/render_handler_agg_style.h  3 Sep 2007 05:55:39 -0000       1.23
+++ backend/render_handler_agg_style.h  3 Sep 2007 10:08:55 -0000       1.24
@@ -254,7 +254,15 @@
     m_sg.generate(span, x, y, len);
   }
   
-private:
+  // Provide access to our gradient adaptor to allow re-initialization of
+  // focal gradients. I wanted to do this using partial template specialization
+  // but it became too complex for something that can be solved in a very easy
+  // (slightly unelegant) way. 
+  gradient_adaptor_type& get_gradient_adaptor() {
+    return m_gradient_adaptor;
+  }
+  
+protected:
 
   
   // Color transform
@@ -284,6 +292,7 @@
 
 
 
+
 // --- AGG HELPER CLASSES 
------------------------------------------------------
 
 /// Style handler for AGG's compound rasterizer. This is the class which is
@@ -623,13 +632,13 @@
       st_type* st = new st_type(fs, transl, cx, 64/2);  // div 2 because we 
need radius, not diameter     
         
       // NOTE: The value 64 is based on the bitmap texture used by other
-      // Gnash renderers which is normally 64x64 pixels for linear gradients.  
     
+      // Gnash renderers which is normally 64x64 pixels for radial gradients.  
     
         
       m_styles.push_back(st);
     }
 
-void add_gradient_focal(const gnash::fill_style& fs, gnash::matrix mat, 
gnash::cxform cx)
-{
+    void add_gradient_focal(const gnash::fill_style& fs, gnash::matrix mat, 
gnash::cxform cx)
+    {
        typedef agg::rgba8 color_type;
        typedef agg::span_allocator<color_type> span_allocator_type;
        typedef agg::span_interpolator_linear<agg::trans_affine> 
interpolator_type;
@@ -643,16 +652,23 @@
                interpolator_type, gradient_func_type, gradient_adaptor_type,
                color_func_type, sg_type> st_type;
 
-    // move the focal fill to where it should be.
+      // move the center of the focal fill (not it's focal point) to where it 
+      // should be.
     gnash::matrix transl;
-       // TODO: Is this right?
-    transl.concatenate_translation(fs.get_focal_point() * 32.0f - 32.0f, 
-32.0f);
+      transl.concatenate_translation(32.0f, -32.0f);
        transl.concatenate(mat);
 
+      // TODO: There seems to be something wrong with the translation,
+      // needs to be fixed (see focal-gradient.swf)
+    
        st_type* st = new st_type(fs, transl, cx, 64/2);
 
+      // re-initialize focal gradient settings
+      gradient_adaptor_type& adaptor = st->get_gradient_adaptor();
+      adaptor.init(100.0, fs.get_focal_point()*100.0, 0.0);
+    
        m_styles.push_back(st);
-}
+    }
 
     /// Returns the color of a certain fill style (solid)
     const agg::rgba8& color(unsigned style) const 




reply via email to

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