1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Copyright (c) 2009-2011 Apple Inc.
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Permission is hereby granted, free of charge, to any person
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org obtaining a copy of this software and associated documentation files
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org (the "Software"), to deal in the Software without restriction,
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org including without limitation the rights to use, copy, modify, merge,
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org publish, distribute, sublicense, and/or sell copies of the Software,
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org and to permit persons to whom the Software is furnished to do so,
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org subject to the following conditions:
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org The above copyright notice and this permission notice shall be
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org included in all copies or substantial portions of the Software.
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org DEALINGS IN THE SOFTWARE.
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Except as contained in this notice, the name(s) of the above
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org copyright holders shall not be used in advertising or otherwise to
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org promote the sale, use or other dealings in this Software without
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org prior written authorization.
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org*/
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "glxclient.h"
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "apple_glx_context.h"
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "apple_xgl_api.h"
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "glapitable.h"
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct _glapi_table * __ogl_framework_api;
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org__applegl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct glx_context *gc = __glXGetCurrentContext();
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   Display *dpy = glXGetCurrentDisplay();
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (gc && gc->driContext)
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      apple_glx_context_update(dpy, gc->driContext);
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   __ogl_framework_api->Viewport(x, y, width, height);
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
48