1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 API to allow provide synchronisation of the display of images with the
25 displays refresh to prevent tearing.
27 This is an abstract base class, so must be derived from on a per-variant basis.
31 class CDirectScreenBitmap : public CBase
38 EIncrementalUpdate = 2
43 Constructs a CDirectScreenBitmap derived object.
44 The default screen (with number 0) will be used.
45 @return A pointer to the created CDirectScreenBitmap object
46 @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
48 IMPORT_C static CDirectScreenBitmap* NewL();
51 Constructs a CDirectScreenBitmap derived object.
52 @param aScreenNo Screen number, used by the CDirectScreenBitmap object.
53 @return A pointer to the created CDirectScreenBitmap object
54 @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
56 IMPORT_C static CDirectScreenBitmap* NewL(TInt aScreenNo);
59 Creates a CDirectScreenBitmap object which can be used for drawing to
60 a region of the screen indicated by aScreenRect. This region must have
61 previously been 'claimed' via the Window Servers Direct Screen Access API.
63 @param aScreenRect The region to be displayed
64 @param aSettingsFlags The mode of operation. The upper 3 bits are used
65 for the screen number value: 0..7. By default the screen
66 with number 0 will be used.
67 @return KErrNone if successful
68 KErrNoMemory if there was insufficient memory
69 KErrNotSupported if the creation failed for other reasons
71 virtual TInt Create(const TRect& aScreenRect, TSettingsFlags aSettingsFlags) =0;
74 Returns a TAcceleratedBitmapInfo referring to a bitmap which the
75 applicationcan render to.
77 @param aBitmapInfo The Bitmap
78 @return KErrNone if successful, another error code otherwise
80 virtual TInt BeginUpdate(TAcceleratedBitmapInfo& aBitmapInfo) =0;
83 Indicates to the Video Driver that the bitmap corresponding to the
84 update has been fully rendered. The video driver will perform
85 the actions required to copy this to the frame buffer.
87 The request status aComplete will be signalled when the copying has completed.
89 @param aComplete Asynchronous completion status
91 virtual void EndUpdate(TRequestStatus& aComplete) =0;
94 Indicates to the Video Driver that the area indicated in aScreenRect has
95 been fully rendered. The video driver will perform the actions required
96 to copy this to the frame buffer.
98 The request status aComplete will be signalled when the copying has completed.
100 Note: aScreenRects coordinates are relative to the screen, not the update region specified
101 in Create(). aScreenRect must fit entirely within the bounds of the original region passed
104 @param aScreenRect The region to update
105 @param aComplete Asynchronous completion status
107 virtual void EndUpdate(const TRect& aScreenRect, TRequestStatus& aComplete) =0;
110 Deletes all resources associated with the CDirectScreenBitmap object.
112 virtual void Close() =0;