|
1 /* |
|
2 * Copyright (c) 2006 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 "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Handles the viewing of a single frame. If the page is not frame |
|
15 * enabled, this class is used as the single view. If frame |
|
16 * enabled, there is one instance of this class for each frame. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #include "WebSurface.h" |
|
22 #include <bitdev.h> |
|
23 #include <fbs.h> |
|
24 |
|
25 WebSurface* WebSurface::NewL(TDisplayMode mode) |
|
26 { |
|
27 WebSurface* self = new (ELeave) WebSurface(mode); |
|
28 CleanupStack::PushL( self ); |
|
29 self->ConstructL(); |
|
30 CleanupStack::Pop( self ); |
|
31 return self; |
|
32 } |
|
33 |
|
34 WebSurface::~WebSurface() |
|
35 { |
|
36 delete m_offscreenbitmap; |
|
37 } |
|
38 |
|
39 WebSurface::WebSurface(TDisplayMode mode) : m_displaymode( mode ) |
|
40 { |
|
41 // do nothing |
|
42 } |
|
43 |
|
44 void WebSurface::ConstructL() |
|
45 { |
|
46 // Create a bitmap to be used offscreen |
|
47 m_offscreenbitmap = new (ELeave) CFbsBitmap(); |
|
48 User::LeaveIfError( m_offscreenbitmap->Create( TSize(0,0), m_displaymode) ); |
|
49 } |
|
50 |
|
51 void WebSurface::flip( const TPoint& pt, CBitmapContext& gc ) const |
|
52 { |
|
53 // put offscreen bitmap onto the screen |
|
54 gc.BitBlt( pt, m_offscreenbitmap ); |
|
55 } |