mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
renderer/x11/nested: Remove dead view transform handling
With the (nested) X11 we always "handle" view transforms, so lets remove the code that handles when we don't. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3428>
This commit is contained in:
parent
74ce9592b5
commit
4c0f3ea80f
@ -42,34 +42,6 @@ struct _MetaRendererX11Nested
|
|||||||
G_DEFINE_TYPE (MetaRendererX11Nested, meta_renderer_x11_nested,
|
G_DEFINE_TYPE (MetaRendererX11Nested, meta_renderer_x11_nested,
|
||||||
META_TYPE_RENDERER_X11)
|
META_TYPE_RENDERER_X11)
|
||||||
|
|
||||||
static MetaMonitorTransform
|
|
||||||
calculate_view_transform (MetaMonitorManager *monitor_manager,
|
|
||||||
MetaLogicalMonitor *logical_monitor)
|
|
||||||
{
|
|
||||||
MetaMonitor *main_monitor;
|
|
||||||
MetaOutput *main_output;
|
|
||||||
MetaCrtc *crtc;
|
|
||||||
MetaMonitorTransform crtc_transform;
|
|
||||||
|
|
||||||
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
|
|
||||||
main_output = meta_monitor_get_main_output (main_monitor);
|
|
||||||
crtc = meta_output_get_assigned_crtc (main_output);
|
|
||||||
crtc_transform =
|
|
||||||
meta_monitor_logical_to_crtc_transform (main_monitor,
|
|
||||||
logical_monitor->transform);
|
|
||||||
/*
|
|
||||||
* Pick any monitor and output and check; all CRTCs of a logical monitor will
|
|
||||||
* always have the same transform assigned to them.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (meta_monitor_manager_is_transform_handled (monitor_manager,
|
|
||||||
crtc,
|
|
||||||
crtc_transform))
|
|
||||||
return META_MONITOR_TRANSFORM_NORMAL;
|
|
||||||
else
|
|
||||||
return crtc_transform;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CoglOffscreen *
|
static CoglOffscreen *
|
||||||
create_offscreen (CoglContext *cogl_context,
|
create_offscreen (CoglContext *cogl_context,
|
||||||
int width,
|
int width,
|
||||||
@ -95,22 +67,16 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
|||||||
MetaCrtc *crtc)
|
MetaCrtc *crtc)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_renderer_get_backend (renderer);
|
MetaBackend *backend = meta_renderer_get_backend (renderer);
|
||||||
MetaMonitorManager *monitor_manager =
|
|
||||||
meta_backend_get_monitor_manager (backend);
|
|
||||||
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
|
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
|
||||||
CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||||
MetaMonitorTransform view_transform;
|
|
||||||
float view_scale;
|
float view_scale;
|
||||||
const MetaCrtcConfig *crtc_config;
|
const MetaCrtcConfig *crtc_config;
|
||||||
int width, height;
|
int width, height;
|
||||||
CoglOffscreen *fake_onscreen;
|
CoglOffscreen *fake_onscreen;
|
||||||
CoglOffscreen *offscreen;
|
|
||||||
MtkRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
const MetaCrtcModeInfo *mode_info;
|
const MetaCrtcModeInfo *mode_info;
|
||||||
MetaRendererView *view;
|
MetaRendererView *view;
|
||||||
|
|
||||||
view_transform = calculate_view_transform (monitor_manager, logical_monitor);
|
|
||||||
|
|
||||||
if (meta_backend_is_stage_views_scaled (backend))
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
view_scale = logical_monitor->scale;
|
view_scale = logical_monitor->scale;
|
||||||
else
|
else
|
||||||
@ -122,11 +88,6 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
|||||||
|
|
||||||
fake_onscreen = create_offscreen (cogl_context, width, height);
|
fake_onscreen = create_offscreen (cogl_context, width, height);
|
||||||
|
|
||||||
if (view_transform != META_MONITOR_TRANSFORM_NORMAL)
|
|
||||||
offscreen = create_offscreen (cogl_context, width, height);
|
|
||||||
else
|
|
||||||
offscreen = NULL;
|
|
||||||
|
|
||||||
mtk_rectangle_from_graphene_rect (&crtc_config->layout,
|
mtk_rectangle_from_graphene_rect (&crtc_config->layout,
|
||||||
MTK_ROUNDING_STRATEGY_ROUND,
|
MTK_ROUNDING_STRATEGY_ROUND,
|
||||||
&view_layout);
|
&view_layout);
|
||||||
@ -140,8 +101,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
|||||||
"crtc", crtc,
|
"crtc", crtc,
|
||||||
"refresh-rate", mode_info->refresh_rate,
|
"refresh-rate", mode_info->refresh_rate,
|
||||||
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
|
"framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
|
||||||
"offscreen", COGL_FRAMEBUFFER (offscreen),
|
"transform", META_MONITOR_TRANSFORM_NORMAL,
|
||||||
"transform", view_transform,
|
|
||||||
"scale", view_scale,
|
"scale", view_scale,
|
||||||
NULL);
|
NULL);
|
||||||
g_object_set_data (G_OBJECT (view), "crtc", crtc);
|
g_object_set_data (G_OBJECT (view), "crtc", crtc);
|
||||||
|
Loading…
Reference in New Issue
Block a user