|
1 // |
|
2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the License "Symbian Foundation License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 |
|
17 PRINT Run Bitmap smoketest |
|
18 |
|
19 LOAD_SUITE T_GraphicsWservAPI |
|
20 |
|
21 START_TESTCASE SMOKE_BITMAP_0001 |
|
22 //! @SYMTestCaseID SMOKE_BITMAP_0001 |
|
23 //! @SYMTestCaseDesc BitBlt(const TPoint &aPos, const CFbsBitmap *aBitmap): perform a bitmap block transfer |
|
24 //! Uses API elements: RWsSession::Connect & SetAutoFlush, CWsScreenDevice::Construct & GetPixel, RWindowGroup::Construct, RWindow::Construct & BeginRedraw & EndRedraw, |
|
25 //! CWindowGc::Construct & Activate & Deactivate & SetBrushColor & SetBrushStyle, CFbsBitmap::Load & SetSizeInTwips |
|
26 //! @SYMTestActions 1. Setup a CWindowGc to test and a RWindow to display its drawing result |
|
27 //! 1.1 New and connect a RWsSession |
|
28 //! 1.2 New and construct a CWsScreenDevice within the RWsSession |
|
29 //! 1.3 Create a CWindowGc within the CWsScreenDevice (use CreateContext) |
|
30 //! 1.4 New and construct a RWindowGroup within the RWsSession |
|
31 //! 1.5 New and construct a RWindow as the child of the RWindowGroup |
|
32 //! and SetRequiredDisplayMode (to EColor4K) for the RWindow, SetBackgroundColor to TRgb(255,255,255) |
|
33 //! 1.6 SetAutoFlush to TRUE for the RWsSession |
|
34 //! 1.7 Activate the CWindowGc to the RWindow |
|
35 //! and SetBrushColor to TRgb(255,0,0) and SetBrushStyle to ESolidBrush |
|
36 //! . New and Load a CFbsBitmap |
|
37 //! 3. Use RWindow::BeginRedraw() to start a redraw cycle |
|
38 //! 4. Execute BitBlt to perform a bitmap block transfer to the specified point (10,11) |
|
39 //! 5. RWindow::EndRedraw() to end the redraw cycle and display the drawing result |
|
40 //! 6. Deactive RWindow, destruct and close all objects used |
|
41 START_TEST_BLOCK 10 T_GraphicsWservAPI c:\smoketest\smoketest_bitmap.ini |
|
42 CREATE_OBJECT RWsSession ws |
|
43 CREATE_OBJECT CWsScreenDevice scrdev |
|
44 CREATE_OBJECT CWindowGc wingc |
|
45 CREATE_OBJECT RWindowGroup wingrp |
|
46 CREATE_OBJECT RWindow win |
|
47 COMMAND ws new |
|
48 COMMAND ws Connect |
|
49 COMMAND scrdev new GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command004 |
|
50 COMMAND scrdev Construct GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command005 |
|
51 COMMAND scrdev CreateContext GRAPHICS-WSERV-WindowGc-Setup-0002-0001-CreateContext_command006 |
|
52 COMMAND wingrp new GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command008 |
|
53 COMMAND wingrp Construct GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command009 |
|
54 COMMAND win new GRAPHICS-WSERV-WindowGc-Setup-0002-0001-new_command011 |
|
55 COMMAND win Construct GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Construct_command012 |
|
56 COMMAND win SetRequiredDisplayMode GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetRequiredDisplayMode_command013 |
|
57 COMMAND win SetBackgroundColor GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBackgroundColor_command014 |
|
58 COMMAND win Activate |
|
59 COMMAND ws SetAutoFlush GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetAutoFlush_command017 |
|
60 COMMAND wingc Activate GRAPHICS-WSERV-WindowGc-Setup-0002-0001-Activate_command019 |
|
61 COMMAND wingc SetBrushColor GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBrushColor_command020 |
|
62 COMMAND wingc SetBrushStyle GRAPHICS-WSERV-WindowGc-Setup-0002-0001-SetBrushStyle_command021 |
|
63 |
|
64 CREATE_OBJECT CFbsBitmap fbsbmp |
|
65 COMMAND fbsbmp new |
|
66 COMMAND fbsbmp Load GRAPHICS-WSERV-WindowGc-PublicApi-0051-0001-Load_command002 |
|
67 COMMAND fbsbmp SizeInTwips |
|
68 COMMAND fbsbmp SizeInPixels |
|
69 COMMAND fbsbmp DisplayMode |
|
70 COMMAND win BeginRedraw |
|
71 COMMAND wingc BitBlt GRAPHICS-WSERV-WindowGc-PublicApi-0051-0001-BitBlt_command009 |
|
72 COMMAND win EndRedraw |
|
73 COMMAND win Save |
|
74 COMMAND fbsbmp ~ |
|
75 |
|
76 COMMAND wingc Deactivate |
|
77 COMMAND win Close |
|
78 COMMAND wingrp Close |
|
79 COMMAND wingc ~ |
|
80 COMMAND scrdev ~ |
|
81 COMMAND ws Close |
|
82 END_TEST_BLOCK |
|
83 END_TESTCASE SMOKE_BITMAP_0001 |