diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c index a107a99bb..cb7b6b313 100644 --- a/src/backends/native/meta-onscreen-native.c +++ b/src/backends/native/meta-onscreen-native.c @@ -1386,6 +1386,18 @@ add_onscreen_frame_info (MetaCrtc *crtc) CLUTTER_STAGE_VIEW (view)); } +void +meta_onscreen_native_prepare_frame (CoglOnscreen *onscreen, + ClutterFrame *frame) +{ + MetaOnscreenNative *onscreen_native = META_ONSCREEN_NATIVE (onscreen); + MetaCrtcKms *crtc_kms = META_CRTC_KMS (onscreen_native->crtc); + MetaKmsCrtc *kms_crtc = meta_crtc_kms_get_kms_crtc (crtc_kms); + MetaKmsDevice *kms_device = meta_kms_crtc_get_device (kms_crtc); + + meta_crtc_kms_maybe_set_gamma (crtc_kms, kms_device); +} + void meta_onscreen_native_finish_frame (CoglOnscreen *onscreen, ClutterFrame *frame) diff --git a/src/backends/native/meta-onscreen-native.h b/src/backends/native/meta-onscreen-native.h index 8ea7ec254..377b7e22b 100644 --- a/src/backends/native/meta-onscreen-native.h +++ b/src/backends/native/meta-onscreen-native.h @@ -37,6 +37,9 @@ G_DECLARE_FINAL_TYPE (MetaOnscreenNative, meta_onscreen_native, void meta_renderer_native_release_onscreen (CoglOnscreen *onscreen); +void meta_onscreen_native_prepare_frame (CoglOnscreen *onscreen, + ClutterFrame *frame); + void meta_onscreen_native_finish_frame (CoglOnscreen *onscreen, ClutterFrame *frame); diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 6011b7e97..dcd4f3ac2 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -1461,24 +1461,20 @@ meta_renderer_native_prepare_frame (MetaRendererNative *renderer_native, MetaBackend *backend = meta_renderer_get_backend (renderer); MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); - MetaCrtc *crtc = meta_renderer_view_get_crtc (view); + CoglFramebuffer *framebuffer = + clutter_stage_view_get_onscreen (CLUTTER_STAGE_VIEW (view)); MetaPowerSave power_save_mode; - MetaCrtcKms *crtc_kms; - MetaKmsCrtc *kms_crtc; - MetaKmsDevice *kms_device; - - if (!META_IS_CRTC_KMS (crtc)) - return; power_save_mode = meta_monitor_manager_get_power_save_mode (monitor_manager); if (power_save_mode != META_POWER_SAVE_ON) return; - crtc_kms = META_CRTC_KMS (crtc); - kms_crtc = meta_crtc_kms_get_kms_crtc (META_CRTC_KMS (crtc)); - kms_device = meta_kms_crtc_get_device (kms_crtc); + if (COGL_IS_ONSCREEN (framebuffer)) + { + CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer); - meta_crtc_kms_maybe_set_gamma (crtc_kms, kms_device); + meta_onscreen_native_prepare_frame (onscreen, frame); + } } void