Пример #1
0
GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image)
{
   CLIENT_THREAD_STATE_T *thread = CLIENT_GET_THREAD_STATE();

   if (IS_OPENGLES_11_OR_20(thread)) {
#if EGL_BRCM_global_image
      if ((uintptr_t)image & (1u << 31)) {
         GLuint global_image_id[2];
         if (check_global_image_egl_image(global_image_id, image, thread, false)) {
            RPC_CALL3(glGlobalImageTexture2DOES_impl,
                      thread,
                      GLGLOBALIMAGETEXTURE2DOES_ID,
                      RPC_ENUM(target),
                      RPC_UINT(global_image_id[0]),
                      RPC_UINT(global_image_id[1]));
         } else {
            set_error(GLXX_GET_CLIENT_STATE(thread), GL_INVALID_VALUE);
         }
      } else {
#endif
         vcos_log_trace("[%s] target 0x%x image %d", __FUNCTION__, target, (uint32_t)image);
         RPC_CALL2(glEGLImageTargetTexture2DOES_impl,
                   thread,
                   GLEGLIMAGETARGETTEXTURE2DOES_ID,
                   RPC_ENUM(target),
                   RPC_EGLID(image));
         RPC_FLUSH(thread);
#if EGL_BRCM_global_image
      }
#endif
   }
}
Пример #2
0
void wfc_commit_callback(WFC_ELEMENT_T *element)
{
   WFCNativeStreamType source_stream =
      element->source ? element->source->stream : WFC_INVALID_HANDLE;
   WFCNativeStreamType mask_stream =
      element->mask ? element->mask->stream : WFC_INVALID_HANDLE;

#ifdef RPC_DIRECT
   wfcIntCommitAdd_impl((WFCContext) element->context,
      (WFCElement) element, &element->attributes, source_stream, mask_stream);
#else
   RPC_CALL18(wfcIntCommitAdd_impl,
      WFCINTCOMMITADD_ID,
      RPC_UINT((WFCContext) element->context),
      RPC_UINT((WFCElement) element),
      RPC_INT(element->attributes.dest_rect[0]),
      RPC_INT(element->attributes.dest_rect[1]),
      RPC_INT(element->attributes.dest_rect[2]),
      RPC_INT(element->attributes.dest_rect[3]),
      RPC_FLOAT(element->attributes.src_rect[0]),
      RPC_FLOAT(element->attributes.src_rect[1]),
      RPC_FLOAT(element->attributes.src_rect[2]),
      RPC_FLOAT(element->attributes.src_rect[3]),
      RPC_BOOLEAN(element->attributes.flip),
      RPC_ENUM(element->attributes.rotation),
      RPC_ENUM(element->attributes.scale_filter),
      RPC_BITFIELD(element->attributes.transparency_types),
      RPC_FLOAT(element->attributes.global_alpha),
      RPC_UINT(source_stream),
      RPC_UINT(mask_stream),
      RPC_UINT(0)); // dummy parameter; currently unused.
#endif

} // wfc_commit_callback()
Пример #3
0
WFC_CONTEXT_T *wfc_context_create
   (WFC_DEVICE_T *device_ptr, WFCContextType context_type,
      uint32_t screen_or_stream_num, WFCErrorCode *error)
{
   WFC_CONTEXT_T *context_ptr =
      khrn_platform_malloc(sizeof(WFC_CONTEXT_T), "WFC_CONTEXT_T");
   const WFC_CONTEXT_ATTRIB_T context_attrib_default = WFC_CONTEXT_ATTRIB_DEFAULT;

   if(context_ptr != NULL)
   {
      uint32_t response = RPC_CALL3_RES(wfcIntCreateContext_impl,
                                   WFCINTCREATECONTEXT_ID,
                                   RPC_UINT((uint32_t) context_ptr),
                                   RPC_ENUM(context_type),
                                   RPC_UINT(screen_or_stream_num));

      uint32_t height_or_err = WFC_CONTEXT_HEIGHT_OR_ERR(response);
      uint32_t width = WFC_CONTEXT_WIDTH(response);

      if(width != 0)
      {
         wfc_link_init_null(&context_ptr->link);

         context_ptr->device = device_ptr;
         wfc_link_init_empty(&context_ptr->sources);
         wfc_link_init_empty(&context_ptr->masks);

         wfc_link_init_empty(&context_ptr->elements_not_in_scene);
         wfc_link_init_empty(&context_ptr->elements_in_scene);
         context_ptr->active = false;

         context_ptr->type = context_type;
         context_ptr->height = height_or_err;
         context_ptr->width = width;
         context_ptr->attributes = context_attrib_default;
      } // if
      else
      {
         khrn_platform_free(context_ptr);

         context_ptr = NULL;

         *error = (WFCErrorCode) response;
      } // else
   } // if
   else
      {*error = WFC_ERROR_OUT_OF_MEMORY;}

   return context_ptr;
} // wfc_context_create()
Пример #4
0
GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image)
{
   CLIENT_THREAD_STATE_T *thread = CLIENT_GET_THREAD_STATE();

   if (IS_OPENGLES_11(thread)) {
      /* OES_framebuffer_object not supported for GLES1.1 */
      GLXX_CLIENT_STATE_T *state = GLXX_GET_CLIENT_STATE(thread);
      if (state->error == GL_NO_ERROR)
         state->error = GL_INVALID_OPERATION;
   }
   else if (IS_OPENGLES_20(thread)) {
#if EGL_BRCM_global_image
      if ((uintptr_t)image & (1u << 31)) {
         GLuint global_image_id[2];
         if (check_global_image_egl_image(global_image_id, image, thread, true)) {
            RPC_CALL3(glGlobalImageRenderbufferStorageOES_impl_20,
                      thread,
                      GLGLOBALIMAGERENDERBUFFERSTORAGEOES_ID_20,
                      RPC_ENUM(target),
                      RPC_UINT(global_image_id[0]),
                      RPC_UINT(global_image_id[1]));
         } else {
            set_error(GLXX_GET_CLIENT_STATE(thread), GL_INVALID_VALUE);
         }
      } else {
#endif
         RPC_CALL2(glEGLImageTargetRenderbufferStorageOES_impl_20,
                   thread,
                   GLEGLIMAGETARGETRENDERBUFFERSTORAGEOES_ID_20,
                   RPC_ENUM(target),
                   RPC_EGLID(image));
#if EGL_BRCM_global_image
      }
#endif
   }
}