graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp
changeset 188 1b081cb0800b
parent 0 5d03bc08d59c
child 136 62bb7c97884c
equal deleted inserted replaced
187:9f66f99ee56f 188:1b081cb0800b
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
  2123 TInt CTDefect2::CreateScrDevAndContext(TInt aScreenNo, TDisplayMode aDisplayMode)
  2123 TInt CTDefect2::CreateScrDevAndContext(TInt aScreenNo, TDisplayMode aDisplayMode)
  2124 	{
  2124 	{
  2125 	DeleteGraphicsContext();
  2125 	DeleteGraphicsContext();
  2126 	DeleteScreenDevice();
  2126 	DeleteScreenDevice();
  2127 	TRAPD(err, iScrDev = CFbsScreenDevice::NewL(aScreenNo, aDisplayMode));
  2127 	TRAPD(err, iScrDev = CFbsScreenDevice::NewL(aScreenNo, aDisplayMode));
  2128 	if(err == KErrNotSupported)
  2128 	if ( !iScrDev )
  2129 		{
  2129 		{
       
  2130 		TESTE( err == KErrNotSupported, err );
  2130 		return err;
  2131 		return err;
  2131 		}
  2132 		}
  2132 	TEST(err == KErrNone);
  2133 	TEST(err == KErrNone);
  2133 	TEST(iScrDev->ScreenNo() == aScreenNo);
  2134 	TEST(iScrDev->ScreenNo() == aScreenNo);
  2134 	err = iScrDev->CreateContext((CGraphicsContext*&)iGc);
  2135 	err = iScrDev->CreateContext((CGraphicsContext*&)iGc);
       
  2136 	if ( !iGc )
       
  2137 		{
       
  2138 		return err;
       
  2139 		}
  2135 	TEST(err == KErrNone);
  2140 	TEST(err == KErrNone);
  2136 	iGc->SetUserDisplayMode(aDisplayMode);
  2141 	iGc->SetUserDisplayMode(aDisplayMode);
  2137 	iScrDev->ChangeScreenDevice(NULL);
  2142 	iScrDev->ChangeScreenDevice(NULL);
  2138 	iScrDev->SetAutoUpdate(EFalse);
  2143 	iScrDev->SetAutoUpdate(EFalse);
  2139 	iSize = iScrDev->SizeInPixels();
  2144 	iSize = iScrDev->SizeInPixels();