app_server: Update overlay hooks after mode change.

* They are supposed to be depending on the current mode.
* This should help with #12613.
This commit is contained in:
Axel Dörfler 2016-01-28 19:51:23 +01:00
parent 82fbf1b3b6
commit 3d2853b218
2 changed files with 38 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
* Copyright 2001-2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -133,6 +133,17 @@ AccelerantHWInterface::AccelerantHWInterface()
fAccDPMSMode(NULL),
fAccSetDPMSMode(NULL),
// overlay hooks
fAccOverlayCount(NULL),
fAccOverlaySupportedSpaces(NULL),
fAccOverlaySupportedFeatures(NULL),
fAccAllocateOverlayBuffer(NULL),
fAccReleaseOverlayBuffer(NULL),
fAccGetOverlayConstraints(NULL),
fAccAllocateOverlay(NULL),
fAccReleaseOverlay(NULL),
fAccConfigureOverlay(NULL),
fModeCount(0),
fModeList(NULL),
@ -390,6 +401,27 @@ AccelerantHWInterface::_SetupDefaultHooks()
fAccDPMSMode = (dpms_mode)fAccelerantHook(B_DPMS_MODE, NULL);
fAccSetDPMSMode = (set_dpms_mode)fAccelerantHook(B_SET_DPMS_MODE, NULL);
return B_OK;
}
void
AccelerantHWInterface::_UpdateHooksAfterModeChange()
{
// update acceleration hooks
#if USE_ACCELERATION
fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE,
(void *)&fDisplayMode);
fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE,
(void *)&fDisplayMode);
fAccScreenBlit = (screen_to_screen_blit)fAccelerantHook(
B_SCREEN_TO_SCREEN_BLIT, (void *)&fDisplayMode);
#else
fAccFillRect = NULL;
fAccInvertRect = NULL;
fAccScreenBlit = NULL;
#endif
// overlay
fAccOverlayCount = (overlay_count)fAccelerantHook(B_OVERLAY_COUNT, NULL);
fAccOverlaySupportedSpaces = (overlay_supported_spaces)fAccelerantHook(
@ -408,8 +440,6 @@ AccelerantHWInterface::_SetupDefaultHooks()
= (release_overlay)fAccelerantHook(B_RELEASE_OVERLAY, NULL);
fAccConfigureOverlay
= (configure_overlay)fAccelerantHook(B_CONFIGURE_OVERLAY, NULL);
return B_OK;
}
@ -637,19 +667,7 @@ AccelerantHWInterface::SetMode(const display_mode& mode)
depth, fFrameBufferConfig.bytes_per_row);
#endif
// update acceleration hooks
#if USE_ACCELERATION
fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE,
(void *)&fDisplayMode);
fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE,
(void *)&fDisplayMode);
fAccScreenBlit = (screen_to_screen_blit)fAccelerantHook(
B_SCREEN_TO_SCREEN_BLIT, (void *)&fDisplayMode);
#else
fAccFillRect = NULL;
fAccInvertRect = NULL;
fAccScreenBlit = NULL;
#endif
_UpdateHooksAfterModeChange();
// in case there is no accelerated blit function, using
// an offscreen located backbuffer will not be beneficial!

View File

@ -1,10 +1,11 @@
/*
* Copyright 2005-2012, Haiku.
* Copyright 2005-2016, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Lotz <mmlr@mlotz.ch>
* Stephan Aßmus <superstippi@gmx.de>
* Axel Dörfler, axeld@pinc-software.de
* Michael Lotz <mmlr@mlotz.ch>
*/
#ifndef ACCELERANT_HW_INTERFACE_H
#define ACCELERANT_HW_INTERFACE_H
@ -104,6 +105,7 @@ private:
int _OpenGraphicsDevice(int deviceNumber);
status_t _OpenAccelerant(int device);
status_t _SetupDefaultHooks();
void _UpdateHooksAfterModeChange();
status_t _UpdateModeList();
status_t _UpdateFrameBufferConfig();
void _RegionToRectParams(/*const*/ BRegion* region,