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.h backen...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog backend/render_handler.h backen...
Date: Thu, 01 Nov 2007 20:21:55 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/11/01 20:21:55

Modified files:
        .              : ChangeLog 
        backend        : render_handler.h render_handler_ogl.cpp 
                         render_handler_ogl.h 

Log message:
                * backend/render_handler.h: Document that draw_poly draws a
                thin border specified by the outline parameter.
                * backend/render_handler_ogl.{cpp,h}: Header/impl separation
                for class bitmap_info_ogl.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4755&r2=1.4756
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler.h?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.cpp?cvsroot=gnash&r1=1.85&r2=1.86
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_ogl.h?cvsroot=gnash&r1=1.1&r2=1.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4755
retrieving revision 1.4756
diff -u -b -r1.4755 -r1.4756
--- ChangeLog   1 Nov 2007 16:14:19 -0000       1.4755
+++ ChangeLog   1 Nov 2007 20:21:54 -0000       1.4756
@@ -1,3 +1,10 @@
+2007-11-01 Bastiaan Jacques <address@hidden>
+
+       * backend/render_handler.h: Document that draw_poly draws a
+       thin border specified by the outline parameter.
+       * backend/render_handler_ogl.{cpp,h}: Header/impl separation
+       for class bitmap_info_ogl.
+
 2007-11-01 Sandro Santilli <address@hidden>
 
        * libbase/GnashException.h: Add ActionTypeError exception.

Index: backend/render_handler.h
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- backend/render_handler.h    1 Nov 2007 09:35:46 -0000       1.48
+++ backend/render_handler.h    1 Nov 2007 20:21:55 -0000       1.49
@@ -18,7 +18,7 @@
 // 
 //
 
-/* $Id: render_handler.h,v 1.48 2007/11/01 09:35:46 bjacques Exp $ */
+/* $Id: render_handler.h,v 1.49 2007/11/01 20:21:55 bjacques Exp $ */
 
 #ifndef RENDER_HANDLER_H
 #define RENDER_HANDLER_H
@@ -365,7 +365,7 @@
   virtual void  draw_line_strip(const void* coords, int vertex_count,
       const rgba& color) = 0;
     
-  /// Draw a simple, solid filled polygon (no outline).
+  /// Draw a simple, solid filled polygon with a thin (~1 pixel) outline.
   //
   /// This can't be used for 
   /// Flash shapes but is intended for internal drawings like bounding boxes 

Index: backend/render_handler_ogl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- backend/render_handler_ogl.cpp      1 Nov 2007 09:35:47 -0000       1.85
+++ backend/render_handler_ogl.cpp      1 Nov 2007 20:21:55 -0000       1.86
@@ -315,11 +315,9 @@
   return n % 2 == 0;
 }
 
-class bitmap_info_ogl : public bitmap_info
-{
-  public:
-    bitmap_info_ogl(image::image_base* image, GLenum pixelformat)
-    :
+
+bitmap_info_ogl::bitmap_info_ogl(image::image_base* image, GLenum pixelformat)
+:
       _img(image->clone()),
       _pixel_format(pixelformat),
       _ogl_img_type(_img->height() == 1 ? GL_TEXTURE_1D : GL_TEXTURE_2D),
@@ -327,34 +325,35 @@
       _texture_id(0),
       _orig_width(_img->width()),
       _orig_height(_img->height())
-    {   
+{   
       if (!_ogl_accessible) {
         return;      
       }
       
       setup();
-    }   
+}   
     
-    ~bitmap_info_ogl()
-    {
+bitmap_info_ogl::~bitmap_info_ogl()
+{
       glDeleteTextures(1, &_texture_id);
       glDisable(_ogl_img_type);
-    }   
+}
       
-    inline bool
-    ogl_accessible() const
-    {
-  #if defined(_WIN32) || defined(WIN32)
+inline bool
+bitmap_info_ogl::ogl_accessible() const
+{
+#if defined(_WIN32) || defined(WIN32)
       return wglGetCurrentContext();
-  #elif defined(__APPLE_CC__)
+#elif defined(__APPLE_CC__)
       return aglGetCurrentContext();
-  #else
+#else
       return glXGetCurrentContext();
-  #endif
-    }    
+#endif
+}    
  
-    void setup()
-    {      
+void
+bitmap_info_ogl::setup()
+{      
       oglScopeEnable enabler(_ogl_img_type);
       
       glGenTextures(1, &_texture_id);
@@ -399,10 +398,11 @@
       // no longer need to keep it around. Of course this goes against the
       // principles of auto_ptr...
       delete _img.release();
-    }
+}
     
-    void upload(uint8_t* data, size_t width, size_t height)
-    {
+void
+bitmap_info_ogl::upload(uint8_t* data, size_t width, size_t height)
+{
       glTexParameteri(_ogl_img_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
       
       // FIXME: confirm that OpenGL can handle this image
@@ -416,11 +416,12 @@
                      0, _pixel_format, GL_UNSIGNED_BYTE, data);
 
       }
-    }
+}
 
-    void apply(const gnash::matrix& bitmap_matrix,
+void
+bitmap_info_ogl::apply(const gnash::matrix& bitmap_matrix,
                render_handler::bitmap_wrap_mode wrap_mode)
-    {
+{
       glEnable(_ogl_img_type);
     
       glEnable(GL_TEXTURE_GEN_S);
@@ -467,18 +468,7 @@
       p[3] = m.m_[1][2] * inv_height;
       glTexGenfv(GL_T, GL_OBJECT_PLANE, p);
       
-    }
-  
-  private:
-    std::auto_ptr<image::image_base> _img;
-    GLenum _pixel_format;
-    GLenum _ogl_img_type;
-    bool _ogl_accessible;  
-    GLuint _texture_id;
-    size_t _orig_width;
-    size_t _orig_height;
-};
-
+}
 
 class DSOEXPORT render_handler_ogl : public render_handler
 {
@@ -680,6 +670,7 @@
   virtual void
   end_display()
   {
+    check_error();
     glFlush(); // Make OpenGL execute all commands in the buffer.
   }
     

Index: backend/render_handler_ogl.h
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_ogl.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- backend/render_handler_ogl.h        1 Nov 2007 08:04:09 -0000       1.1
+++ backend/render_handler_ogl.h        1 Nov 2007 20:21:55 -0000       1.2
@@ -134,6 +134,29 @@
 };
 
 
+class bitmap_info_ogl : public bitmap_info
+{
+  public:
+    bitmap_info_ogl(image::image_base* image, GLenum pixelformat);
+    ~bitmap_info_ogl();
+
+    void apply(const gnash::matrix& bitmap_matrix,
+               render_handler::bitmap_wrap_mode wrap_mode);
+  private:
+    inline bool ogl_accessible() const;
+    void setup();    
+    void upload(uint8_t* data, size_t width, size_t height);
+    
+    std::auto_ptr<image::image_base> _img;
+    GLenum _pixel_format;
+    GLenum _ogl_img_type;
+    bool _ogl_accessible;  
+    GLuint _texture_id;
+    size_t _orig_width;
+    size_t _orig_height;
+};
+
+
 
 
 




reply via email to

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