Clone of mesa.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**************************************************************************
  2. *
  3. * Copyright 2009 VMware, Inc. All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sub license, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * The above copyright notice and this permission notice (including the
  14. * next paragraph) shall be included in all copies or substantial portions
  15. * of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  20. * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  21. * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  22. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  23. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. *
  25. **************************************************************************/
  26. #ifndef VG_STATE_H
  27. #define VG_STATE_H
  28. #include "VG/openvg.h"
  29. #include "api_consts.h"
  30. #include "matrix.h"
  31. struct vg_value
  32. {
  33. VGfloat f;
  34. VGint i;
  35. };
  36. struct vg_state {
  37. /* Mode settings */
  38. VGMatrixMode matrix_mode;
  39. VGFillRule fill_rule;
  40. VGImageQuality image_quality;
  41. VGRenderingQuality rendering_quality;
  42. VGBlendMode blend_mode;
  43. VGImageMode image_mode;
  44. /* Scissoring rectangles */
  45. struct vg_value scissor_rects[32*4];
  46. VGint scissor_rects_num;
  47. /* Color Transformation */
  48. VGboolean color_transform;
  49. VGfloat color_transform_values[8];
  50. /* Stroke parameters */
  51. struct {
  52. struct vg_value line_width;
  53. VGCapStyle cap_style;
  54. VGJoinStyle join_style;
  55. struct vg_value miter_limit;
  56. struct vg_value dash_pattern[VEGA_MAX_DASH_COUNT];
  57. VGint dash_pattern_num;
  58. struct vg_value dash_phase;
  59. VGboolean dash_phase_reset;
  60. } stroke;
  61. /* Edge fill color for VG_TILE_FILL tiling mode */
  62. VGfloat tile_fill_color[4];
  63. VGint tile_fill_colori[4];
  64. /* Color for vgClear */
  65. VGfloat clear_color[4];
  66. VGint clear_colori[4];
  67. /* Glyph origin */
  68. struct vg_value glyph_origin[2];
  69. /* Enable/disable alpha masking and scissoring */
  70. VGboolean masking;
  71. VGboolean scissoring;
  72. /* Pixel layout information */
  73. VGPixelLayout pixel_layout;
  74. VGPixelLayout screen_layout;
  75. /* Source format selection for image filters */
  76. VGboolean filter_format_linear;
  77. VGboolean filter_format_premultiplied;
  78. /* Destination write enable mask for image filters */
  79. VGbitfield filter_channel_mask;
  80. struct matrix path_user_to_surface_matrix;
  81. struct matrix image_user_to_surface_matrix;
  82. struct matrix fill_paint_to_user_matrix;
  83. struct matrix stroke_paint_to_user_matrix;
  84. struct matrix glyph_user_to_surface_matrix;
  85. struct vg_paint *stroke_paint;
  86. struct vg_paint *fill_paint;
  87. };
  88. void vg_init_state(struct vg_state *state);
  89. struct matrix * vg_state_matrix(struct vg_state *state);
  90. #endif