Changeset 61341 in webkit
- Timestamp:
- Jun 17, 2010 12:50:36 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r61340 r61341 1 2010-06-17 Stephen White <senorblanco@chromium.org> 2 3 Reviewed by David Levin. 4 5 Temporarily modify test_expectations.txt to add tests broken by 6 https://bugs.webkit.org/show_bug.cgi?id=38233 7 8 * platform/chromium/test_expectations.txt: 9 1 10 2010-06-17 Rob Buis <rwlbuis@gmail.com> 2 11 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r61337 r61341 2918 2918 // needs new baseline, transferring over from downstream. 2919 2919 BUG46674 : fast/js/missing-title-end-tag-js.html = FAIL 2920 2921 // The following need to be rebaselined due to change of resize algorithm in 2922 // https://bugs.webkit.org/show_bug.cgi?id=38233 2923 2924 BUG_SENORBLANCO WIN LINUX : css2.1/t090501-c414-flt-03-b-g.html = IMAGE 2925 BUG_SENORBLANCO WIN LINUX : css2.1/t090501-c5525-flt-l-00-b-g.html = IMAGE 2926 BUG_SENORBLANCO WIN LINUX : css2.1/t090501-c5525-flt-r-00-b-g.html = IMAGE 2927 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize01.html = IMAGE 2928 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize02.html = IMAGE 2929 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize04.html = IMAGE 2930 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize05.html = IMAGE 2931 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize06.html = IMAGE 2932 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize07.html = IMAGE 2933 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize08.html = IMAGE 2934 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize09.html = IMAGE 2935 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize10.html = IMAGE 2936 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize11.html = IMAGE 2937 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize12.html = IMAGE 2938 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize13.html = IMAGE 2939 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize14.html = IMAGE 2940 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize15.html = IMAGE 2941 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize16.html = IMAGE 2942 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize17.html = IMAGE 2943 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize18.html = IMAGE 2944 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize19.html = IMAGE 2945 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize20.html = IMAGE 2946 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize21.html = IMAGE 2947 BUG_SENORBLANCO WIN LINUX : fast/backgrounds/size/backgroundSize22.html = IMAGE 2948 BUG_SENORBLANCO WIN LINUX : fast/block/positioning/replaced-inside-fixed-top-bottom.html = IMAGE 2949 BUG_SENORBLANCO WIN LINUX : fast/css/value-list-out-of-bounds-crash.html = IMAGE 2950 BUG_SENORBLANCO WIN LINUX : fast/events/pointer-events-2.html = IMAGE 2951 BUG_SENORBLANCO WIN LINUX : fast/forms/input-type-change.html = IMAGE 2952 BUG_SENORBLANCO WIN LINUX : fast/replaced/absolute-image-sizing.html = IMAGE 2953 BUG_SENORBLANCO WIN LINUX : fast/replaced/image-sizing.html = IMAGE 2954 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug101674.html = IMAGE 2955 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug11026.html = IMAGE 2956 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug1188.html = IMAGE 2957 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug1296.html = IMAGE 2958 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug1430.html = IMAGE 2959 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug14929.html = IMAGE 2960 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug15544.html = IMAGE 2961 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug2981-2.html = IMAGE 2962 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug4093.html = IMAGE 2963 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug4284.html = IMAGE 2964 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug4427.html = IMAGE 2965 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug56563.html = IMAGE 2966 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug625.html = IMAGE 2967 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug6404.html = IMAGE 2968 BUG_SENORBLANCO WIN LINUX : tables/mozilla/bugs/bug97383.html = IMAGE 2969 BUG_SENORBLANCO WIN LINUX : tables/mozilla/core/bloomberg.html = IMAGE 2970 BUG_SENORBLANCO WIN LINUX : tables/mozilla/core/col_widths_auto_autoFix.html = IMAGE 2971 BUG_SENORBLANCO WIN LINUX : tables/mozilla/core/misc.html = IMAGE 2972 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tbody_valign_baseline.html = IMAGE 2973 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tbody_valign_bottom.html = IMAGE 2974 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tbody_valign_middle.html = IMAGE 2975 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tbody_valign_top.html = IMAGE 2976 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/td_valign_baseline.html = IMAGE 2977 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/td_valign_bottom.html = IMAGE 2978 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/td_valign_middle.html = IMAGE 2979 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/td_valign_top.html = IMAGE 2980 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tfoot_valign_baseline.html = IMAGE 2981 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tfoot_valign_bottom.html = IMAGE 2982 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tfoot_valign_middle.html = IMAGE 2983 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tfoot_valign_top.html = IMAGE 2984 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/th_valign_baseline.html = IMAGE 2985 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/th_valign_bottom.html = IMAGE 2986 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/th_valign_middle.html = IMAGE 2987 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/th_valign_top.html = IMAGE 2988 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/thead_valign_baseline.html = IMAGE 2989 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/thead_valign_bottom.html = IMAGE 2990 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/thead_valign_middle.html = IMAGE 2991 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/thead_valign_top.html = IMAGE 2992 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tr_valign_baseline.html = IMAGE 2993 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tr_valign_bottom.html = IMAGE 2994 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tr_valign_middle.html = IMAGE 2995 BUG_SENORBLANCO WIN LINUX : tables/mozilla/marvin/tr_valign_top.html = IMAGE 2996 BUG_SENORBLANCO WIN LINUX : tables/mozilla/other/cell_widths.html = IMAGE 2997 BUG_SENORBLANCO WIN LINUX : tables/mozilla_expected_failures/bugs/97619.html = IMAGE 2998 BUG_SENORBLANCO WIN LINUX : tables/mozilla_expected_failures/bugs/bug6933.html = IMAGE 2999 3000 BUG_SENORBLANCO MAC : css2.1/t0804-c5510-padn-00-b-ag.html = IMAGE 3001 BUG_SENORBLANCO MAC : css2.1/t0905-c414-flt-01-d-g.html = IMAGE 3002 BUG_SENORBLANCO MAC : css2.1/t090501-c414-flt-02-d-g.html = IMAGE 3003 BUG_SENORBLANCO MAC : css2.1/t090501-c414-flt-03-b-g.html = IMAGE 3004 BUG_SENORBLANCO MAC : css2.1/t090501-c414-flt-ln-01-d-g.html = IMAGE 3005 BUG_SENORBLANCO MAC : css2.1/t090501-c5525-flt-l-00-b-g.html = IMAGE 3006 BUG_SENORBLANCO MAC : css2.1/t090501-c5525-flt-r-00-b-g.html = IMAGE 3007 BUG_SENORBLANCO MAC : css2.1/t100304-c43-rpl-bbx-00-d-g.html = IMAGE 3008 BUG_SENORBLANCO MAC : css2.1/t100304-c43-rpl-bbx-01-d-g.html = IMAGE 3009 BUG_SENORBLANCO MAC : css2.1/t1004-c5524-width-00-b-g.html = IMAGE 3010 BUG_SENORBLANCO MAC : css2.1/t100801-c544-valgn-02-d-agi.html = IMAGE 3011 BUG_SENORBLANCO MAC : css2.1/t100801-c544-valgn-03-d-agi.html = IMAGE 3012 BUG_SENORBLANCO MAC : css2.1/t100801-c544-valgn-04-d-agi.html = IMAGE 3013 BUG_SENORBLANCO MAC : fast/backgrounds/repeat/mask-negative-offset-repeat.html = IMAGE 3014 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize01.html = IMAGE 3015 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize05.html = IMAGE 3016 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize06.html = IMAGE 3017 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize07.html = IMAGE 3018 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize08.html = IMAGE 3019 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize09.html = IMAGE 3020 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize10.html = IMAGE 3021 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize11.html = IMAGE 3022 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize12.html = IMAGE 3023 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize16.html = IMAGE 3024 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize17.html = IMAGE 3025 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize18.html = IMAGE 3026 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize19.html = IMAGE 3027 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize20.html = IMAGE 3028 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize21.html = IMAGE 3029 BUG_SENORBLANCO MAC : fast/backgrounds/size/backgroundSize22.html = IMAGE 3030 BUG_SENORBLANCO MAC : fast/backgrounds/size/zero.html = IMAGE 3031 BUG_SENORBLANCO MAC : fast/block/positioning/replaced-inside-fixed-top-bottom.html = IMAGE 3032 BUG_SENORBLANCO MAC : fast/canvas/canvas-as-image.html = IMAGE 3033 BUG_SENORBLANCO MAC : fast/css/value-list-out-of-bounds-crash.html = IMAGE 3034 BUG_SENORBLANCO MAC : fast/forms/input-type-change.html = IMAGE 3035 BUG_SENORBLANCO MAC : fast/replaced/001.html = IMAGE 3036 BUG_SENORBLANCO MAC : fast/replaced/002.html = IMAGE 3037 BUG_SENORBLANCO MAC : fast/replaced/003.html = IMAGE 3038 BUG_SENORBLANCO MAC : fast/replaced/absolute-image-sizing.html = IMAGE 3039 BUG_SENORBLANCO MAC : fast/replaced/image-sizing.html = IMAGE 3040 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug11026.html = IMAGE 3041 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug1188.html = IMAGE 3042 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug1296.html = IMAGE 3043 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug1430.html = IMAGE 3044 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug14929.html = IMAGE 3045 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug15544.html = IMAGE 3046 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug23235.html = IMAGE 3047 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug2981-2.html = IMAGE 3048 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug4093.html = IMAGE 3049 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug4284.html = IMAGE 3050 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug4427.html = IMAGE 3051 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug4523.html = IMAGE 3052 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug56563.html = IMAGE 3053 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug6404.html = IMAGE 3054 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug86708.html = IMAGE 3055 BUG_SENORBLANCO MAC : tables/mozilla/bugs/bug97383.html = IMAGE 3056 BUG_SENORBLANCO MAC : tables/mozilla/core/col_widths_auto_autoFix.html = IMAGE 3057 BUG_SENORBLANCO MAC : tables/mozilla/core/misc.html = IMAGE 3058 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tbody_valign_baseline.html = IMAGE 3059 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tbody_valign_bottom.html = IMAGE 3060 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tbody_valign_middle.html = IMAGE 3061 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tbody_valign_top.html = IMAGE 3062 BUG_SENORBLANCO MAC : tables/mozilla/marvin/td_valign_baseline.html = IMAGE 3063 BUG_SENORBLANCO MAC : tables/mozilla/marvin/td_valign_bottom.html = IMAGE 3064 BUG_SENORBLANCO MAC : tables/mozilla/marvin/td_valign_middle.html = IMAGE 3065 BUG_SENORBLANCO MAC : tables/mozilla/marvin/td_valign_top.html = IMAGE 3066 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tfoot_valign_baseline.html = IMAGE 3067 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tfoot_valign_bottom.html = IMAGE 3068 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tfoot_valign_middle.html = IMAGE 3069 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tfoot_valign_top.html = IMAGE 3070 BUG_SENORBLANCO MAC : tables/mozilla/marvin/th_valign_baseline.html = IMAGE 3071 BUG_SENORBLANCO MAC : tables/mozilla/marvin/th_valign_bottom.html = IMAGE 3072 BUG_SENORBLANCO MAC : tables/mozilla/marvin/th_valign_middle.html = IMAGE 3073 BUG_SENORBLANCO MAC : tables/mozilla/marvin/th_valign_top.html = IMAGE 3074 BUG_SENORBLANCO MAC : tables/mozilla/marvin/thead_valign_baseline.html = IMAGE 3075 BUG_SENORBLANCO MAC : tables/mozilla/marvin/thead_valign_bottom.html = IMAGE 3076 BUG_SENORBLANCO MAC : tables/mozilla/marvin/thead_valign_middle.html = IMAGE 3077 BUG_SENORBLANCO MAC : tables/mozilla/marvin/thead_valign_top.html = IMAGE 3078 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tr_valign_baseline.html = IMAGE 3079 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tr_valign_bottom.html = IMAGE 3080 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tr_valign_middle.html = IMAGE 3081 BUG_SENORBLANCO MAC : tables/mozilla/marvin/tr_valign_top.html = IMAGE 3082 BUG_SENORBLANCO MAC : tables/mozilla_expected_failures/bugs/97619.html = IMAGE 3083 BUG_SENORBLANCO MAC : tables/mozilla_expected_failures/bugs/bug6933.html = IMAGE -
trunk/WebCore/ChangeLog
r61340 r61341 1 2010-06-17 Stephen White <senorblanco@chromium.org> 2 3 Reviewed by David Levin. 4 5 Fix for slow multiple animated resize issue. 6 https://bugs.webkit.org/show_bug.cgi?id=38233 7 8 The timer-based resize quality approach implemented in 9 http://trac.webkit.org/changeset/34210 is a good idea, but doesn't 10 scale to multiple images with animated resizes. This fix unifies all 11 outstanding resize timers into a single timer, and removes the "use 12 last quality" check (which doesn't work when images are overlapping). 13 It also refactors the copy of this code implemented in 14 RenderBoxModelObject in http://trac.webkit.org/changeset/53949. 15 16 This improves Safari performance for the following IE9 platform demos on my C2D MacPro (10.5): 17 http://ie.microsoft.com/testdrive/Performance/01FlyingImages/Default.html (4->60fps) 18 http://ie.microsoft.com/testdrive/Performance/10FlickrExplorer/Default.html (3->16fps) 19 http://ie.microsoft.com/testdrive/Performance/11BrowserFlip/Default.html (9->60fps) 20 21 * rendering/RenderBoxModelObject.cpp: 22 (WebCore::ImageQualityController::ImageQualityController): 23 Unify all timers into a single timer, rename RenderBoxModelScaleObserver 24 to ImageQualityController, and remove the resize quality "stickness", 25 since it doesn't work with multiple outstanding resizes. 26 (WebCore::ImageQualityController::objectDestroyed): 27 gImages global is now m_lastPaintTimeMap member. 28 (WebCore::ImageQualityController::highQualityRepaintTimerFired): 29 Function made non-static; repaint all pending resizes (not just one). 30 (WebCore::ImageQualityController::restartTimer): 31 Added function to restart timer at 1.05x threshold. 32 (WebCore::imageQualityController): 33 Static function to return singleton. 34 (WebCore::ImageQualityController::shouldPaintAtLowQuality): 35 Use m_lastPaintTimeMap, not gImages global. Implement new timer 36 algorithm. Remove resize "stickiness". 37 (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality): 38 Implement shouldPaintAtLowQuality, which pulls out "this" and passes 39 the call to the ImageQualityController. 40 (WebCore::RenderBoxModelObject::~RenderBoxModelObject): 41 Call ImageQualityController singleton's objectDestroyed() instead of 42 old static function. 43 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 44 Modify shouldPaintAtLowQuality() call to match new class name and 45 function signature. 46 * rendering/RenderBoxModelObject.h: 47 Expose shouldPaintAtLowQuality as a member function. 48 * rendering/RenderImage.cpp: 49 (WebCore::RenderImage::~RenderImage): 50 No need to call objectDestroyed() here anymore, since the 51 RenderBoxModelObject destructor will do this for us. 52 (WebCore::RenderImage::paintIntoRect): 53 Rip out RenderImageScaleObserver, and call 54 RenderBoxModelObject::shouldPaintAtLowQuality() instead. 55 1 56 2010-06-17 Rob Buis <rwlbuis@gmail.com> 2 57 -
trunk/WebCore/rendering/RenderBoxModelObject.cpp
r60649 r61341 5 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 6 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 49 50 static const double cLowQualityTimeThreshold = 0.500; // 500 ms 50 51 51 class RenderBoxModelScaleData : public Noncopyable { 52 typedef HashMap<RenderBoxModelObject*, double> LastPaintTimeMap; 53 54 class ImageQualityController : public Noncopyable { 52 55 public: 53 RenderBoxModelScaleData(RenderBoxModelObject* object, const IntSize& size, const AffineTransform& transform, double time, bool lowQualityScale) 54 : m_size(size) 55 , m_transform(transform) 56 , m_lastPaintTime(time) 57 , m_lowQualityScale(lowQualityScale) 58 , m_highQualityRepaintTimer(object, &RenderBoxModelObject::highQualityRepaintTimerFired) 59 { 60 } 61 62 ~RenderBoxModelScaleData() 63 { 64 m_highQualityRepaintTimer.stop(); 65 } 66 67 Timer<RenderBoxModelObject>& hiqhQualityRepaintTimer() { return m_highQualityRepaintTimer; } 68 69 const IntSize& size() const { return m_size; } 70 void setSize(const IntSize& s) { m_size = s; } 71 double lastPaintTime() const { return m_lastPaintTime; } 72 void setLastPaintTime(double t) { m_lastPaintTime = t; } 73 bool useLowQualityScale() const { return m_lowQualityScale; } 74 const AffineTransform& transform() const { return m_transform; } 75 void setTransform(const AffineTransform& transform) { m_transform = transform; } 76 void setUseLowQualityScale(bool b) 77 { 78 m_highQualityRepaintTimer.stop(); 79 m_lowQualityScale = b; 80 if (b) 81 m_highQualityRepaintTimer.startOneShot(cLowQualityTimeThreshold); 82 } 56 ImageQualityController(); 57 bool shouldPaintAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const IntSize&); 58 void objectDestroyed(RenderBoxModelObject*); 83 59 84 60 private: 85 IntSize m_size;86 AffineTransform m_transform;87 double m_lastPaintTime; 88 bool m_lowQualityScale;89 Timer< RenderBoxModelObject> m_highQualityRepaintTimer;61 void highQualityRepaintTimerFired(Timer<ImageQualityController>*); 62 void restartTimer(); 63 64 LastPaintTimeMap m_lastPaintTimeMap; 65 Timer<ImageQualityController> m_timer; 90 66 }; 91 67 92 class RenderBoxModelScaleObserver { 93 public: 94 static bool shouldPaintBackgroundAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const IntSize&); 95 96 static void boxModelObjectDestroyed(RenderBoxModelObject* object) 97 { 98 if (gBoxModelObjects) { 99 RenderBoxModelScaleData* data = gBoxModelObjects->take(object); 100 delete data; 101 if (!gBoxModelObjects->size()) { 102 delete gBoxModelObjects; 103 gBoxModelObjects = 0; 104 } 105 } 106 } 107 108 static void highQualityRepaintTimerFired(RenderBoxModelObject* object) 109 { 110 RenderBoxModelScaleObserver::boxModelObjectDestroyed(object); 111 object->repaint(); 112 } 113 114 static HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>* gBoxModelObjects; 115 }; 116 117 bool RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(GraphicsContext* context, RenderBoxModelObject* object, Image* image, const IntSize& size) 68 ImageQualityController::ImageQualityController() 69 : m_timer(this, &ImageQualityController::highQualityRepaintTimerFired) 70 { 71 } 72 73 void ImageQualityController::objectDestroyed(RenderBoxModelObject* object) 74 { 75 m_lastPaintTimeMap.remove(object); 76 if (m_lastPaintTimeMap.isEmpty()) 77 m_timer.stop(); 78 } 79 80 void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityController>*) 81 { 82 for (LastPaintTimeMap::iterator it = m_lastPaintTimeMap.begin(); it != m_lastPaintTimeMap.end(); ++it) 83 it->first->repaint(); 84 } 85 86 void ImageQualityController::restartTimer() 87 { 88 m_timer.startOneShot(cLowQualityTimeThreshold * 1.05); 89 } 90 91 bool ImageQualityController::shouldPaintAtLowQuality(GraphicsContext* context, RenderBoxModelObject* object, Image* image, const IntSize& size) 118 92 { 119 93 // If the image is not a bitmap image, then none of this is relevant and we just paint at high 120 94 // quality. 121 if (!image || !image->isBitmapImage() )95 if (!image || !image->isBitmapImage() || context->paintingDisabled()) 122 96 return false; 123 97 … … 127 101 128 102 // Look ourselves up in the hashtable. 129 RenderBoxModelScaleData* data = 0; 130 if (gBoxModelObjects) 131 data = gBoxModelObjects->get(object); 103 LastPaintTimeMap::iterator i = m_lastPaintTimeMap.find(object); 132 104 133 105 const AffineTransform& currentTransform = context->getCTM(); 134 106 bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped(); 135 107 if (!contextIsScaled && imageSize == size) { 136 // There is no scale in effect. If we had a scale in effect before, we can just delete this data. 137 if (data) { 138 gBoxModelObjects->remove(object); 139 delete data; 140 } 108 // There is no scale in effect. If we had a scale in effect before, we can just remove this object from the list. 109 if (i != m_lastPaintTimeMap.end()) 110 m_lastPaintTimeMap.remove(object); 111 141 112 return false; 142 113 } 143 114 144 // There is no need to hash scaled images that always use low quality mode when the page demands it. 115 // There is no need to hash scaled images that always use low quality mode when the page demands it. This is the iChat case. 145 116 if (object->document()->page()->inLowQualityImageInterpolationMode()) { 146 117 double totalPixels = static_cast<double>(image->width()) * static_cast<double>(image->height()); … … 148 119 return true; 149 120 } 150 151 // If there is no data yet, we will paint the first scale at high quality and record the paint time in case a second scale happens 152 // very soon. 153 if (!data) { 154 data = new RenderBoxModelScaleData(object, size, currentTransform, currentTime(), false); 155 if (!gBoxModelObjects) 156 gBoxModelObjects = new HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>; 157 gBoxModelObjects->set(object, data); 121 double newTime = currentTime(); 122 if (i != m_lastPaintTimeMap.end() && newTime - i->second >= cLowQualityTimeThreshold && !m_timer.isActive()) { 123 // If it has been at least cLowQualityTimeThreshold seconds since the 124 // last time a resize was requested, and the timer is no longer active, 125 // draw at high quality and don't set the timer. 126 objectDestroyed(object); 158 127 return false; 159 128 } 160 161 const AffineTransform& tr = data->transform(); 162 bool scaleUnchanged = tr.a() == currentTransform.a() && tr.b() == currentTransform.b() && tr.c() == currentTransform.c() && tr.d() == currentTransform.d(); 163 // We are scaled, but we painted already at this size, so just keep using whatever mode we last painted with. 164 if ((!contextIsScaled || scaleUnchanged) && data->size() == size) 165 return data->useLowQualityScale(); 166 167 // We have data and our size just changed. If this change happened quickly, go into low quality mode and then set a repaint 168 // timer to paint in high quality mode. Otherwise it is ok to just paint in high quality mode. 169 double newTime = currentTime(); 170 data->setUseLowQualityScale(newTime - data->lastPaintTime() < cLowQualityTimeThreshold); 171 data->setLastPaintTime(newTime); 172 data->setTransform(currentTransform); 173 data->setSize(size); 174 return data->useLowQualityScale(); 175 } 176 177 HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>* RenderBoxModelScaleObserver::gBoxModelObjects = 0; 178 179 void RenderBoxModelObject::highQualityRepaintTimerFired(Timer<RenderBoxModelObject>*) 180 { 181 RenderBoxModelScaleObserver::highQualityRepaintTimerFired(this); 129 // Draw at low quality first and set a timer for high quality. 130 m_lastPaintTimeMap.set(object, newTime); 131 restartTimer(); 132 return true; 133 } 134 135 static ImageQualityController* imageQualityController() 136 { 137 static ImageQualityController* controller = new ImageQualityController; 138 return controller; 182 139 } 183 140 … … 204 161 } 205 162 163 bool RenderBoxModelObject::shouldPaintAtLowQuality(GraphicsContext* context, Image* image, const IntSize& size) 164 { 165 return imageQualityController()->shouldPaintAtLowQuality(context, this, image, size); 166 } 206 167 207 168 RenderBoxModelObject::RenderBoxModelObject(Node* node) … … 216 177 ASSERT(!hasLayer()); 217 178 ASSERT(!m_layer); 218 RenderBoxModelScaleObserver::boxModelObjectDestroyed(this);179 imageQualityController()->objectDestroyed(this); 219 180 } 220 181 … … 464 425 return padding.calcMinValue(w); 465 426 } 466 467 427 468 428 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& c, const FillLayer* bgLayer, int tx, int ty, int w, int h, InlineFlowBox* box, CompositeOperator op, RenderObject* backgroundObject) … … 632 592 RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this; 633 593 Image* image = bg->image(clientForBackgroundImage, tileSize); 634 bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, tileSize);594 bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, tileSize); 635 595 context->drawTiledImage(image, style()->colorSpace(), destRect, phase, tileSize, compositeOp, useLowQualityScaling); 636 596 } -
trunk/WebCore/rendering/RenderBoxModelObject.h
r60344 r61341 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 108 109 void calculateBackgroundImageGeometry(const FillLayer*, int tx, int ty, int w, int h, IntRect& destRect, IntPoint& phase, IntSize& tileSize); 109 110 111 bool shouldPaintAtLowQuality(GraphicsContext*, Image*, const IntSize&); 112 110 113 private: 111 114 virtual bool isBoxModelObject() const { return true; } -
trunk/WebCore/rendering/RenderImage.cpp
r60943 r61341 6 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 7 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 9 * 9 10 * This library is free software; you can redistribute it and/or … … 53 54 namespace WebCore { 54 55 55 static const double cInterpolationCutoff = 800. * 800.;56 static const double cLowQualityTimeThreshold = 0.050; // 50 ms57 58 class RenderImageScaleData : public Noncopyable {59 public:60 RenderImageScaleData(RenderImage* image, const IntSize& size, double time, bool lowQualityScale)61 : m_size(size)62 , m_time(time)63 , m_lowQualityScale(lowQualityScale)64 , m_highQualityRepaintTimer(image, &RenderImage::highQualityRepaintTimerFired)65 {66 }67 68 ~RenderImageScaleData()69 {70 m_highQualityRepaintTimer.stop();71 }72 73 const IntSize& size() const { return m_size; }74 double time() const { return m_time; }75 bool useLowQualityScale() const { return m_lowQualityScale; }76 Timer<RenderImage>& hiqhQualityRepaintTimer() { return m_highQualityRepaintTimer; }77 78 void setSize(const IntSize& s) { m_size = s; }79 void setTime(double t) { m_time = t; }80 void setUseLowQualityScale(bool b)81 {82 m_highQualityRepaintTimer.stop();83 m_lowQualityScale = b;84 if (b)85 m_highQualityRepaintTimer.startOneShot(cLowQualityTimeThreshold);86 }87 88 private:89 IntSize m_size;90 double m_time;91 bool m_lowQualityScale;92 Timer<RenderImage> m_highQualityRepaintTimer;93 };94 95 class RenderImageScaleObserver {96 public:97 static bool shouldImagePaintAtLowQuality(RenderImage*, const IntSize&);98 99 static void imageDestroyed(RenderImage* image)100 {101 if (gImages) {102 RenderImageScaleData* data = gImages->take(image);103 delete data;104 if (gImages->size() == 0) {105 delete gImages;106 gImages = 0;107 }108 }109 }110 111 static void highQualityRepaintTimerFired(RenderImage* image)112 {113 RenderImageScaleObserver::imageDestroyed(image);114 image->repaint();115 }116 117 static HashMap<RenderImage*, RenderImageScaleData*>* gImages;118 };119 120 bool RenderImageScaleObserver::shouldImagePaintAtLowQuality(RenderImage* image, const IntSize& size)121 {122 // If the image is not a bitmap image, then none of this is relevant and we just paint at high123 // quality.124 if (!image->image() || !image->image()->isBitmapImage())125 return false;126 127 // Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image128 // is actually being scaled.129 IntSize imageSize(image->image()->width(), image->image()->height());130 131 // Look ourselves up in the hashtable.132 RenderImageScaleData* data = 0;133 if (gImages)134 data = gImages->get(image);135 136 if (imageSize == size) {137 // There is no scale in effect. If we had a scale in effect before, we can just delete this data.138 if (data) {139 gImages->remove(image);140 delete data;141 }142 return false;143 }144 145 // There is no need to hash scaled images that always use low quality mode when the page demands it. This is the iChat case.146 if (image->document()->page()->inLowQualityImageInterpolationMode()) {147 double totalPixels = static_cast<double>(image->image()->width()) * static_cast<double>(image->image()->height());148 if (totalPixels > cInterpolationCutoff)149 return true;150 }151 152 // If there is no data yet, we will paint the first scale at high quality and record the paint time in case a second scale happens153 // very soon.154 if (!data) {155 data = new RenderImageScaleData(image, size, currentTime(), false);156 if (!gImages)157 gImages = new HashMap<RenderImage*, RenderImageScaleData*>;158 gImages->set(image, data);159 return false;160 }161 162 // We are scaled, but we painted already at this size, so just keep using whatever mode we last painted with.163 if (data->size() == size)164 return data->useLowQualityScale();165 166 // We have data and our size just changed. If this change happened quickly, go into low quality mode and then set a repaint167 // timer to paint in high quality mode. Otherwise it is ok to just paint in high quality mode.168 double newTime = currentTime();169 data->setUseLowQualityScale(newTime - data->time() < cLowQualityTimeThreshold);170 data->setTime(newTime);171 data->setSize(size);172 return data->useLowQualityScale();173 }174 175 HashMap<RenderImage*, RenderImageScaleData*>* RenderImageScaleObserver::gImages = 0;176 177 void RenderImage::highQualityRepaintTimerFired(Timer<RenderImage>*)178 {179 RenderImageScaleObserver::highQualityRepaintTimerFired(this);180 }181 182 56 using namespace HTMLNames; 183 57 … … 195 69 if (m_cachedImage) 196 70 m_cachedImage->removeClient(this); 197 RenderImageScaleObserver::imageDestroyed(this);198 71 } 199 72 … … 488 361 HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(node()) : 0; 489 362 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver; 490 bool useLowQualityScaling = RenderImageScaleObserver::shouldImagePaintAtLowQuality(this, rect.size());363 bool useLowQualityScaling = shouldPaintAtLowQuality(context, this->image(), rect.size()); 491 364 context->drawImage(image(rect.width(), rect.height()), style()->colorSpace(), rect, compositeOperator, useLowQualityScaling); 492 365 }
Note: See TracChangeset
for help on using the changeset viewer.