22 to a window and then add a red diagonal line below it (A in following |
22 to a window and then add a red diagonal line below it (A in following |
23 diagram). When this is performed as redraw drawing, the application |
23 diagram). When this is performed as redraw drawing, the application |
24 calculates the bounding rectangles of the "Hello!" text and the red |
24 calculates the bounding rectangles of the "Hello!" text and the red |
25 line (B). For each one, the application passes the rectangle to <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-F5E85A7B-0DAE-32C1-AF71-8FC2F5F01509"><apiname>RWindow::BeginRedraw(const TRect &)</apiname></xref>, then calls the |
25 line (B). For each one, the application passes the rectangle to <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-F5E85A7B-0DAE-32C1-AF71-8FC2F5F01509"><apiname>RWindow::BeginRedraw(const TRect &)</apiname></xref>, then calls the |
26 draw commands and afterwards calls <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-3DE16607-AD3B-3946-BEB3-88512EAAB9CE"><apiname>RWindow::EndRedraw()</apiname></xref>. </p> <fig id="GUID-53B962F7-D425-5D72-8148-F822A3462243"> |
26 draw commands and afterwards calls <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79/GUID-3DE16607-AD3B-3946-BEB3-88512EAAB9CE"><apiname>RWindow::EndRedraw()</apiname></xref>. </p> <fig id="GUID-53B962F7-D425-5D72-8148-F822A3462243"> |
27 <image href="GUID-1DDFFB60-BBA8-500E-A9B1-F048EE5BFBD0_d0e189660_href.png" placement="inline"/> |
27 <image href="GUID-1DDFFB60-BBA8-500E-A9B1-F048EE5BFBD0_d0e194631_href.png" placement="inline"/> |
28 </fig> <p>This has the advantage that the Window Server knows that |
28 </fig> <p>This has the advantage that the Window Server knows that |
29 the area of the window that has the "Hello!" text is not affected |
29 the area of the window that has the "Hello!" text is not affected |
30 by the drawing of the red line. There are also advantages when some |
30 by the drawing of the red line. There are also advantages when some |
31 or all of the window needs to be repainted. For example, suppose another |
31 or all of the window needs to be repainted. For example, suppose another |
32 window (such as an OK dialog box) appears above the window (as shown |
32 window (such as an OK dialog box) appears above the window (as shown |
39 line without bracketing it within <codeph>BeginRedraw()</codeph> and <codeph>EndRedraw()</codeph> calls. This is called <b>non-redraw drawing</b>. In ScreenPlay, each non-redraw drawing operation triggers the Window |
39 line without bracketing it within <codeph>BeginRedraw()</codeph> and <codeph>EndRedraw()</codeph> calls. This is called <b>non-redraw drawing</b>. In ScreenPlay, each non-redraw drawing operation triggers the Window |
40 Server to invalidate the entire window. This means that the client |
40 Server to invalidate the entire window. This means that the client |
41 application must then perform a full window redraw, as shown in the |
41 application must then perform a full window redraw, as shown in the |
42 next diagram. </p> <fig id="GUID-A36DF80C-6B53-5D9D-878B-0854BB36E44A"> |
42 next diagram. </p> <fig id="GUID-A36DF80C-6B53-5D9D-878B-0854BB36E44A"> |
43 <title> Non-redraw drawing sequence </title> |
43 <title> Non-redraw drawing sequence </title> |
44 <image href="GUID-7C51BC7A-CB97-5A7E-A5EF-BB3623DFFFED_d0e189683_href.png" placement="inline"/> |
44 <image href="GUID-7C51BC7A-CB97-5A7E-A5EF-BB3623DFFFED_d0e194654_href.png" placement="inline"/> |
45 </fig> <p>This is less efficient than the Window Server replaying |
45 </fig> <p>This is less efficient than the Window Server replaying |
46 the draw operations for the affected area. </p> <p>Symbian recommends |
46 the draw operations for the affected area. </p> <p>Symbian recommends |
47 that all drawing is now performed as redraw drawing. Typically this |
47 that all drawing is now performed as redraw drawing. Typically this |
48 involves dividing the window up into rectangular areas that represent |
48 involves dividing the window up into rectangular areas that represent |
49 different aspects of the user interface—for example, as shown in the |
49 different aspects of the user interface—for example, as shown in the |
50 following diagram. If anything spoils the screen, the Window Server |
50 following diagram. If anything spoils the screen, the Window Server |
51 then only needs to redraw the corresponding portions of the user interface. </p> <fig id="GUID-BAD0C762-0EBD-51E2-BC64-DF38749CA7D8"> |
51 then only needs to redraw the corresponding portions of the user interface. </p> <fig id="GUID-BAD0C762-0EBD-51E2-BC64-DF38749CA7D8"> |
52 <image href="GUID-F2E8CB4B-C1BB-577D-B018-7FF231B70D8C_d0e189694_href.png" placement="inline"/> |
52 <image href="GUID-F2E8CB4B-C1BB-577D-B018-7FF231B70D8C_d0e194665_href.png" placement="inline"/> |
53 </fig> <p>In earlier versions of Symbian, before the introduction |
53 </fig> <p>In earlier versions of Symbian, before the introduction |
54 of the <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita#GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160/GUID-250ED45A-76F3-3623-BA4B-22D31613A2EF"><apiname>CCoeControl::DrawNow(const TRect &)const</apiname></xref> overload, developers sometimes used non-redraw drawing to update |
54 of the <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita#GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160/GUID-250ED45A-76F3-3623-BA4B-22D31613A2EF"><apiname>CCoeControl::DrawNow(const TRect &)const</apiname></xref> overload, developers sometimes used non-redraw drawing to update |
55 a small part of a control. This technique has often been used for |
55 a small part of a control. This technique has often been used for |
56 virtual keyboards and calendar controls. This type of use case is |
56 virtual keyboards and calendar controls. This type of use case is |
57 now particularly unsuited to non-redraw drawing because in ScreenPlay |
57 now particularly unsuited to non-redraw drawing because in ScreenPlay |