Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Mesa 3-D graphics library
  3.  *
  4.  * Copyright (C) 2010 LunarG Inc.
  5.  * Copyright (C) 2011 VMware Inc. All rights reserved.
  6.  *
  7.  * Permission is hereby granted, free of charge, to any person obtaining a
  8.  * copy of this software and associated documentation files (the "Software"),
  9.  * to deal in the Software without restriction, including without limitation
  10.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11.  * and/or sell copies of the Software, and to permit persons to whom the
  12.  * Software is furnished to do so, subject to the following conditions:
  13.  *
  14.  * The above copyright notice and this permission notice shall be included
  15.  * in all copies or substantial portions of the Software.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  20.  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23.  * DEALINGS IN THE SOFTWARE.
  24.  *
  25.  * Authors:
  26.  *    Chia-I Wu <olv@lunarg.com>
  27.  *    Thomas Hellstrom <thellstrom@vmware.com>
  28.  */
  29.  
  30. #include "native.h"
  31.  
  32. struct resource_surface;
  33. struct sw_winsys;
  34.  
  35. struct resource_surface *
  36. resource_surface_create(struct pipe_screen *screen,
  37.                         enum pipe_format format, uint bind);
  38.  
  39. void
  40. resource_surface_destroy(struct resource_surface *rsurf);
  41.  
  42. boolean
  43. resource_surface_set_size(struct resource_surface *rsurf,
  44.                           uint width, uint height);
  45.  
  46. void
  47. resource_surface_get_size(struct resource_surface *rsurf,
  48.                           uint *width, uint *height);
  49.  
  50. boolean
  51. resource_surface_add_resources(struct resource_surface *rsurf,
  52.                                uint resource_mask);
  53.  
  54. void
  55. resource_surface_import_resource(struct resource_surface *rsurf,
  56.                                  enum native_attachment which,
  57.                                  struct pipe_resource *pres);
  58.  
  59. void
  60. resource_surface_get_resources(struct resource_surface *rsurf,
  61.                                struct pipe_resource **resources,
  62.                                uint resource_mask);
  63.  
  64. struct pipe_resource *
  65. resource_surface_get_single_resource(struct resource_surface *rsurf,
  66.                                      enum native_attachment which);
  67.  
  68. void
  69. resource_surface_swap_buffers(struct resource_surface *rsurf,
  70.                               enum native_attachment buf1,
  71.                               enum native_attachment buf2,
  72.                               boolean only_if_exist);
  73.  
  74. boolean
  75. resource_surface_present(struct resource_surface *rsurf,
  76.                          enum native_attachment which,
  77.                          void *winsys_drawable_handle);
  78.  
  79. /**
  80.  * Perform a gallium copy blit between the back left and front left
  81.  * surfaces. Needs to be followed by a call to resource_surface_flush.
  82.  */
  83. boolean
  84. resource_surface_copy_swap(struct resource_surface *rsurf,
  85.                            struct native_display *ndpy);
  86.  
  87. /**
  88.  * Throttle on outstanding rendering using the copy context. For example
  89.  * copy swaps.
  90.  */
  91. boolean
  92. resource_surface_throttle(struct resource_surface *rsurf);
  93.  
  94. /**
  95.  * Flush pending rendering using the copy context. This function saves a
  96.  * marker for upcoming throttles.
  97.  */
  98. boolean
  99. resource_surface_flush(struct resource_surface *rsurf,
  100.                        struct native_display *ndpy);
  101. /**
  102.  * Wait for all rendering using the copy context to be complete. Frees all
  103.  * throttle markers saved using resource_surface_flush.
  104.  */
  105. void
  106. resource_surface_wait(struct resource_surface *rsurf);
  107.  
  108. boolean
  109. native_display_copy_to_pixmap(struct native_display *ndpy,
  110.                               EGLNativePixmapType pix,
  111.                               struct pipe_resource *src);
  112.  
  113. struct pipe_resource *
  114. drm_display_import_native_buffer(struct native_display *ndpy,
  115.                                  struct native_buffer *nbuf);
  116.  
  117. boolean
  118. drm_display_export_native_buffer(struct native_display *ndpy,
  119.                                  struct pipe_resource *res,
  120.                                  struct native_buffer *nbuf);
  121.