|
1 // Copyright (c) 2003-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "GraphicsAccelerator.h" |
|
17 |
|
18 LOCAL_D const TGraphicsAcceleratorCaps HardwareAcceleratorCapabilities = |
|
19 { |
|
20 sizeof(TGraphicsAcceleratorCaps), //TInt iStructureSize; // The size of this class |
|
21 1, //TInt iVersion; // == 1 to specify current API |
|
22 {0} //Tint iVendorUid; // Optional ID |
|
23 // Default values of zero... |
|
24 }; |
|
25 |
|
26 EXPORT_C CHardwareGraphicsAccelerator* CHardwareGraphicsAccelerator::NewL(RHardwareBitmap /*aBitmap*/) |
|
27 /** |
|
28 Allocates and constructs an instance of a derived class and initialises its |
|
29 capabilities. |
|
30 |
|
31 @param aBitmap The hardware bitmap for the accelerator to draw to. |
|
32 @return Pointer to the initialised graphics accelerator object. |
|
33 @see TGraphicsAcceleratorCaps::iDisplayModes |
|
34 @leave KErrNoMemory There is no memory to allocate the graphics accelerator |
|
35 KErrNotSupported There is no graphics accelerator supporting the display mode given by the bitmap parameter |
|
36 */ |
|
37 { |
|
38 User::Leave(KErrNotSupported) ; |
|
39 return NULL ; |
|
40 } |
|
41 |
|
42 EXPORT_C const TGraphicsAcceleratorCaps* CHardwareGraphicsAccelerator::GenericCapabilities() |
|
43 /** |
|
44 Gets the generic capabilities of the accelerator, including which display modes |
|
45 are supported for the bitmap passed to NewL(). |
|
46 |
|
47 Generic capabilities apply to all hardware graphics accelerators on the device. |
|
48 The function is static, so it can be used to find out the capabilities of |
|
49 graphics accelerators before deciding on whether or not to create one. |
|
50 |
|
51 The CGraphicsAccelerator::Capabilities() function provides information about |
|
52 the capabilities of a particular graphics accelerator. |
|
53 |
|
54 As capabilities may vary depending on the display mode of a bitmap, this method |
|
55 should indicate as supported any features which are only available in some |
|
56 display modes. |
|
57 |
|
58 @return Generic capabilities for hardware graphics accelerators. |
|
59 */ |
|
60 { |
|
61 return &HardwareAcceleratorCapabilities ; |
|
62 } |
|
63 |