renderer.h revision e31a04ea3bc957b2a43b910b1f51807b12da18a6
1/************************************************************************** 2 * 3 * Copyright 2009 VMware, Inc. All Rights Reserved. 4 * Copyright 2010 LunarG, Inc. All Rights Reserved. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the 8 * "Software"), to deal in the Software without restriction, including 9 * without limitation the rights to use, copy, modify, merge, publish, 10 * distribute, sub license, and/or sell copies of the Software, and to 11 * permit persons to whom the Software is furnished to do so, subject to 12 * the following conditions: 13 * 14 * The above copyright notice and this permission notice (including the 15 * next paragraph) shall be included in all copies or substantial portions 16 * of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 * 26 **************************************************************************/ 27 28#ifndef RENDERER_H 29#define RENDERER_H 30 31#include "VG/openvg.h" 32 33struct renderer; 34 35struct vg_context; 36struct pipe_resource; 37struct pipe_sampler_view; 38struct pipe_surface; 39 40struct renderer *renderer_create(struct vg_context *owner); 41void renderer_destroy(struct renderer *); 42 43VGboolean renderer_copy_begin(struct renderer *renderer, 44 struct pipe_surface *dst, 45 VGboolean y0_top, 46 struct pipe_sampler_view *src); 47 48void renderer_copy(struct renderer *renderer, 49 VGint x, VGint y, VGint w, VGint h, 50 VGint sx, VGint sy, VGint sw, VGint sh); 51 52void renderer_copy_end(struct renderer *renderer); 53 54VGboolean renderer_drawtex_begin(struct renderer *renderer, 55 struct pipe_sampler_view *src); 56 57void renderer_drawtex(struct renderer *renderer, 58 VGint x, VGint y, VGint w, VGint h, 59 VGint sx, VGint sy, VGint sw, VGint sh); 60 61void renderer_drawtex_end(struct renderer *renderer); 62 63void renderer_draw_quad(struct renderer *, 64 VGfloat x1, VGfloat y1, 65 VGfloat x2, VGfloat y2, 66 VGfloat depth); 67void renderer_draw_texture(struct renderer *, 68 struct pipe_resource *texture, 69 VGfloat x1offset, VGfloat y1offset, 70 VGfloat x2offset, VGfloat y2offset, 71 VGfloat x1, VGfloat y1, 72 VGfloat x2, VGfloat y2); 73void renderer_texture_quad(struct renderer *, 74 struct pipe_resource *texture, 75 VGfloat x1offset, VGfloat y1offset, 76 VGfloat x2offset, VGfloat y2offset, 77 VGfloat x1, VGfloat y1, 78 VGfloat x2, VGfloat y2, 79 VGfloat x3, VGfloat y3, 80 VGfloat x4, VGfloat y4); 81void renderer_copy_texture(struct renderer *r, 82 struct pipe_sampler_view *src, 83 VGfloat sx1, VGfloat sy1, 84 VGfloat sx2, VGfloat sy2, 85 struct pipe_resource *dst, 86 VGfloat dx1, VGfloat dy1, 87 VGfloat dx2, VGfloat dy2); 88void renderer_copy_surface(struct renderer *r, 89 struct pipe_surface *src, 90 int sx1, int sy1, 91 int sx2, int sy2, 92 struct pipe_surface *dst, 93 int dx1, int dy1, 94 int dx2, int dy2, 95 float z, unsigned filter); 96 97 98#endif 99