From 50e6fe264b8d84cd40ea2b682a8c9ed2ee3dc7ae Mon Sep 17 00:00:00 2001 From: Yotam Barnoy Date: Thu, 18 Nov 2010 11:32:53 +0000 Subject: PSP: reduced fragmentation by allocating overlay just once svn-id: r54316 --- backends/platform/psp/display_manager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backends/platform/psp/display_manager.cpp') diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 6d2c92c474..63bfe8bd24 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -283,13 +283,17 @@ void DisplayManager::init() { _masterGuRenderer.setupCallbackThread(); #endif + // Init overlay since we never change the size + _overlay->deallocate(); + _overlay->setBytesPerPixel(sizeof(OverlayColor)); + _overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); + _overlay->allocate(); } void DisplayManager::setSizeAndPixelFormat(uint width, uint height, const Graphics::PixelFormat *format) { DEBUG_ENTER_FUNC(); PSP_DEBUG_PRINT("w[%u], h[%u], pformat[%p]\n", width, height, format); - _overlay->deallocate(); _screen->deallocate(); _screen->setScummvmPixelFormat(format); @@ -298,10 +302,6 @@ void DisplayManager::setSizeAndPixelFormat(uint width, uint height, const Graphi _cursor->setScreenPaletteScummvmPixelFormat(format); - _overlay->setBytesPerPixel(sizeof(OverlayColor)); - _overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); - _overlay->allocate(); - _displayParams.screenSource.width = width; _displayParams.screenSource.height = height; calculateScaleParams(); -- cgit v1.2.3