|
Blender V4.3
|
#include <cstdlib>#include <cstring>#include "DNA_camera_types.h"#include "DNA_listBase.h"#include "DNA_object_types.h"#include "DNA_screen_types.h"#include "DNA_userdef_types.h"#include "DNA_view3d_types.h"#include "DNA_windowmanager_types.h"#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_math_vector_types.hh"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_image.hh"#include "BKE_scene.hh"#include "BKE_screen.hh"#include "GHOST_C-api.h"#include "ED_node.hh"#include "ED_screen.hh"#include "ED_view3d.hh"#include "GPU_batch_presets.hh"#include "GPU_capabilities.hh"#include "GPU_context.hh"#include "GPU_debug.hh"#include "GPU_framebuffer.hh"#include "GPU_immediate.hh"#include "GPU_matrix.hh"#include "GPU_state.hh"#include "GPU_texture.hh"#include "GPU_viewport.hh"#include "RE_engine.h"#include "WM_api.hh"#include "WM_toolsystem.hh"#include "WM_types.hh"#include "wm.hh"#include "wm_draw.hh"#include "wm_event_system.hh"#include "wm_surface.hh"#include "wm_window.hh"#include "UI_resources.hh"Go to the source code of this file.
Classes | |
| struct | GrabState |
| struct | WindowDrawCB |
Macros | |
| #define | SPACE_NAME(space) |
Functions | |
Internal Utilities | |
| static bool | wm_window_grab_warp_region_is_set (const wmWindow *win) |
| static bool | wm_draw_region_stereo_set (Main *bmain, ScrArea *area, ARegion *region, eStereoViews sview) |
| static void | wm_region_test_gizmo_do_draw (bContext *C, ScrArea *area, ARegion *region, bool tag_redraw) |
| static void | wm_region_test_render_do_draw (const Scene *scene, Depsgraph *depsgraph, ScrArea *area, ARegion *region) |
| static bool | wm_region_use_viewport_by_type (short space_type, short region_type) |
| bool | WM_region_use_viewport (ScrArea *area, ARegion *region) |
| static const char * | wm_area_name (ScrArea *area) |
Draw Paint Cursor | |
| static void | wm_paintcursor_draw (bContext *C, ScrArea *area, ARegion *region) |
Post Draw Region on display handlers | |
| static void | wm_region_draw_overlay (bContext *C, const ScrArea *area, ARegion *region) |
Window Drawing (Draw All) | |
Reference method, draw all each time. | |
| void * | WM_draw_cb_activate (wmWindow *win, void(*draw)(const wmWindow *win, void *customdata), void *customdata) |
| void | WM_draw_cb_exit (wmWindow *win, void *handle) |
| static void | wm_draw_callbacks (wmWindow *win) |
Region Drawing | |
Each region draws into its own frame-buffer, which is then blit on the window draw buffer. This helps with fast redrawing if only some regions change. It also means we can share a single context for multiple windows, so that for example VAOs can be shared between windows. | |
| static void | wm_draw_region_buffer_free (ARegion *region) |
| static void | wm_draw_offscreen_texture_parameters (GPUOffScreen *offscreen) |
| static eGPUTextureFormat | get_hdr_framebuffer_format (const Scene *scene) |
| static void | wm_draw_region_buffer_create (Scene *scene, ARegion *region, bool stereo, bool use_viewport) |
| static void | wm_draw_region_bind (ARegion *region, int view) |
| static void | wm_draw_region_unbind (ARegion *region) |
| static void | wm_draw_region_blit (ARegion *region, int view) |
| GPUTexture * | wm_draw_region_texture (ARegion *region, int view) |
| void | wm_draw_region_blend (ARegion *region, int view, bool blend) |
| GPUViewport * | WM_draw_region_get_viewport (ARegion *region) |
| GPUViewport * | WM_draw_region_get_bound_viewport (ARegion *region) |
| static void | wm_draw_window_offscreen (bContext *C, wmWindow *win, bool stereo) |
| static void | wm_draw_window_onscreen (bContext *C, wmWindow *win, int view) |
| static void | wm_draw_window (bContext *C, wmWindow *win) |
| static void | wm_draw_surface (bContext *C, wmSurface *surface) |
Window Screen Shot Utility (Front-Buffer & Off-Screen) | |
Include here since it can involve low level buffer switching. | |
| uint8_t * | WM_window_pixels_read_from_frontbuffer (const wmWindowManager *wm, const wmWindow *win, int r_size[2]) |
| void | WM_window_pixels_read_sample_from_frontbuffer (const wmWindowManager *wm, const wmWindow *win, const int pos[2], float r_col[3]) |
| uint8_t * | WM_window_pixels_read_from_offscreen (bContext *C, wmWindow *win, int r_size[2]) |
| bool | WM_window_pixels_read_sample_from_offscreen (bContext *C, wmWindow *win, const int pos[2], float r_col[3]) |
| uint8_t * | WM_window_pixels_read (bContext *C, wmWindow *win, int r_size[2]) |
| bool | WM_window_pixels_read_sample (bContext *C, wmWindow *win, const int pos[2], float r_col[3]) |
| bool | WM_desktop_cursor_sample_read (float r_col[3]) |
Main Update Call | |
| static bool | wm_draw_update_test_window (Main *bmain, bContext *C, wmWindow *win) |
| static void | wm_draw_update_clear_window (bContext *C, wmWindow *win) |
| void | WM_paint_cursor_tag_redraw (wmWindow *win, ARegion *) |
| void | wm_draw_update (bContext *C) |
| void | wm_draw_region_clear (wmWindow *win, ARegion *) |
| void | WM_draw_region_free (ARegion *region) |
| void | wm_draw_region_test (bContext *C, ScrArea *area, ARegion *region) |
| void | WM_redraw_windows (bContext *C) |
Region Viewport Drawing | |
This is needed for viewport drawing for operator use (where the viewport may not have drawn yet). Otherwise avoid using these since they're exposing low level logic externally. | |
| void | WM_draw_region_viewport_ensure (Scene *scene, ARegion *region, short space_type) |
| void | WM_draw_region_viewport_bind (ARegion *region) |
| void | WM_draw_region_viewport_unbind (ARegion *region) |
Draw Software Cursor | ||
Draw the cursor instead of relying on the graphical environment. Needed when setting the cursor position (warping) isn't supported (GHOST/WAYLAND). | ||
| struct { | ||
| int8_t enabled | ||
| int winid | ||
| int xy [2] | ||
| } | g_software_cursor | |
| static bool | wm_software_cursor_needed () | |
| static bool | wm_software_cursor_needed_for_window (const wmWindow *win, GrabState *grab_state) | |
| static bool | wm_software_cursor_motion_test (const wmWindow *win) | |
| static void | wm_software_cursor_motion_update (const wmWindow *win) | |
| static void | wm_software_cursor_motion_clear () | |
| static void | wm_software_cursor_motion_clear_with_window (const wmWindow *win) | |
| static void | wm_software_cursor_draw_bitmap (const int event_xy[2], const GHOST_CursorBitmapRef *bitmap) | |
| static void | wm_software_cursor_draw_crosshair (const int event_xy[2]) | |
| static void | wm_software_cursor_draw (wmWindow *win, const GrabState *grab_state) | |
Handle OpenGL buffers for windowing, also paint cursor.
Definition in file wm_draw.cc.
| #define SPACE_NAME | ( | space | ) |
Referenced by wm_area_name().
|
static |
Definition at line 673 of file wm_draw.cc.
References COLORMANAGE_VIEW_USE_HDR, GPU_hdr_support(), GPU_RGBA16F, and GPU_RGBA8.
Referenced by wm_draw_region_buffer_create(), wm_draw_window(), and WM_window_pixels_read_from_offscreen().
|
static |
Definition at line 561 of file wm_draw.cc.
References SPACE_ACTION, SPACE_CLIP, SPACE_CONSOLE, SPACE_EMPTY, SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE, SPACE_INFO, SPACE_NAME, SPACE_NLA, SPACE_NODE, SPACE_OUTLINER, SPACE_PROPERTIES, SPACE_SCRIPT, SPACE_SEQ, SPACE_STATUSBAR, SPACE_TEXT, SPACE_TOPBAR, SPACE_USERPREF, and SPACE_VIEW3D.
Referenced by wm_draw_window_offscreen().
| bool WM_desktop_cursor_sample_read | ( | float | r_col[3] | ) |
Return the color of the pixel at the current mouse cursor position on the desktop, whether in a Blender window or not. Returns false on failure or if not supported by the platform.
Definition at line 1428 of file wm_draw.cc.
References GHOST_GetPixelAtCursor().
Referenced by eyedropper_color_sample_fl().
|
static |
Definition at line 631 of file wm_draw.cc.
References wmWindow::drawcalls, and LISTBASE_FOREACH.
Referenced by wm_draw_window_onscreen().
| void * WM_draw_cb_activate | ( | wmWindow * | win, |
| void(* | draw )(const wmWindow *win, void *customdata), | ||
| void * | customdata ) |
Definition at line 607 of file wm_draw.cc.
References BLI_addtail(), WindowDrawCB::customdata, WindowDrawCB::draw, wmWindow::drawcalls, and MEM_callocN.
Referenced by area_join_dock_cb_window(), area_join_invoke(), area_move_init(), area_split_invoke(), eyedropper_cryptomatte_sample_fl(), and eyedropper_init().
| void WM_draw_cb_exit | ( | wmWindow * | win, |
| void * | handle ) |
Definition at line 620 of file wm_draw.cc.
References BLI_remlink(), wmWindow::drawcalls, LISTBASE_FOREACH, and MEM_freeN().
Referenced by area_join_dock_cb_window(), area_join_exit(), area_move_exit(), area_split_exit(), eyedropper_cryptomatte_sample_fl(), and eyedropper_exit().
|
static |
Definition at line 664 of file wm_draw.cc.
References GPU_offscreen_color_texture(), and GPU_texture_mipmap_mode().
Referenced by wm_draw_region_buffer_create(), and wm_draw_window().
Definition at line 744 of file wm_draw.cc.
References GPU_offscreen_bind(), GPU_scissor(), GPU_scissor_test(), GPU_viewport_bind(), and view.
Referenced by wm_draw_region_test(), WM_draw_region_viewport_bind(), and wm_draw_window_offscreen().
Definition at line 821 of file wm_draw.cc.
References blend, BLI_rcti_size_x(), BLI_rcti_size_y(), ED_region_blend_alpha(), float, GLA_PIXEL_OFS, GPU_batch_draw(), GPU_batch_preset_quad(), GPU_batch_set_shader(), GPU_blend(), GPU_BLEND_ALPHA_PREMULT, GPU_BLEND_NONE, GPU_SHADER_2D_IMAGE_RECT_COLOR, GPU_shader_bind(), GPU_shader_get_builtin_shader(), GPU_shader_get_builtin_uniform(), GPU_shader_get_sampler_binding(), GPU_shader_get_uniform(), GPU_shader_uniform_float_ex(), GPU_texture_bind(), GPU_texture_unbind(), GPU_UNIFORM_COLOR, quad, RGN_ALIGN_ENUM_FROM_MASK, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT, wm_draw_region_texture(), rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.
Referenced by wm_draw_window_onscreen().
Definition at line 782 of file wm_draw.cc.
References GPU_offscreen_draw_to_screen(), and GPU_viewport_draw_to_screen().
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 683 of file wm_draw.cc.
References get_hdr_framebuffer_format(), GPU_offscreen_create(), GPU_offscreen_format(), GPU_offscreen_height(), GPU_offscreen_width(), GPU_TEXTURE_USAGE_SHADER_READ, GPU_viewport_create(), GPU_viewport_stereo_create(), MEM_callocN, wmDrawBuffer::offscreen, RPT_ERROR, wmDrawBuffer::viewport, wm_draw_offscreen_texture_parameters(), wm_draw_region_buffer_free(), and WM_report().
Referenced by wm_draw_region_test(), WM_draw_region_viewport_ensure(), and wm_draw_window_offscreen().
|
static |
Definition at line 649 of file wm_draw.cc.
References GPU_offscreen_free(), GPU_viewport_free(), and MEM_freeN().
Referenced by wm_draw_region_buffer_create(), and WM_draw_region_free().
Definition at line 1597 of file wm_draw.cc.
References WM_window_get_active_screen().
Referenced by ui_region_temp_remove().
| void WM_draw_region_free | ( | ARegion * | region | ) |
Definition at line 1603 of file wm_draw.cc.
References wm_draw_region_buffer_free().
Referenced by area_offscreen_exit(), ED_region_exit(), and ED_view3d_stop_render_preview().
| GPUViewport * WM_draw_region_get_bound_viewport | ( | ARegion * | region | ) |
Definition at line 915 of file wm_draw.cc.
Referenced by DRW_draw_render_loop_2d_ex(), DRW_draw_render_loop_ex(), DRW_draw_view(), and sequencer_ibuf_get().
| GPUViewport * WM_draw_region_get_viewport | ( | ARegion * | region | ) |
Definition at line 905 of file wm_draw.cc.
Referenced by DRW_draw_select_id(), DRW_notify_view_update(), ED_view3d_depth_override(), gizmo_find_intersected_3d(), ViewportColorSampleSession::init(), blender::ed::space_node::node_draw_space(), sequencer_draw_preview(), timeline_draw_context_get(), view3d_depths_create(), view3d_depths_rect_create(), and wm_region_test_render_do_draw().
|
static |
Definition at line 396 of file wm_draw.cc.
References Camera::bg_images, BKE_image_ensure_viewer(), View3D::camera, Object::data, SpaceSeq::draw_flag, ED_node_is_compositor(), ELEM, Image::eye, ListBase::first, RenderEngineType::flag, SpaceNode::flag, IMA_TYPE_COMPOSITE, CameraBGImage::iuser, SpaceImage::iuser, ImageUser::multiview_eye, SpaceSeq::multiview_eye, View3D::multiview_eye, OB_CAMERA, RE_USE_STEREO_VIEWPORT, RE_view_engine_get(), RGN_TYPE_PREVIEW, RGN_TYPE_WINDOW, SEQ_DRAW_BACKDROP, SNODE_BACKDRAW, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, Object::type, RenderEngine::type, and RegionView3D::view_render.
Referenced by wm_draw_window_offscreen().
Definition at line 1608 of file wm_draw.cc.
References CTX_wm_window(), ED_region_do_draw(), wm_draw_region_bind(), wm_draw_region_buffer_create(), wm_draw_region_unbind(), WM_region_use_viewport(), and WM_window_get_active_scene().
Referenced by redraw_timer_step().
Definition at line 808 of file wm_draw.cc.
References GPU_offscreen_color_texture(), and GPU_viewport_color_texture().
Referenced by wm_draw_region_blend().
|
static |
Definition at line 765 of file wm_draw.cc.
References GPU_offscreen_unbind(), GPU_scissor_test(), and GPU_viewport_unbind().
Referenced by wm_draw_region_test(), WM_draw_region_viewport_unbind(), and wm_draw_window_offscreen().
| void WM_draw_region_viewport_bind | ( | ARegion * | region | ) |
Definition at line 1652 of file wm_draw.cc.
References wm_draw_region_bind().
Referenced by ED_view3d_depth_override(), and ui_region_redraw_immediately().
Definition at line 1646 of file wm_draw.cc.
References wm_draw_region_buffer_create(), and wm_region_use_viewport_by_type().
Referenced by ED_view3d_depth_override().
| void WM_draw_region_viewport_unbind | ( | ARegion * | region | ) |
Definition at line 1657 of file wm_draw.cc.
References wm_draw_region_unbind().
Referenced by ED_view3d_depth_override(), and ui_region_redraw_immediately().
Draw offscreen contexts not bound to a specific window.
Definition at line 1248 of file wm_draw.cc.
References CTX_wm_manager(), GPU_context_begin_frame(), GPU_context_end_frame(), wm_surface_clear_drawable(), wm_surface_make_drawable(), and wm_window_clear_drawable().
Referenced by wm_draw_update().
| void wm_draw_update | ( | bContext * | C | ) |
Definition at line 1541 of file wm_draw.cc.
References BKE_image_free_unused_gpu_textures(), CTX_data_main(), CTX_wm_manager(), CTX_wm_window_set(), ED_screen_ensure_updated(), GHOST_GetWindowState(), GHOST_kWindowStateMinimized, wmWindow::ghostwin, GPU_context_main_lock(), GPU_context_main_unlock(), GPU_render_begin(), GPU_render_end(), GPU_render_step(), LISTBASE_FOREACH, state, wmWindowManager::windows, wm_draw_surface(), wm_draw_update_clear_window(), wm_draw_update_test_window(), wm_draw_window(), wm_surfaces_iter(), wm_window_clear_drawable(), wm_window_make_drawable(), and wm_window_swap_buffers().
Referenced by ghost_event_proc(), redraw_timer_step(), redraw_timer_window_swap(), WM_main(), and WM_redraw_windows().
Definition at line 1518 of file wm_draw.cc.
References ED_screen_areas_iter, LISTBASE_FOREACH, wm_region_test_gizmo_do_draw(), and WM_window_get_active_screen().
Referenced by wm_draw_update().
Definition at line 1440 of file wm_draw.cc.
References BKE_scene_ensure_depsgraph(), CTX_wm_manager(), depsgraph, ED_screen_areas_iter, g_software_cursor, LISTBASE_FOREACH, UNUSED_VARS, wmWindow::winid, wm_region_test_gizmo_do_draw(), wm_region_test_render_do_draw(), wm_software_cursor_motion_test(), wm_software_cursor_needed(), wm_software_cursor_needed_for_window(), WM_window_get_active_scene(), WM_window_get_active_screen(), and WM_window_get_active_view_layer().
Referenced by wm_draw_update().
Definition at line 1165 of file wm_draw.cc.
References Stereo3dFormat::display_mode, ELEM, get_hdr_framebuffer_format(), GPU_backbuffer_bind(), GPU_BACKBUFFER_LEFT, GPU_BACKBUFFER_RIGHT, GPU_bgl_end(), GPU_context_begin_frame(), GPU_context_end_frame(), GPU_offscreen_bind(), GPU_offscreen_color_texture(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_unbind(), GPU_texture_bind(), GPU_texture_unbind(), GPU_TEXTURE_USAGE_SHADER_READ, wmWindow::gpuctx, S3D_DISPLAY_ANAGLYPH, S3D_DISPLAY_INTERLACE, S3D_DISPLAY_PAGEFLIP, S3D_DISPLAY_SIDEBYSIDE, wmWindow::stereo3d_format, wm_draw_offscreen_texture_parameters(), wm_draw_window_offscreen(), wm_draw_window_onscreen(), wm_stereo3d_draw_sidebyside(), wm_stereo3d_draw_topbottom(), WM_stereo3d_enabled(), WM_window_get_active_scene(), WM_window_get_active_screen(), WM_window_native_pixel_size(), and wmWindowViewport().
Referenced by wm_draw_update().
Definition at line 925 of file wm_draw.cc.
References AREA_FLAG_ACTIVE_TOOL_UPDATE, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region_popup_set(), CTX_wm_region_set(), CTX_wm_workspace(), ED_area_update_region_sizes(), ED_region_do_draw(), ED_region_do_layout(), ED_screen_areas_iter, GPU_clear_color(), GPU_debug_group_begin(), GPU_debug_group_end(), GPU_viewport_stereo_composite(), LISTBASE_FOREACH, RGN_FLAG_DYNAMIC_SIZE, RGN_FLAG_HIDDEN, RGN_FLAG_POLL_FAILED, RGN_FLAG_TOO_SMALL, wmWindow::stereo3d_format, STEREO_LEFT_ID, STEREO_RIGHT_ID, wm_area_name(), wm_draw_region_bind(), wm_draw_region_buffer_create(), wm_draw_region_stereo_set(), wm_draw_region_unbind(), WM_region_use_viewport(), WM_TOOLSYSTEM_SPACE_MASK, WM_toolsystem_update_from_context(), WM_window_get_active_scene(), WM_window_get_active_screen(), and wmViewport().
Referenced by wm_draw_window().
Definition at line 1051 of file wm_draw.cc.
References CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region_set(), wmWindowManager::drags, ED_screen_areas_iter, ED_screen_draw_edges(), ListBase::first, wmWindow::gesture, GPU_clear_color(), GPU_debug_group_begin(), GPU_debug_group_end(), LISTBASE_FOREACH, wmWindowManager::paintcursors, UI_SetTheme(), wm_drags_draw(), wm_draw_callbacks(), wm_draw_region_blend(), wm_draw_region_blit(), wm_gesture_draw(), wm_paintcursor_draw(), wm_region_draw_overlay(), wm_software_cursor_draw(), wm_software_cursor_motion_clear_with_window(), wm_software_cursor_motion_update(), wm_software_cursor_needed(), wm_software_cursor_needed_for_window(), WM_window_get_active_screen(), wmWindowViewport(), and wmWindowViewport_ex().
Referenced by wm_draw_window(), WM_window_pixels_read_from_offscreen(), and WM_window_pixels_read_sample_from_offscreen().
Definition at line 1533 of file wm_draw.cc.
References WM_window_get_active_screen().
Referenced by blender::ed::sculpt_paint::paint_stroke_modal(), paintcurve_delete_point_exec(), paintcurve_point_add(), paintcurve_point_select(), paintcurve_slide_invoke(), paintcurve_slide_modal(), sample_color_exec(), sample_color_invoke(), viewRedrawForce(), and wm_paintcursor_tag().
Definition at line 99 of file wm_draw.cc.
References BLI_rcti_size_x(), BLI_rcti_size_y(), CTX_wm_manager(), CTX_wm_window(), ELEM, wmWindow::eventstate, GPU_scissor(), GPU_scissor_test(), LISTBASE_FOREACH_MUTABLE, wmWindowManager::paintcursors, RGN_TYPE_ANY, wmWindowManager::runtime, SPACE_TYPE_ANY, UI_SetTheme(), WM_capabilities_flag(), WM_CAPABILITY_CURSOR_WARP, wm_cursor_position_get(), WM_window_get_active_screen(), wm_window_grab_warp_region_is_set(), wmEvent::xy, and xy.
Referenced by wm_draw_window_onscreen().
| void WM_redraw_windows | ( | bContext * | C | ) |
High level function to redraw windows.
With some rare exceptions which require a redraw (screen-shot & sample screen color for e.g.) explicitly redrawing should be avoided, see: #92704, #93950, #97627 & #98462.
Definition at line 1621 of file wm_draw.cc.
References CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_window(), CTX_wm_window_set(), and wm_draw_update().
Referenced by sample_color_exec(), sample_color_invoke(), and screenshot_data_create().
Definition at line 380 of file wm_draw.cc.
References CTX_wm_window(), UI_SetTheme(), wmViewport(), and wmWindowViewport().
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 465 of file wm_draw.cc.
References CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), ED_region_tag_redraw_editor_overlays(), LISTBASE_FOREACH, WM_gizmo_group_type_poll(), WM_GIZMOGROUPTYPE_VR_REDRAWS, and WM_gizmomap_group_list().
Referenced by wm_draw_update_clear_window(), and wm_draw_update_test_window().
|
static |
Definition at line 503 of file wm_draw.cc.
References depsgraph, ED_region_tag_redraw_no_rebuild(), ED_region_tag_redraw_partial(), ED_view3d_calc_render_border(), RenderEngine::flag, GPU_viewport_do_update(), RE_ENGINE_DO_DRAW, RE_view_engine_get(), RGN_TYPE_WINDOW, SPACE_VIEW3D, RegionView3D::view_render, and WM_draw_region_get_viewport().
Referenced by wm_draw_update_test_window().
Definition at line 556 of file wm_draw.cc.
References wm_region_use_viewport_by_type().
Referenced by region_draw_azone_tab_arrow(), wm_draw_region_test(), and wm_draw_window_offscreen().
|
static |
Definition at line 549 of file wm_draw.cc.
References ELEM, RGN_TYPE_PREVIEW, RGN_TYPE_WINDOW, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, and SPACE_VIEW3D.
Referenced by WM_draw_region_viewport_ensure(), and WM_region_use_viewport().
Definition at line 343 of file wm_draw.cc.
References GrabState::bounds, wmWindow::eventstate, GHOST_GetCursorBitmap(), GHOST_kAxisX, GHOST_kAxisY, GHOST_kSuccess, wmWindow::ghostwin, max, min, mod_i(), UNPACK2, wm_software_cursor_draw_bitmap(), wm_software_cursor_draw_crosshair(), WM_window_native_pixel_y(), GrabState::wrap_axis, and wmEvent::xy.
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 239 of file wm_draw.cc.
References GHOST_CursorBitmapRef::data, GHOST_CursorBitmapRef::data_size, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_DATA_UBYTE, GPU_FETCH_FLOAT, GPU_matrix_mul, GPU_matrix_pop(), GPU_matrix_push(), GPU_PRIM_TRI_FAN, GPU_RGBA8, GPU_SHADER_3D_IMAGE, GPU_texture_create_2d(), GPU_texture_filter_mode(), GPU_texture_free(), GPU_texture_unbind(), GPU_texture_update(), GPU_TEXTURE_USAGE_GENERAL, GPU_vertformat_attr_add(), GHOST_CursorBitmapRef::hot_spot, immAttr2f(), immBegin(), immBindBuiltinProgram(), immBindTexture(), immEnd(), immUnbindProgram(), immVertex3f(), immVertexFormat(), int, pos, and unit_m4().
Referenced by wm_software_cursor_draw().
|
static |
Definition at line 300 of file wm_draw.cc.
References GPU_COMP_I32, GPU_FETCH_INT_TO_FLOAT, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRecti(), immUnbindProgram(), immUniformColor4f(), immVertexFormat(), max_ff(), pos, and UI_SCALE_FAC.
Referenced by wm_software_cursor_draw().
|
static |
Definition at line 225 of file wm_draw.cc.
References g_software_cursor.
Referenced by wm_software_cursor_motion_clear_with_window().
|
static |
Definition at line 232 of file wm_draw.cc.
References g_software_cursor, wmWindow::winid, and wm_software_cursor_motion_clear().
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 210 of file wm_draw.cc.
References wmWindow::eventstate, g_software_cursor, wmWindow::winid, and wmEvent::xy.
Referenced by wm_draw_update_test_window().
|
static |
Definition at line 217 of file wm_draw.cc.
References wmWindow::eventstate, g_software_cursor, wmWindow::winid, and wmEvent::xy.
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 183 of file wm_draw.cc.
References g_software_cursor, UNLIKELY, WM_capabilities_flag(), and WM_CAPABILITY_CURSOR_WARP.
Referenced by wm_draw_update_test_window(), wm_draw_window_onscreen(), and wm_software_cursor_needed_for_window().
|
static |
Definition at line 191 of file wm_draw.cc.
References BLI_assert, GrabState::bounds, GHOST_GetCursorGrabState(), GHOST_GetCursorVisibility(), wmWindow::ghostwin, GrabState::mode, wm_software_cursor_needed(), and GrabState::wrap_axis.
Referenced by wm_draw_update_test_window(), and wm_draw_window_onscreen().
|
static |
Return true when the cursor is grabbed and wrapped within a region.
Definition at line 74 of file wm_draw.cc.
References bounds(), ELEM, GHOST_GetCursorGrabState(), GHOST_kGrabHide, GHOST_kGrabWrap, wmWindow::ghostwin, and wmWindow::grabcursor.
Referenced by wm_paintcursor_draw().
Read from the screen.
Definition at line 1411 of file wm_draw.cc.
References CTX_wm_manager(), WM_capabilities_flag(), WM_CAPABILITY_GPU_FRONT_BUFFER_READ, WM_window_pixels_read_from_frontbuffer(), and WM_window_pixels_read_from_offscreen().
Referenced by screenshot_data_create().
| uint8_t * WM_window_pixels_read_from_frontbuffer | ( | const wmWindowManager * | wm, |
| const wmWindow * | win, | ||
| int | r_size[2] ) |
Read pixels from the front-buffer (fast).
Definition at line 1271 of file wm_draw.cc.
References GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), GPU_DATA_UBYTE, GPU_frontbuffer_read_color(), wmWindow::gpuctx, MEM_mallocN, wmWindowManager::windrawable, and WM_window_native_pixel_size().
Referenced by blend_file_thumb_from_screenshot(), and WM_window_pixels_read().
Draw the window & read pixels from an off-screen buffer (slower than WM_window_pixels_read_from_frontbuffer).
Definition at line 1341 of file wm_draw.cc.
References get_hdr_framebuffer_format(), GPU_DATA_UBYTE, GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_read_color(), GPU_offscreen_unbind(), GPU_TEXTURE_USAGE_SHADER_READ, MEM_mallocN, UNLIKELY, wm_draw_window_onscreen(), WM_window_get_active_scene(), and WM_window_native_pixel_size().
Referenced by WM_window_pixels_read().
| bool WM_window_pixels_read_sample | ( | bContext * | C, |
| wmWindow * | win, | ||
| const int | pos[2], | ||
| float | r_col[3] ) |
Read a single pixel from the screen.
Definition at line 1419 of file wm_draw.cc.
References CTX_wm_manager(), pos, WM_capabilities_flag(), WM_CAPABILITY_GPU_FRONT_BUFFER_READ, WM_window_pixels_read_sample_from_frontbuffer(), and WM_window_pixels_read_sample_from_offscreen().
Referenced by eyedropper_color_sample_fl(), and paint_sample_color().
| void WM_window_pixels_read_sample_from_frontbuffer | ( | const wmWindowManager * | wm, |
| const wmWindow * | win, | ||
| const int | pos[2], | ||
| float | r_col[3] ) |
A version of WM_window_pixels_read_from_frontbuffer that samples a pixel at pos.
Definition at line 1317 of file wm_draw.cc.
References BLI_assert, GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), GPU_DATA_FLOAT, GPU_frontbuffer_read_color(), wmWindow::gpuctx, pos, wmWindowManager::windrawable, WM_capabilities_flag(), and WM_CAPABILITY_GPU_FRONT_BUFFER_READ.
Referenced by WM_window_pixels_read_sample().
| bool WM_window_pixels_read_sample_from_offscreen | ( | bContext * | C, |
| wmWindow * | win, | ||
| const int | pos[2], | ||
| float | r_col[3] ) |
A version of WM_window_pixels_read_from_offscreen that samples a pixel at pos.
Definition at line 1380 of file wm_draw.cc.
References BLI_assert, copy_v3_v3(), GPU_DATA_FLOAT, GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_read_color_region(), GPU_offscreen_unbind(), GPU_RGBA8, GPU_TEXTURE_USAGE_SHADER_READ, pos, UNLIKELY, wm_draw_window_onscreen(), WM_window_native_pixel_size(), and zero_v3().
Referenced by eyedropper_color_sample_fl(), and WM_window_pixels_read_sample().
| int8_t enabled |
Definition at line 168 of file wm_draw.cc.
| struct { ... } g_software_cursor |
Track the state of the last drawn cursor.
Referenced by wm_draw_update_test_window(), wm_software_cursor_motion_clear(), wm_software_cursor_motion_clear_with_window(), wm_software_cursor_motion_test(), wm_software_cursor_motion_update(), and wm_software_cursor_needed().
| int winid |
Definition at line 169 of file wm_draw.cc.
Referenced by BKE_workspace_active_layout_set(), BKE_workspace_active_screen_set(), BKE_workspace_instance_hook_create(), and find_free_winid().
| int xy[2] |
Definition at line 170 of file wm_draw.cc.
Referenced by actionzone_area_poll(), area_actionzone_refresh_xy(), area_event_inside(), BKE_area_find_region_xy(), BKE_maskrasterize_handle_sample(), BKE_screen_area_map_find_area_xy(), BKE_screen_find_area_xy(), BKE_screen_find_main_region_at_xy(), BKE_screen_find_region_xy(), BLI_rctf_clamp_pt_v(), BLI_rctf_do_minmax_v(), BLI_rctf_init_pt_radius(), BLI_rctf_isect_circle(), BLI_rctf_isect_pt_v(), BLI_rcti_clamp_pt_v(), BLI_rcti_do_minmax_v(), BLI_rcti_init_pt_radius(), BLI_rcti_isect_circle(), BLI_rcti_isect_pt_v(), btMatrix3x3(), blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction::call(), blender::ed::outliner::collection_drop_init(), blender::ed::outliner::collection_drop_tooltip(), CreateMatrix(), data_device_handle_drop(), draw_seq_in_view(), dropbox_tooltip(), ED_area_actionzone_find_xy(), ED_area_azones_update(), ED_armature_pick_bone(), ed_armature_pick_bone_impl(), ED_armature_pick_ebone(), ED_armature_pick_pchan(), ED_screen_set_active_region(), eyedropper_draw_cursor_text_ex(), eyedropper_draw_cursor_text_region(), blender::ui::AbstractTreeView::find_hovered(), blender::ed::transform::flushTransNodes(), blender::ed::greasepencil::generate_corner(), GHOST_SystemWayland::getAllDisplayDimensions(), KDL::Vector2::GetValue(), blender::compositor::FastGaussianBlurOperation::IIR_gauss(), keyframe_region_circle_test(), keyframe_region_lasso_test(), layer_bucket_depth_from_xy(), layer_bucket_index_from_xy(), maskrasterize_buffer_cb(), maskrasterize_layer_isect(), blender::ed::outliner::outliner_drop_insert_collection_find(), blender::ed::outliner::outliner_drop_insert_find(), blender::compositor::DisplaceOperation::pixel_transform(), blender::compositor::MapUVOperation::pixel_transform(), region_event_inside(), blender::ui::region_views_find_drop_target_at(), relative_pointer_handle_relative_motion_impl(), sample_uniform_cone(), sample_uniform_hemisphere(), ScaleAlongAxis(), screen_actionzone_find_xy(), screen_cursor_set(), sequencer_drop_copy(), setRotation(), setValue(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::eevee::IrradianceBake::surfels_create(), textview_draw(), textview_draw_sel(), ui_block_bounds_calc_centered_pie(), ui_block_bounds_calc_popup(), UI_block_end_ex(), ui_block_find_mouse_over_ex(), ui_but_contains_point_px(), ui_but_find_mouse_over_ex(), ui_drag_toggle_set(), ui_list_find_mouse_over_ex(), ui_list_row_find_mouse_over(), ui_mouse_motion_towards_check(), ui_mouse_motion_towards_init(), ui_mouse_motion_towards_init_ex(), ui_mouse_motion_towards_reinit(), UI_region_block_find_mouse_over(), ui_region_contains_point_px(), UI_region_view_find_at(), UI_region_views_find_item_at(), ui_screen_region_find_mouse_over_ex(), ui_searchbox_inside(), UI_view2d_edge_pan_apply(), UI_view2d_mouse_in_scrollers(), UI_view2d_mouse_in_scrollers_ex(), ui_view_drop_tooltip(), ui_view_item_find_mouse_over(), blender::compositor::DisplaceOperation::update_memory_buffer_partial(), blender::compositor::MapUVOperation::update_memory_buffer_partial(), blender::compositor::MaskOperation::update_memory_buffer_partial(), blender::compositor::MovieDistortionOperation::update_memory_buffer_partial(), blender::compositor::ScreenLensDistortionOperation::update_memory_buffer_partial(), v3d_cursor_snap_draw_fn(), view2d_edge_pan_loc_compensate(), view3d_geometry_nodes_drop_tooltip(), view3d_mat_drop_tooltip(), view3d_opengl_select_ex(), view3d_ruler_item_project(), viewdolly_apply(), viewmove_modal_impl(), viewrotate_modal_impl(), viewzoom_apply(), viewzoom_apply_3d(), viewzoom_apply_camera(), viewzoom_invoke_impl(), viewzoom_modal_impl(), wm_drag_draw_default(), WM_drag_draw_default_fn(), wm_drag_draw_icon(), WM_drag_draw_item_name_fn(), wm_drag_draw_tooltip(), wm_drags_draw(), WM_event_drag_start_mval(), WM_event_drag_start_mval_fl(), WM_gesture_new(), wm_handler_fileselect_do(), wm_handlers_do(), wm_paintcursor_draw(), and wm_window_update_eventstate().