Want more features on Pastebin? Sign Up, it's FREE!
Guest

QtWebkit image quality patch for Qt 4.8.1

By: a guest on Aug 31st, 2012  |  syntax: Diff  |  size: 2.07 KB  |  views: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- ./src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp.orig        2012-06-14 14:56:35.321916873 +0400
  2. +++ ./src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp     2012-06-13 23:04:37.233047786 +0400
  3. @@ -243,6 +243,7 @@
  4.      initialSmoothPixmapTransformHint = painter->testRenderHint(QPainter::SmoothPixmapTransform);
  5.  
  6.      painter->setRenderHint(QPainter::Antialiasing, true);
  7. +    painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
  8.  }
  9.  
  10.  GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
  11. @@ -1371,25 +1372,26 @@
  12.  void GraphicsContext::setImageInterpolationQuality(InterpolationQuality quality)
  13.  {
  14.      m_data->imageInterpolationQuality = quality;
  15. +    m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, true);
  16.  
  17. -    switch (quality) {
  18. -    case InterpolationNone:
  19. -    case InterpolationLow:
  20. -        // use nearest-neigbor
  21. -        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, false);
  22. -        break;
  23. -
  24. -    case InterpolationMedium:
  25. -    case InterpolationHigh:
  26. -        // use the filter
  27. -        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, true);
  28. -        break;
  29. -
  30. -    case InterpolationDefault:
  31. -    default:
  32. -        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, m_data->initialSmoothPixmapTransformHint);
  33. -        break;
  34. -    };
  35. +    // switch (quality) {
  36. +    // case InterpolationNone:
  37. +    // case InterpolationLow:
  38. +    //     // use nearest-neigbor
  39. +    //     m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, false);
  40. +    //     break;
  41. +
  42. +    // case InterpolationMedium:
  43. +    // case InterpolationHigh:
  44. +    //     // use the filter
  45. +    //     m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, true);
  46. +    //     break;
  47. +
  48. +    // case InterpolationDefault:
  49. +    // default:
  50. +    //     m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, m_data->initialSmoothPixmapTransformHint);
  51. +    //     break;
  52. +    // };
  53.  }
  54.  
  55.  InterpolationQuality GraphicsContext::imageInterpolationQuality() const
clone this paste RAW Paste Data