graphicscomposition/openwfcompositionengine/composition/src/wfcpipeline.c
changeset 36 01a6848ebfd7
parent 0 5d03bc08d59c
child 152 9f1c3fea0f87
equal deleted inserted replaced
0:5d03bc08d59c 36:01a6848ebfd7
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     1 /* Copyright (c) 2009-2010 The Khronos Group Inc.
     2  *
     2  *
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     4  * copy of this software and/or associated documentation files (the
     4  * copy of this software and/or associated documentation files (the
     5  * "Materials"), to deal in the Materials without restriction, including
     5  * "Materials"), to deal in the Materials without restriction, including
     6  * without limitation the rights to use, copy, modify, merge, publish,
     6  * without limitation the rights to use, copy, modify, merge, publish,
   589         DPRINT(("WFC_Context_ExecuteCropStage: context = %p, state = %p",
   589         DPRINT(("WFC_Context_ExecuteCropStage: context = %p, state = %p",
   590                context, state));
   590                context, state));
   591     }
   591     }
   592     else
   592     else
   593     {
   593     {
   594 
       
   595         /* Source rectangle */
   594         /* Source rectangle */
   596         OWF_Rect_Set(&sourceRect,
   595         OWF_Rect_Set(&sourceRect,
   597                      state->oversizedCropRect.x, state->oversizedCropRect.y,
   596                      state->oversizedCropRect.x, state->oversizedCropRect.y,
   598                      state->oversizedCropRect.width, state->oversizedCropRect.height);
   597                      state->oversizedCropRect.width, state->oversizedCropRect.height);
   599 
   598 
   615  *----------------------------------------------------------------------------*/
   614  *----------------------------------------------------------------------------*/
   616 OWF_API_CALL void
   615 OWF_API_CALL void
   617 WFC_Pipeline_ExecuteFlipStage(WFC_CONTEXT* context, WFC_ELEMENT_STATE* state)
   616 WFC_Pipeline_ExecuteFlipStage(WFC_CONTEXT* context, WFC_ELEMENT_STATE* state)
   618 {
   617 {
   619     OWF_FLIP_DIRECTION      flipping;
   618     OWF_FLIP_DIRECTION      flipping;
   620     
   619 	
   621     if (NULL == context || NULL == state)
   620     if (NULL == context || NULL == state)
   622     {
   621     {
   623         DPRINT(("WFC_Context_ExecuteFlipStage: context = %p, state = %p",
   622         DPRINT(("WFC_Context_ExecuteFlipStage: context = %p, state = %p",
   624                context, state));
   623                context, state));
   625     }
   624     }
   626     else
   625     else
   627     {
   626     {
   628         OWF_ASSERT(state);
       
   629         flipping = state->sourceFlip > 0.0f ? OWF_FLIP_VERTICALLY
   627         flipping = state->sourceFlip > 0.0f ? OWF_FLIP_VERTICALLY
   630                                           : OWF_FLIP_NONE;
   628                                           : OWF_FLIP_NONE;
   631         
   629         
   632         OWF_Image_Flip(state->flippedSourceImage, flipping);
   630         OWF_Image_Flip(state->flippedSourceImage, flipping);
   633     }
   631     }
   644 {
   642 {
   645     OWF_ROTATION            rot = OWF_ROTATION_0;
   643     OWF_ROTATION            rot = OWF_ROTATION_0;
   646     OWF_RECTANGLE           rect;    
   644     OWF_RECTANGLE           rect;    
   647     WFCRotation             rotation;
   645     WFCRotation             rotation;
   648 
   646 
   649 
       
   650     if (NULL == context || NULL == state)
   647     if (NULL == context || NULL == state)
   651     {
   648     {
   652         DPRINT(("WFC_Context_ExecuteRotationStage: context = %p, state = %p",
   649         DPRINT(("WFC_Context_ExecuteRotationStage: context = %p, state = %p",
   653                context, state));
   650                context, state));
   654         return;
   651         return;
   655     }
   652     }
   656     OWF_ASSERT(state);
       
   657 
   653 
   658     rotation = state->rotation;
   654     rotation = state->rotation;
   659     DPRINT(("  Element rotation = %d", rotation));
   655     DPRINT(("  Element rotation = %d", rotation));
   660 
   656 
   661     switch (rotation)
   657     switch (rotation)
   721 {
   717 {
   722     OWF_RECTANGLE           scaledRect,
   718     OWF_RECTANGLE           scaledRect,
   723                             cropRect;
   719                             cropRect;
   724     OWF_FILTERING           filteringMode = OWF_FILTER_POINT_SAMPLING;
   720     OWF_FILTERING           filteringMode = OWF_FILTER_POINT_SAMPLING;
   725     WFCScaleFilter          filter;
   721     WFCScaleFilter          filter;
   726 
   722 	
   727     DPRINT(("WFC_Context_ExecuteScalingStage(%p,%p)", context, state));
   723     DPRINT(("WFC_Context_ExecuteScalingStage(%p,%p)", context, state));
   728 
   724 
   729     if (NULL == context || NULL == state)
   725     if (NULL == context || NULL == state)
   730     {
   726     {
   731         DPRINT(("WFC_Context_ExecuteScalingStage: context = %p, state = %p",
   727         DPRINT(("WFC_Context_ExecuteScalingStage: context = %p, state = %p",
   732                context, state));
   728                context, state));
   733         return;
   729         return;
   734     }
   730     }
   735 
       
   736     OWF_ASSERT(state);
       
   737 
   731 
   738     filter = state->sourceScaleFilter;
   732     filter = state->sourceScaleFilter;
   739 
   733 
   740     switch (filter)
   734     switch (filter)
   741     {
   735     {
   798 OWF_API_CALL void
   792 OWF_API_CALL void
   799 WFC_Pipeline_ExecuteBlendingStage(WFC_CONTEXT* context, WFC_ELEMENT_STATE* state)
   793 WFC_Pipeline_ExecuteBlendingStage(WFC_CONTEXT* context, WFC_ELEMENT_STATE* state)
   800 {
   794 {
   801     OWF_TRANSPARENCY        blendMode = OWF_TRANSPARENCY_NONE;
   795     OWF_TRANSPARENCY        blendMode = OWF_TRANSPARENCY_NONE;
   802     WFCbitfield             transparency = 0;
   796     WFCbitfield             transparency = 0;
   803 
   797 	
   804     DPRINT(("WFC_Pipeline_ExecuteBlendingStage"));
   798     DPRINT(("WFC_Pipeline_ExecuteBlendingStage"));
   805 
   799 
   806     if (NULL == context || NULL == state)
   800     if (NULL == context || NULL == state)
   807     {
   801     {
   808         return;
   802         return;
   809     }
   803     }
   810 
   804 
   811     DPRINT(("  context = %d, state = %d",
   805     DPRINT(("  context = %d, state = %d",
   812            context->handle, state));
   806            context->handle, state));
   813 
   807 
   814     OWF_ASSERT(state);
       
   815 
       
   816     transparency = state->transparencyTypes;
   808     transparency = state->transparencyTypes;
   817     blendMode = OWF_TRANSPARENCY_NONE;
   809     blendMode = OWF_TRANSPARENCY_NONE;
   818 
   810 
   819     if (transparency & WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA)
   811     if (transparency & WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA)
   820     {
   812     {