|
Blender V5.0
|
#include <cstdlib>#include <cstring>#include "DNA_camera_types.h"#include "DNA_color_types.h"#include "DNA_listBase.h"#include "DNA_object_types.h"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "DNA_userdef_types.h"#include "DNA_view3d_types.h"#include "DNA_windowmanager_types.h"#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BLI_math_vector_types.hh"#include "BLI_rect.h"#include "BLI_utildefines.h"#include "BKE_context.hh"#include "BKE_image.hh"#include "BKE_layer.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"#include "IMB_colormanagement.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 (const 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 blender::gpu::TextureFormat | 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) |
| blender::gpu::Texture * | 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_area_offscreen (bContext *C, wmWindow *win, ScrArea *area, bool stereo) |
| 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 float system_scale, const int event_xy[2], const GHOST_CursorBitmapRef *bitmap) |
| static void | wm_software_cursor_draw_crosshair (const float system_scale, 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 702 of file wm_draw.cc.
References Scene::display_settings, GPU_hdr_support(), IMB_colormanagement_display_is_hdr(), IMB_colormanagement_display_is_wide_gamut(), Scene::view_settings, and ColorManagedViewSettings::view_transform.
Referenced by wm_draw_region_buffer_create(), wm_draw_window(), and WM_window_pixels_read_from_offscreen().
|
static |
Definition at line 587 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_SPREADSHEET, SPACE_STATUSBAR, SPACE_TEXT, SPACE_TOPBAR, SPACE_USERPREF, SPACE_VIEW3D, and ScrArea::spacetype.
Referenced by wm_draw_area_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 1501 of file wm_draw.cc.
References GHOST_GetPixelAtCursor().
Referenced by eyedropper_color_sample_fl().
Definition at line 960 of file wm_draw.cc.
References AREA_FLAG_ACTIVE_TOOL_UPDATE, C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region_set(), CTX_wm_workspace(), ED_area_update_region_sizes(), ED_region_do_draw(), ED_region_do_layout(), ARegion::flag, ScrArea::flag, GPU_debug_group_begin(), GPU_debug_group_end(), GPU_viewport_stereo_composite(), LISTBASE_FOREACH, ScrArea::regionbase, RGN_FLAG_DYNAMIC_SIZE, RGN_FLAG_HIDDEN, RGN_FLAG_POLL_FAILED, RGN_FLAG_TOO_SMALL, ARegion::runtime, ScrArea::spacetype, wmWindow::stereo3d_format, STEREO_LEFT_ID, STEREO_RIGHT_ID, view, 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(), and WM_window_get_active_scene().
Referenced by wm_draw_window_offscreen().
|
static |
Definition at line 659 of file wm_draw.cc.
References WindowDrawCB::draw, wmWindow::drawcalls, and LISTBASE_FOREACH_MUTABLE.
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 635 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_exit(), area_move_init(), area_split_invoke(), eyedropper_cryptomatte_sample_fl(), eyedropper_init(), region_scale_invoke(), screen_animate_area_highlight(), and blender::ed::asset::screenshot_preview_invoke().
| void WM_draw_cb_exit | ( | wmWindow * | win, |
| void * | handle ) |
Definition at line 648 of file wm_draw.cc.
References BLI_remlink(), wmWindow::drawcalls, LISTBASE_FOREACH, and MEM_freeN().
Referenced by area_animate_highlight_cb(), area_join_dock_cb_window(), area_join_exit(), area_move_exit(), area_move_out_draw_cb(), area_split_exit(), eyedropper_cryptomatte_sample_fl(), eyedropper_exit(), region_scale_exit(), and blender::ed::asset::screenshot_preview_exit().
|
static |
Definition at line 693 of file wm_draw.cc.
References GPU_offscreen_color_texture(), GPU_texture_mipmap_mode(), and texture().
Referenced by wm_draw_region_buffer_create(), and wm_draw_window().
|
static |
Definition at line 779 of file wm_draw.cc.
References GPU_offscreen_bind(), GPU_scissor(), GPU_scissor_test(), GPU_viewport_bind(), ARegion::runtime, view, ARegion::winrct, ARegion::winx, and ARegion::winy.
Referenced by wm_draw_area_offscreen(), wm_draw_region_test(), WM_draw_region_viewport_bind(), and wm_draw_window_offscreen().
| void wm_draw_region_blend | ( | ARegion * | region, |
| int | view, | ||
| bool | blend ) |
Definition at line 856 of file wm_draw.cc.
References ARegion::alignment, 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, ARegion::runtime, texture(), view, ARegion::winrct, 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().
|
static |
Definition at line 817 of file wm_draw.cc.
References GPU_offscreen_draw_to_screen(), GPU_viewport_draw_to_screen(), ARegion::runtime, view, ARegion::winrct, rcti::xmin, and rcti::ymin.
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 719 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(), RPT_ERROR, ARegion::runtime, ARegion::winx, ARegion::winy, wm_draw_offscreen_texture_parameters(), wm_draw_region_buffer_free(), and WM_global_report().
Referenced by wm_draw_area_offscreen(), wm_draw_region_test(), WM_draw_region_viewport_ensure(), and wm_draw_window_offscreen().
|
static |
Definition at line 678 of file wm_draw.cc.
References GPU_offscreen_free(), GPU_viewport_free(), MEM_freeN(), and ARegion::runtime.
Referenced by wm_draw_region_buffer_create(), and WM_draw_region_free().
Definition at line 1671 of file wm_draw.cc.
References bScreen::do_draw, and WM_window_get_active_screen().
Referenced by ui_region_temp_remove().
| void WM_draw_region_free | ( | ARegion * | region | ) |
Definition at line 1677 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 950 of file wm_draw.cc.
References ARegion::runtime.
Referenced by blender::ed::vse::draw_registered_callbacks(), drw_draw_render_loop_2d(), drw_draw_render_loop_3d(), DRW_draw_view(), blender::ed::vse::preview_draw_begin(), blender::ed::vse::preview_draw_color_render_begin(), blender::ed::vse::preview_draw_overlay_begin(), blender::ed::vse::sequencer_ibuf_get(), and blender::ed::vse::sequencer_preview_draw_empty().
| GPUViewport * WM_draw_region_get_viewport | ( | ARegion * | region | ) |
Definition at line 940 of file wm_draw.cc.
References ARegion::runtime.
Referenced by DRW_draw_select_id(), ED_view3d_depth_override(), gizmo_find_intersected_3d(), ViewportColorSampleSession::init(), blender::ed::space_node::node_draw_space(), blender::ed::vse::timeline_draw_context_get(), view3d_depths_create(), view3d_depths_rect_create(), and wm_region_test_render_do_draw().
|
static |
Definition at line 425 of file wm_draw.cc.
References Camera::bg_images, BKE_image_ensure_viewer(), View3D::camera, Object::data, 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(), ARegion::regiondata, ARegion::regiontype, RGN_TYPE_PREVIEW, RGN_TYPE_WINDOW, SNODE_BACKDRAW, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, Object::type, RenderEngine::type, and RegionView3D::view_render.
Referenced by wm_draw_area_offscreen().
Definition at line 1682 of file wm_draw.cc.
References C, CTX_wm_window(), ED_region_do_draw(), ARegion::runtime, 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().
| blender::gpu::Texture * wm_draw_region_texture | ( | ARegion * | region, |
| int | view ) |
Definition at line 843 of file wm_draw.cc.
References GPU_offscreen_color_texture(), GPU_viewport_color_texture(), ARegion::runtime, and view.
Referenced by wm_draw_region_blend().
|
static |
Definition at line 800 of file wm_draw.cc.
References GPU_offscreen_unbind(), GPU_scissor_test(), GPU_viewport_unbind(), and ARegion::runtime.
Referenced by wm_draw_area_offscreen(), 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 1726 of file wm_draw.cc.
References wm_draw_region_bind().
Referenced by ED_view3d_depth_override(), and ui_region_redraw_immediately().
Definition at line 1720 of file wm_draw.cc.
References ARegion::regiontype, 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 1731 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 1302 of file wm_draw.cc.
References wmSurface::blender_gpu_context, C, CTX_wm_manager(), wmSurface::draw, 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 1614 of file wm_draw.cc.
References BKE_image_free_unused_gpu_textures(), C, 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(), wm_window_swap_buffer_acquire(), and wm_window_swap_buffer_release().
Referenced by ghost_event_proc(), redraw_timer_step(), redraw_timer_window_swap(), WM_main(), and WM_redraw_windows().
Definition at line 1591 of file wm_draw.cc.
References C, bScreen::do_draw_drag, bScreen::do_draw_gesture, bScreen::do_draw_paintcursor, ED_screen_areas_iter, LISTBASE_FOREACH, ScrArea::regionbase, wm_region_test_gizmo_do_draw(), and WM_window_get_active_screen().
Referenced by wm_draw_update().
Definition at line 1513 of file wm_draw.cc.
References BKE_scene_ensure_depsgraph(), C, CTX_wm_manager(), depsgraph, bScreen::do_draw, bScreen::do_draw_drag, bScreen::do_draw_gesture, bScreen::do_draw_paintcursor, bScreen::do_refresh, ED_screen_areas_iter, g_software_cursor, LISTBASE_FOREACH, bScreen::regionbase, ScrArea::regionbase, ARegion::runtime, 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 1216 of file wm_draw.cc.
References C, Stereo3dFormat::display_mode, bScreen::do_draw, ELEM, get_hdr_framebuffer_format(), GPU_backbuffer_bind(), GPU_BACKBUFFER_LEFT, GPU_BACKBUFFER_RIGHT, 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, texture(), view, 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 1053 of file wm_draw.cc.
References C, CTX_wm_region_popup_set(), ED_region_do_draw(), ED_screen_areas_iter, ELEM, GPU_clear_color(), GPU_debug_group_begin(), GPU_debug_group_end(), LISTBASE_FOREACH, bScreen::regionbase, ARegion::runtime, SPACE_SPREADSHEET, SPACE_STATUSBAR, ScrArea::spacetype, ARegion::winrct, wm_draw_area_offscreen(), wm_draw_region_bind(), wm_draw_region_buffer_create(), wm_draw_region_unbind(), WM_window_get_active_scene(), WM_window_get_active_screen(), and wmViewport().
Referenced by wm_draw_window().
Definition at line 1101 of file wm_draw.cc.
References bScreen::active_region, C, CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region_set(), 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, ARegion::overlap, bScreen::regionbase, ScrArea::regionbase, ARegion::runtime, wmWindowManager::runtime, UI_SetTheme(), view, 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 1606 of file wm_draw.cc.
References bScreen::do_draw_paintcursor, and 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(), blender::ed::transform::viewRedrawForce(), and wm_paintcursor_tag().
Definition at line 107 of file wm_draw.cc.
References bScreen::active_region, BLI_rcti_size_x(), BLI_rcti_size_y(), C, CTX_wm_manager(), CTX_wm_window(), ELEM, wmWindow::eventstate, GPU_scissor(), GPU_scissor_test(), LISTBASE_FOREACH_MUTABLE, ARegion::regiontype, RGN_TYPE_ANY, ARegion::runtime, wmWindowManager::runtime, SPACE_TYPE_ANY, ScrArea::spacetype, wmEvent::tablet, wmTabletData::tilt, UI_SetTheme(), ARegion::winrct, WM_capabilities_flag(), WM_CAPABILITY_CURSOR_WARP, wm_cursor_position_get(), WM_window_get_active_screen(), wm_window_grab_warp_region_is_set(), rcti::xmin, wmEvent::xy, xy, and rcti::ymin.
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 (e.g. screen-shot & sample screen color) explicitly redrawing should be avoided, see: #92704, #93950, #97627 & #98462.
Definition at line 1695 of file wm_draw.cc.
References C, 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 409 of file wm_draw.cc.
References C, CTX_wm_window(), ARegion::regiontype, ARegion::runtime, ScrArea::spacetype, UI_SetTheme(), ARegion::winrct, wmViewport(), and wmWindowViewport().
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 491 of file wm_draw.cc.
References C, CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region(), CTX_wm_region_set(), ED_region_tag_redraw_editor_overlays(), LISTBASE_FOREACH, ARegion::runtime, 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 529 of file wm_draw.cc.
References depsgraph, ED_region_tag_redraw_no_rebuild(), ED_region_tag_redraw_partial(), ED_view3d_calc_render_border(), ListBase::first, RenderEngine::flag, GPU_viewport_do_update(), RE_ENGINE_DO_DRAW, RE_view_engine_get(), ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, RegionView3D::view_render, and WM_draw_region_get_viewport().
Referenced by wm_draw_update_test_window().
Definition at line 582 of file wm_draw.cc.
References ARegion::regiontype, ScrArea::spacetype, and wm_region_use_viewport_by_type().
Referenced by region_draw_azone_tab_arrow(), wm_draw_area_offscreen(), and wm_draw_region_test().
|
static |
Definition at line 575 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 370 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_dpi_get_scale(), WM_window_native_pixel_y(), GrabState::wrap_axis, and wmEvent::xy.
Referenced by wm_draw_window_onscreen().
|
static |
Definition at line 247 of file wm_draw.cc.
References GHOST_CursorBitmapRef::data, GHOST_CursorBitmapRef::data_size, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_DATA_UBYTE, GPU_matrix_mul, GPU_matrix_pop(), GPU_matrix_push(), GPU_PRIM_TRI_FAN, 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(), pos, round_fl_to_int(), texture(), unit_m4(), WM_capabilities_flag(), and WM_CAPABILITY_CURSOR_RGBA.
Referenced by wm_software_cursor_draw().
|
static |
Definition at line 323 of file wm_draw.cc.
References float, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformColor4f(), immVertexFormat(), max_ff(), pos, WM_CURSOR_DEFAULT_LOGICAL_SIZE, and WM_cursor_preferred_logical_size().
Referenced by wm_software_cursor_draw().
|
static |
Definition at line 233 of file wm_draw.cc.
References g_software_cursor.
Referenced by wm_software_cursor_motion_clear_with_window().
|
static |
Definition at line 240 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 218 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 225 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 191 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().
Definition at line 199 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 82 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 1484 of file wm_draw.cc.
References C, 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(), and blender::ed::asset::take_screenshot_crop().
| 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 1325 of file wm_draw.cc.
References GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), GPU_DATA_UBYTE, GPU_frontbuffer_read_color(), wmWindow::gpuctx, i, MEM_malloc_arrayN(), wmWindowManager::runtime, 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 1403 of file wm_draw.cc.
References C, 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_malloc_arrayN(), 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 1492 of file wm_draw.cc.
References C, 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 1371 of file wm_draw.cc.
References BLI_assert, copy_v3_v3(), GHOST_ActivateWindowDrawingContext(), wmWindow::ghostwin, GPU_context_active_set(), GPU_DATA_FLOAT, GPU_frontbuffer_read_color(), wmWindow::gpuctx, pos, wmWindowManager::runtime, WM_capabilities_flag(), WM_CAPABILITY_GPU_FRONT_BUFFER_READ, and blender::VecBase< T, Size >::xyz().
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 1448 of file wm_draw.cc.
References BLI_assert, C, copy_v3_v3(), GPU_DATA_FLOAT, GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_read_color_region(), GPU_offscreen_unbind(), 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 176 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 177 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 178 of file wm_draw.cc.
Referenced by actionzone_area_poll(), annotation_draw_eraser(), annotation_draw_stabilizer(), area_actionzone_refresh_xy(), area_event_inside(), area_move_init(), BKE_area_find_region_xy(), BKE_maskrasterize_handle_sample(), BKE_screen_area_map_find_area_xy(), BKE_screen_area_map_find_area_xy(), BKE_screen_find_area_xy(), BKE_screen_find_area_xy(), BKE_screen_find_main_region_at_xy(), BKE_screen_find_main_region_at_xy(), BKE_screen_find_region_xy(), BKE_screen_find_region_xy(), BLI_rctf_clamp_pt_v(), BLI_rctf_clamp_pt_v(), BLI_rctf_do_minmax_v(), BLI_rctf_init_pt_radius(), BLI_rctf_isect_circle(), BLI_rctf_isect_circle(), BLI_rctf_isect_pt_v(), BLI_rctf_isect_pt_v(), BLI_rcti_clamp_pt_v(), BLI_rcti_clamp_pt_v(), BLI_rcti_do_minmax_v(), BLI_rcti_init_pt_radius(), BLI_rcti_is_valid(), BLI_rcti_isect_circle(), BLI_rcti_isect_circle(), BLI_rcti_isect_pt_v(), BLI_rcti_isect_pt_v(), brush_drawcursor(), btMatrix3x3(), blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction::call(), cb_wm_cursor_draw(), blender::ed::vse::check_circle_intersection_in_timeline(), blender::ed::outliner::collection_drop_init(), blender::ed::outliner::collection_drop_tooltip(), CreateMatrix(), data_device_handle_drop(), blender::ed::vse::draw_strip_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_pose_deselect_all_multi_ex(), ED_screen_set_active_region(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute_cpu_anisotropic(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute_single(), eyedropper_draw_cursor_text_region(), blender::ui::AbstractTreeView::find_hovered(), blender::ed::transform::flushTransNodes(), blender::ed::greasepencil::generate_corner(), GHOST_SystemWayland::getAllDisplayDimensions(), blender::ed::sculpt_paint::image::ops::paint::gradient_draw_line(), 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::ed::sculpt_paint::paint_cursor_context_init(), blender::ed::sculpt_paint::paint_draw_cursor(), blender::ed::sculpt_paint::paint_draw_line_cursor(), blender::ed::sculpt_paint::paint_draw_smooth_cursor(), 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(), blender::ed::vse::sequencer_drop_copy(), KDL::Rotation2::SetRot(), setRotation(), setValue(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::eevee::IrradianceBake::surfels_create(), textview_draw(), textview_draw_sel(), blender::ed::transform::transform_draw_cursor_draw(), ui_block_bounds_calc_centered_pie(), ui_block_bounds_calc_popup(), ui_block_bounds_calc_post_centered(), UI_block_end_ex(), ui_block_find_mouse_over_ex(), ui_block_find_mouse_over_ex(), ui_but_contains_point_px(), ui_but_contains_point_px(), ui_but_find_mouse_over_ex(), ui_but_find_mouse_over_ex(), ui_drag_toggle_set(), ui_list_find_mouse_over_ex(), ui_list_find_mouse_over_ex(), ui_list_row_find_mouse_over(), 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_contains_point_px(), UI_region_view_find_at(), UI_region_views_find_item_at(), ui_screen_region_find_mouse_over_ex(), ui_screen_region_find_mouse_over_ex(), ui_searchbox_inside(), ui_searchbox_inside(), UI_view2d_edge_pan_apply(), UI_view2d_edge_pan_apply(), UI_view2d_mouse_in_scrollers(), UI_view2d_mouse_in_scrollers(), UI_view2d_mouse_in_scrollers_ex(), UI_view2d_mouse_in_scrollers_ex(), ui_view_drop_tooltip(), ui_view_item_find_mouse_over(), ui_view_item_find_mouse_over(), v3d_cursor_snap_draw_fn(), blender::ed::transform::view2d_edge_pan_loc_compensate(), view3d_geometry_nodes_drop_tooltip(), view3d_gpu_select_ex(), view3d_mat_drop_tooltip(), 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(), wm_window_update_eventstate(), and blender::ui::AbstractTreeView::~AbstractTreeView().