equal
deleted
inserted
replaced
433 // --------------------------------------------------------------------------- |
433 // --------------------------------------------------------------------------- |
434 // HgVgHelper::DrawAlphaImage() |
434 // HgVgHelper::DrawAlphaImage() |
435 // --------------------------------------------------------------------------- |
435 // --------------------------------------------------------------------------- |
436 // |
436 // |
437 void DrawImage(VGImage aImage, |
437 void DrawImage(VGImage aImage, |
438 const TPoint& aPos, const TRect& aWindowRect, TBool aCentered) |
438 const TPoint& aPos, const TRect& aWindowRect, TBool aCentered, TBool aLandscape) |
439 { |
439 { |
440 |
440 |
441 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); |
441 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); |
442 vgLoadIdentity(); |
442 vgLoadIdentity(); |
|
443 if (aLandscape) |
|
444 { |
|
445 vgTranslate(0.0f, 640.0f); |
|
446 vgRotate(-90.0f); |
|
447 } |
443 |
448 |
444 if (!aCentered) |
449 if (!aCentered) |
445 { |
450 { |
446 vgScale(1, -1); |
451 vgScale(1, -1); |
447 vgTranslate(aPos.iX, -(aWindowRect.Height() - aPos.iY)); |
452 vgTranslate(aPos.iX, -(aWindowRect.Height() - aPos.iY)); |
462 // --------------------------------------------------------------------------- |
467 // --------------------------------------------------------------------------- |
463 // HgVgHelper::DrawImageColorized |
468 // HgVgHelper::DrawImageColorized |
464 // --------------------------------------------------------------------------- |
469 // --------------------------------------------------------------------------- |
465 // |
470 // |
466 void DrawImageColorized(VGImage aImage, const TRgb& aColor, |
471 void DrawImageColorized(VGImage aImage, const TRgb& aColor, |
467 const TPoint& aPos, const TRect& aWindowRect, TBool aCentered) |
472 const TPoint& aPos, const TRect& aWindowRect, TBool aCentered, TBool aLandscape) |
468 { |
473 { |
469 |
474 |
470 VGfloat values[] = { 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 }; |
475 VGfloat values[] = { 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 }; |
471 |
476 |
472 values[0] = (VGfloat)aColor.Red() / KColorByteToFloatFactor; |
477 values[0] = (VGfloat)aColor.Red() / KColorByteToFloatFactor; |
475 values[3] = (VGfloat)aColor.Alpha() / KColorByteToFloatFactor; |
480 values[3] = (VGfloat)aColor.Alpha() / KColorByteToFloatFactor; |
476 |
481 |
477 vgSetfv(VG_COLOR_TRANSFORM_VALUES, KNumColorTransformValues, values); |
482 vgSetfv(VG_COLOR_TRANSFORM_VALUES, KNumColorTransformValues, values); |
478 vgSeti(VG_COLOR_TRANSFORM, VG_TRUE); |
483 vgSeti(VG_COLOR_TRANSFORM, VG_TRUE); |
479 |
484 |
480 HgVgHelper::DrawImage(aImage, aPos, aWindowRect, aCentered); |
485 HgVgHelper::DrawImage(aImage, aPos, aWindowRect, aCentered, aLandscape); |
481 |
486 |
482 vgSeti(VG_COLOR_TRANSFORM, VG_FALSE); |
487 vgSeti(VG_COLOR_TRANSFORM, VG_FALSE); |
483 } |
488 } |
484 |
489 |
485 |
490 |