82 inline TBool WindowSizeCacheEnabled() const; |
82 inline TBool WindowSizeCacheEnabled() const; |
83 inline void MarkWindowSizeCacheDirty(TInt aHandle); |
83 inline void MarkWindowSizeCacheDirty(TInt aHandle); |
84 inline void RefreshWindowSizeCache(TInt aHandle, const TSize& aNewSize); |
84 inline void RefreshWindowSizeCache(TInt aHandle, const TSize& aNewSize); |
85 inline TInt CachedWindowSize(TInt aHandle, TSize& aSize); |
85 inline TInt CachedWindowSize(TInt aHandle, TSize& aSize); |
86 inline void DestroyWindowSizeCacheEntry(TInt aHandle); |
86 inline void DestroyWindowSizeCacheEntry(TInt aHandle); |
|
87 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
88 void EnableWindowNativeSizeCacheL(); |
|
89 inline TBool WindowNativeSizeCacheEnabled() const; |
|
90 inline TInt SetWindowNativeSize(TInt aHandle, const TSize& aNativeSize); |
|
91 inline TInt WindowNativeSize(TInt aHandle, TSize& aSize); |
|
92 inline void DestroyWindowNativeSizeCacheEntry(TInt aHandle); |
|
93 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
87 |
94 |
88 private: |
95 private: |
89 TInt DoWrite(TInt aHandle, TUint aOpcode, TBool aFlush, const TIpcArgs* aIpcArgs, const TAny* aData1=NULL, TInt aLength1=0, const TAny* aData2=NULL, TInt aLength2=0); |
96 TInt DoWrite(TInt aHandle, TUint aOpcode, TBool aFlush, const TIpcArgs* aIpcArgs, const TAny* aData1=NULL, TInt aLength1=0, const TAny* aData2=NULL, TInt aLength2=0); |
90 inline void SetAndLimitMaxBufSize(TInt aMaxBufSize); |
97 inline void SetAndLimitMaxBufSize(TInt aMaxBufSize); |
91 void ReAllocBufferL(TInt aNewSize); |
98 void ReAllocBufferL(TInt aNewSize); |
114 TSize iSize; |
121 TSize iSize; |
115 TBool iDirty; |
122 TBool iDirty; |
116 }; |
123 }; |
117 |
124 |
118 RHashMap<TInt, TWindowSizeCacheEntry>* iWindowSizeCache; |
125 RHashMap<TInt, TWindowSizeCacheEntry>* iWindowSizeCache; |
|
126 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
127 RHashMap<TInt, TWindowSizeCacheEntry>* iWindowNativeSizeCache; |
|
128 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
119 }; |
129 }; |
120 |
130 |
121 |
131 |
122 inline TInt RWsBuffer::BufferSize() const |
132 inline TInt RWsBuffer::BufferSize() const |
123 {return(iBuf.MaxLength());} |
133 {return(iBuf.MaxLength());} |
183 // If there is a window size cache entry, then err == KErrNone. |
193 // If there is a window size cache entry, then err == KErrNone. |
184 // Otherwise, there isn't a size cache entry, and err == KErrNotFound. |
194 // Otherwise, there isn't a size cache entry, and err == KErrNotFound. |
185 __ASSERT_DEBUG(err == KErrNone || err == KErrNotFound, Assert(EW32AssertWindowSizeCacheFailure)); |
195 __ASSERT_DEBUG(err == KErrNone || err == KErrNotFound, Assert(EW32AssertWindowSizeCacheFailure)); |
186 } |
196 } |
187 |
197 |
|
198 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
199 inline TBool RWsBuffer::WindowNativeSizeCacheEnabled() const |
|
200 { |
|
201 return iWindowNativeSizeCache ? ETrue : EFalse; |
|
202 } |
|
203 |
|
204 inline TInt RWsBuffer::SetWindowNativeSize(TInt aHandle, const TSize& aNativeSize) |
|
205 { |
|
206 __ASSERT_ALWAYS(iWindowNativeSizeCache != NULL, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
207 RWsBuffer::TWindowSizeCacheEntry* entry = iWindowNativeSizeCache->Find(aHandle); |
|
208 __ASSERT_ALWAYS(!entry, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
209 return iWindowNativeSizeCache->Insert(aHandle, RWsBuffer::TWindowSizeCacheEntry(aNativeSize)); |
|
210 } |
|
211 |
|
212 inline TInt RWsBuffer::WindowNativeSize(TInt aHandle, TSize& aSize) |
|
213 { |
|
214 __ASSERT_ALWAYS(iWindowNativeSizeCache != NULL, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
215 RWsBuffer::TWindowSizeCacheEntry* entry = iWindowNativeSizeCache->Find(aHandle); |
|
216 if (entry) |
|
217 { |
|
218 aSize = entry->iSize; |
|
219 return KErrNone; |
|
220 } |
|
221 else |
|
222 { |
|
223 return KErrNotFound; |
|
224 } |
|
225 } |
|
226 |
|
227 inline void RWsBuffer::DestroyWindowNativeSizeCacheEntry(TInt aHandle) |
|
228 { |
|
229 __ASSERT_ALWAYS(iWindowNativeSizeCache != NULL, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
230 TInt err = iWindowNativeSizeCache->Remove(aHandle); |
|
231 // If there is a window size cache entry, then err == KErrNone. |
|
232 // Otherwise, there isn't a size cache entry, and err == KErrNotFound. |
|
233 __ASSERT_DEBUG(err == KErrNone || err == KErrNotFound, Assert(EW32AssertWindowNativeSizeCacheFailure)); |
|
234 } |
|
235 |
|
236 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
237 |
188 |
238 |
189 #endif |
239 #endif |