os/graphics/graphicsdeviceinterface/directgdiadaptation/hwsrc/clippingregionmanager.h
Update contrib.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #ifndef CLIPPINGREGIONMANAGER_H_
18 #define CLIPPINGREGIONMANAGER_H_
20 #include <VG/openvg.h>
24 Defines a rectangle of VGint coordinates for use when passing clipping rectangles to OpenVG.
26 struct TVgClippingRect
35 Helper for managing clipping (OpenVG: scissoring) regions within CVGEngine.
37 OpenVG supports only a fixed number of clipping rects (actual number is defined by
38 the OpenVG implementation, though guaranteed to be at least 32), whereas
39 Symbian OS stipulates no upper bound on the number of clipping rects in the
42 This class keeps the entire clipping region in OpenVG coordinates, and may
43 be used to iterate over the clipping region, passing a set number of
44 clipping rectangles to OpenVG on each iteration.
46 A typical use case would be as follows:
48 for (iRegionManager.Begin(); iRegionManager.ApplyClipRegion(); iRegionManager.Next())
49 vgDrawImage(openVgImage);
54 NONSHARABLE_CLASS(RClippingRegionManager)
57 RClippingRegionManager ();
60 void Initialize (TUint aItemsPerStep, TSize aVgEngineTargetSize);
61 TInt SetClippingRegion(const TRegion& aRegion);
62 const RRegion& ClippingRegion () const;
63 void ClipTo(const TRect& aClipRect);
66 TBool ApplyClipRegion();
67 TBool Intersects(const TRect& aClipRect) const;
70 void ResetIterator ();
71 TUint RemainingItems() const;
72 TUint ItemsInThisIteration() const;
73 TInt Append(const TPoint& aVgPosition, VGint width, VGint height);
74 const TPoint ConvertToVgCoords(const TRect& aRect) const;
75 TInt ConvertClippingRegion(const TRegion& aRegion);
78 RArray<TVgClippingRect> iClippingRects; /**< Array of clipping rectangles stored in OpenVG coordinates.*/
79 RRegion iClippingRegion; /**< The full clipping region.*/
80 TSize iVgEngineTargetSize;