ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

rastpic.c
Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  rastpic.c                                                              */
00004 /*                                                                         */
00005 /*    The FreeType position independent code services for raster module.   */
00006 /*                                                                         */
00007 /*  Copyright 2009, 2010 by                                                */
00008 /*  Oran Agra and Mickey Gabel.                                            */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019 #include <ft2build.h>
00020 #include FT_FREETYPE_H
00021 #include FT_INTERNAL_OBJECTS_H
00022 #include "rastpic.h"
00023 
00024 #ifdef FT_CONFIG_OPTION_PIC
00025 
00026   /* forward declaration of PIC init functions from ftraster.c */
00027   void FT_Init_Class_ft_standard_raster(FT_Raster_Funcs*);
00028 
00029   void
00030   ft_raster1_renderer_class_pic_free(  FT_Library library )
00031   {
00032     FT_PIC_Container* pic_container = &library->pic_container;
00033     FT_Memory memory = library->memory;
00034     if ( pic_container->raster )
00035     {
00036       RasterPIC* container = (RasterPIC*)pic_container->raster;
00037       if(--container->ref_count)
00038         return;
00039       FT_FREE( container );
00040       pic_container->raster = NULL;
00041     }
00042   }
00043 
00044 
00045   FT_Error
00046   ft_raster1_renderer_class_pic_init( FT_Library library )
00047   {
00048     FT_PIC_Container* pic_container = &library->pic_container;
00049     FT_Error          error         = Raster_Err_Ok;
00050     RasterPIC*        container;
00051     FT_Memory         memory        = library->memory;
00052 
00053 
00054     /* since this function also serve raster5 renderer, 
00055        it implements reference counting */
00056     if ( pic_container->raster )
00057     {
00058       ((RasterPIC*)pic_container->raster)->ref_count++;
00059       return error;
00060     }
00061 
00062     /* allocate pointer, clear and set global container pointer */
00063     if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00064       return error;
00065     FT_MEM_SET( container, 0, sizeof(*container) );
00066     pic_container->raster = container;
00067     container->ref_count = 1;
00068 
00069     /* initialize pointer table - this is how the module usually expects this data */
00070     FT_Init_Class_ft_standard_raster(&container->ft_standard_raster);
00071 /*Exit:*/
00072     if(error)
00073       ft_raster1_renderer_class_pic_free(library);
00074     return error;
00075   }
00076 
00077   /* re-route these init and free functions to the above functions */
00078   FT_Error ft_raster5_renderer_class_pic_init(FT_Library library)
00079   {
00080     return ft_raster1_renderer_class_pic_init(library);
00081   }
00082   void ft_raster5_renderer_class_pic_free(FT_Library library)
00083   {
00084     ft_raster1_renderer_class_pic_free(library);
00085   }
00086 
00087 #endif /* FT_CONFIG_OPTION_PIC */
00088 
00089 
00090 /* END */

Generated on Sun May 27 2012 04:34:01 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.