Changeset 74220 in webkit
- Timestamp:
- Dec 16, 2010 5:44:53 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r74218 r74220 1 2010-12-16 Ariya Hidayat <ariya@sencha.com> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] GraphicsContext should respect QWebView render hints 6 https://bugs.webkit.org/show_bug.cgi?id=51208 7 8 GraphicsContext does not override SmoothPixmapTransform (see also 9 r62762). To keep the same behavior, canvas default image interpolation 10 quality is set to medium and QWebView's render hints by default also 11 include SmoothPixmapTransform. 12 13 * html/HTMLCanvasElement.h: 14 * platform/graphics/qt/GraphicsContextQt.cpp: 15 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): 16 1 17 2010-12-16 Daniel Bates <dbates@rim.com> 2 18 -
trunk/WebCore/html/HTMLCanvasElement.h
r73927 r74220 33 33 #include "IntSize.h" 34 34 35 #if PLATFORM(CHROMIUM) 35 #if PLATFORM(CHROMIUM) || PLATFORM(QT) 36 36 #define DefaultInterpolationQuality InterpolationMedium 37 37 #elif PLATFORM(CG) -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r74187 r74220 238 238 antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing); 239 239 240 painter->setRenderHint s(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, true);240 painter->setRenderHint(QPainter::Antialiasing, true); 241 241 } 242 242 -
trunk/WebKit/qt/Api/qwebview.cpp
r73867 r74220 40 40 : view(view) 41 41 , page(0) 42 , renderHints(QPainter::TextAntialiasing )42 , renderHints(QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform) 43 43 { 44 44 Q_ASSERT(view); … … 714 714 These hints are used to initialize QPainter before painting the Web page. 715 715 716 QPainter::TextAntialiasing isenabled by default.716 QPainter::TextAntialiasing and QPainter::SmoothPixmapTransform are enabled by default. 717 717 718 718 \note This property is not available on Symbian. However, the getter and -
trunk/WebKit/qt/ChangeLog
r74173 r74220 1 2010-12-16 Ariya Hidayat <ariya@sencha.com> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] GraphicsContext should respect QWebView render hints 6 https://bugs.webkit.org/show_bug.cgi?id=51208 7 8 Add some checks to ensure that GraphicsContext (via QWebFrame) 9 does not clobber the render hints. 10 11 * Api/qwebview.cpp: 12 (QWebViewPrivate::QWebViewPrivate): 13 * tests/qwebframe/tst_qwebframe.cpp: 14 1 15 2010-12-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 16 -
trunk/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
r73865 r74220 30 30 #include <QApplication> 31 31 #include <QComboBox> 32 #include <QPaintEngine> 32 33 #include <QPicture> 33 34 #include <QRegExp> … … 617 618 void hasSetFocus(); 618 619 void render(); 620 void renderHints(); 619 621 void scrollPosition(); 620 622 void scrollToAnchor(); … … 2858 2860 } 2859 2861 2862 2863 class DummyPaintEngine: public QPaintEngine { 2864 public: 2865 2866 DummyPaintEngine() 2867 : QPaintEngine(QPaintEngine::AllFeatures) 2868 , renderHints(0) 2869 { 2870 } 2871 2872 bool begin(QPaintDevice*) 2873 { 2874 setActive(true); 2875 return true; 2876 } 2877 2878 bool end() 2879 { 2880 setActive(false); 2881 return false; 2882 } 2883 2884 void updateState(const QPaintEngineState& state) 2885 { 2886 renderHints = state.renderHints(); 2887 } 2888 2889 void drawPath(const QPainterPath&) { } 2890 void drawPixmap(const QRectF&, const QPixmap&, const QRectF&) { } 2891 2892 QPaintEngine::Type type() const 2893 { 2894 return static_cast<QPaintEngine::Type>(QPaintEngine::User + 2); 2895 } 2896 2897 QPainter::RenderHints renderHints; 2898 }; 2899 2900 class DummyPaintDevice: public QPaintDevice { 2901 public: 2902 DummyPaintDevice() 2903 : QPaintDevice() 2904 , m_engine(new DummyPaintEngine) 2905 { 2906 } 2907 2908 ~DummyPaintDevice() 2909 { 2910 delete m_engine; 2911 } 2912 2913 QPaintEngine* paintEngine() const 2914 { 2915 return m_engine; 2916 } 2917 2918 QPainter::RenderHints renderHints() const 2919 { 2920 return m_engine->renderHints; 2921 } 2922 2923 protected: 2924 int metric(PaintDeviceMetric metric) const; 2925 2926 private: 2927 DummyPaintEngine* m_engine; 2928 friend class DummyPaintEngine; 2929 }; 2930 2931 2932 int DummyPaintDevice::metric(PaintDeviceMetric metric) const 2933 { 2934 switch (metric) { 2935 case PdmWidth: 2936 return 400; 2937 break; 2938 2939 case PdmHeight: 2940 return 200; 2941 break; 2942 2943 case PdmNumColors: 2944 return INT_MAX; 2945 break; 2946 2947 case PdmDepth: 2948 return 32; 2949 break; 2950 2951 default: 2952 break; 2953 } 2954 return 0; 2955 } 2956 2957 void tst_QWebFrame::renderHints() 2958 { 2959 QString html("<html><body><p>Hello, world!</p></body></html>"); 2960 2961 QWebPage page; 2962 page.mainFrame()->setHtml(html); 2963 page.setViewportSize(page.mainFrame()->contentsSize()); 2964 2965 // We will call frame->render and trap the paint engine state changes 2966 // to ensure that GraphicsContext does not clobber the render hints. 2967 DummyPaintDevice buffer; 2968 QPainter painter(&buffer); 2969 2970 painter.setRenderHint(QPainter::TextAntialiasing, false); 2971 page.mainFrame()->render(&painter); 2972 QVERIFY(!(buffer.renderHints() & QPainter::TextAntialiasing)); 2973 QVERIFY(!(buffer.renderHints() & QPainter::SmoothPixmapTransform)); 2974 QVERIFY(!(buffer.renderHints() & QPainter::HighQualityAntialiasing)); 2975 2976 painter.setRenderHint(QPainter::TextAntialiasing, true); 2977 page.mainFrame()->render(&painter); 2978 QVERIFY(buffer.renderHints() & QPainter::TextAntialiasing); 2979 QVERIFY(!(buffer.renderHints() & QPainter::SmoothPixmapTransform)); 2980 QVERIFY(!(buffer.renderHints() & QPainter::HighQualityAntialiasing)); 2981 2982 painter.setRenderHint(QPainter::SmoothPixmapTransform, true); 2983 page.mainFrame()->render(&painter); 2984 QVERIFY(buffer.renderHints() & QPainter::TextAntialiasing); 2985 QVERIFY(buffer.renderHints() & QPainter::SmoothPixmapTransform); 2986 QVERIFY(!(buffer.renderHints() & QPainter::HighQualityAntialiasing)); 2987 2988 painter.setRenderHint(QPainter::HighQualityAntialiasing, true); 2989 page.mainFrame()->render(&painter); 2990 QVERIFY(buffer.renderHints() & QPainter::TextAntialiasing); 2991 QVERIFY(buffer.renderHints() & QPainter::SmoothPixmapTransform); 2992 QVERIFY(buffer.renderHints() & QPainter::HighQualityAntialiasing); 2993 } 2994 2860 2995 void tst_QWebFrame::scrollPosition() 2861 2996 {
Note: See TracChangeset
for help on using the changeset viewer.