openharmony 鸿蒙 capi-drawing-gpu-context-h

2026-08-25 浏览 (1)

drawing_gpu_context.h

Overview

This file declares the functions related to the GPU context in the drawing module.

File to include: <native_drawing/drawing_gpu_context.h>

Library: libnative_drawing.so

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Related module: Drawing

Summary

Structs

Nametypedef KeywordDescription
OH_Drawing_GpuContextOptionsOH_Drawing_GpuContextOptionsDescribes the options about the GPU context.

Functions

NameDescription
OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL(OH_Drawing_GpuContextOptions gpuContextOptions)Creates an OH_Drawing_GpuContext object that uses OpenGL as the backend interface.
OH_Drawing_GpuContext* OH_Drawing_GpuContextCreate(void)Creates an OH_Drawing_GpuContext object, for which the backend type depends on the device.
void OH_Drawing_GpuContextDestroy(OH_Drawing_GpuContext* gpuContext)Destroys an OH_Drawing_GpuContext object and reclaims the memory occupied by the object.

Function Description

OH_Drawing_GpuContextCreateFromGL()

OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL(OH_Drawing_GpuContextOptions gpuContextOptions)

Description

Creates an OH_Drawing_GpuContext object that uses OpenGL as the backend interface.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Deprecated from: 18

Substitute: OH_Drawing_GpuContextCreate

Parameters

NameDescription
OH_Drawing_GpuContextOptions gpuContextOptionsGPU context options, which is OH_Drawing_GpuContextOptions.

Returns

TypeDescription
OH_Drawing_GpuContext*Returns the pointer to the OH_Drawing_GpuContext object created.

OH_Drawing_GpuContextCreate()

OH_Drawing_GpuContext* OH_Drawing_GpuContextCreate(void)

Description

Creates an OH_Drawing_GpuContext object, for which the backend type depends on the device.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 16

Returns

TypeDescription
OH_Drawing_GpuContext*Returns the pointer to the OH_Drawing_GpuContext object created.

OH_Drawing_GpuContextDestroy()

void OH_Drawing_GpuContextDestroy(OH_Drawing_GpuContext* gpuContext)

Description

Destroys an OH_Drawing_GpuContext object and reclaims the memory occupied by the object.

System capability: SystemCapability.Graphic.Graphic2D.NativeDrawing

Since: 12

Parameters

NameDescription
OH_Drawing_GpuContext* gpuContextPointer to an OH_Drawing_GpuContext object.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-drawing-nativepixelmap-

openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange

openharmony 鸿蒙 capi-drawing-oh-drawing-brush

openharmony 鸿蒙 capi-drawing-oh-drawing-image-info

openharmony 鸿蒙 capi-drawing-text-linetypography-h

openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage

openharmony 鸿蒙 capi-drawing-typeface-h

openharmony 鸿蒙 capi-drawing-brush-h

openharmony 鸿蒙 capi-nativewindow

openharmony 鸿蒙 js-apis-uiEffect

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/DPauzMeq