20 #include "MaskedBitmap.h" |
20 #include "MaskedBitmap.h" |
21 #include "BitmapTiler.h" |
21 #include "BitmapTiler.h" |
22 #include <fbs.h> |
22 #include <fbs.h> |
23 #include <bitstd.h> |
23 #include <bitstd.h> |
24 #include <bitdev.h> |
24 #include <bitdev.h> |
|
25 #include <Browser_Platform_Variant.hrh> |
25 |
26 |
26 |
27 |
27 // ======================== STATIC FACTORY FUNCTIONS =========================== |
28 // ======================== STATIC FACTORY FUNCTIONS =========================== |
28 #define GET_PIX_GRAY2(buf, x, y, w) (((TUint32*)((TUint8*)buf + y*w))[x>>5] & (1<<(x&0x1f))) |
29 #define GET_PIX_GRAY2(buf, x, y, w) (((TUint32*)((TUint8*)buf + y*w))[x>>5] & (1<<(x&0x1f))) |
29 |
30 |
470 } |
471 } |
471 else |
472 else |
472 { |
473 { |
473 gc.SetBrushStyle(CGraphicsContext::ENullBrush); |
474 gc.SetBrushStyle(CGraphicsContext::ENullBrush); |
474 TPoint off(srcPt.iX, srcPt.iY); |
475 TPoint off(srcPt.iX, srcPt.iY); |
|
476 |
|
477 #ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF |
|
478 while ((bmpRect.iBr.iX - off.iX)> 2*SizeInPixels().iWidth) |
|
479 { |
|
480 TInt w = SizeInPixels().iWidth; |
|
481 TInt h = SizeInPixels().iHeight; |
|
482 TInt new_width = 2*w; |
|
483 |
|
484 CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
485 bitmap->Create( TSize(new_width,h), iBitmap->DisplayMode() ); |
|
486 |
|
487 CBitmapContext* bitmapContext=NULL; |
|
488 CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(bitmap); |
|
489 CleanupStack::PushL(bitmapDevice); |
|
490 User::LeaveIfError(bitmapDevice->CreateBitmapContext(bitmapContext)); |
|
491 CleanupStack::PushL(bitmapContext); |
|
492 bitmapContext->BitBlt(TPoint(0,0),iBitmap); |
|
493 bitmapContext->BitBlt(TPoint(w,0),iBitmap); |
|
494 CleanupStack::PopAndDestroy(2); |
|
495 delete iBitmap; |
|
496 iBitmap = bitmap; |
|
497 |
|
498 if (HasMask()) |
|
499 { |
|
500 CFbsBitmap* mask = new (ELeave) CFbsBitmap; |
|
501 mask->Create( TSize(new_width,h), iMask->DisplayMode() ); |
|
502 CBitmapContext* bitmapContext=NULL; |
|
503 CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(mask); |
|
504 CleanupStack::PushL(bitmapDevice); |
|
505 User::LeaveIfError(bitmapDevice->CreateBitmapContext(bitmapContext)); |
|
506 CleanupStack::PushL(bitmapContext); |
|
507 bitmapContext->BitBlt(TPoint(0,0),iMask); |
|
508 bitmapContext->BitBlt(TPoint(w,0),iMask); |
|
509 CleanupStack::PopAndDestroy(2); |
|
510 delete iMask; |
|
511 iMask = mask; |
|
512 } |
|
513 } |
|
514 #endif |
475 for (TInt x = off.iX; x<bmpRect.iBr.iX; x+=SizeInPixels().iWidth) |
515 for (TInt x = off.iX; x<bmpRect.iBr.iX; x+=SizeInPixels().iWidth) |
476 { |
516 { |
477 for (TInt y = off.iY; y<bmpRect.iBr.iY; y+=SizeInPixels().iHeight) |
517 for (TInt y = off.iY; y<bmpRect.iBr.iY; y+=SizeInPixels().iHeight) |
478 { |
518 { |
479 TRect rect(TPoint(x,y), SizeInPixels()); |
519 TRect rect(TPoint(x,y), SizeInPixels()); |