revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / gallium / state_trackers / vega / api_misc.c
blob9e2ab03e01a4ef05d658a0be6837fe319629d304
1 /**************************************************************************
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
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:
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.
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.
25 **************************************************************************/
27 #include "VG/openvg.h"
29 #include "vg_context.h"
30 #include "api.h"
32 /* Hardware Queries */
33 VGHardwareQueryResult vegaHardwareQuery(VGHardwareQueryType key,
34 VGint setting)
36 struct vg_context *ctx = vg_current_context();
38 if (key < VG_IMAGE_FORMAT_QUERY ||
39 key > VG_PATH_DATATYPE_QUERY) {
40 vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR);
41 return VG_HARDWARE_UNACCELERATED;
44 if (key == VG_IMAGE_FORMAT_QUERY) {
45 if (setting < VG_sRGBX_8888 ||
46 setting > VG_lABGR_8888_PRE) {
47 vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR);
48 return VG_HARDWARE_UNACCELERATED;
50 } else if (key == VG_PATH_DATATYPE_QUERY) {
51 if (setting < VG_PATH_DATATYPE_S_8 ||
52 setting > VG_PATH_DATATYPE_F) {
53 vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR);
54 return VG_HARDWARE_UNACCELERATED;
57 /* we're supposed to accelerate everything */
58 return VG_HARDWARE_ACCELERATED;
61 /* Renderer and Extension Information */
62 const VGubyte *vegaGetString(VGStringID name)
64 struct vg_context *ctx = vg_current_context();
65 static const VGubyte *vendor = (VGubyte *)"Tungsten Graphics, Inc";
66 static const VGubyte *renderer = (VGubyte *)"Vega OpenVG 1.1";
67 static const VGubyte *version = (VGubyte *)"1.1";
69 if (!ctx)
70 return NULL;
72 switch(name) {
73 case VG_VENDOR:
74 return vendor;
75 case VG_RENDERER:
76 return renderer;
77 case VG_VERSION:
78 return version;
79 case VG_EXTENSIONS:
80 return NULL;
81 default:
82 return NULL;