Title: [102476] trunk/Source/WebCore
- Revision
- 102476
- Author
- [email protected]
- Date
- 2011-12-09 14:48:01 -0800 (Fri, 09 Dec 2011)
Log Message
Move the "is currently drawing into layer" flag out into ScrollbarThemeMac
https://bugs.webkit.org/show_bug.cgi?id=74217
Reviewed by Beth Dakin.
There's no need to store this flag inside ScrollAnimatorMac, just make it a global and put it in ScrollbarThemeMac instead.
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterDelegate layer]):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::isCurrentlyDrawingIntoLayer):
(WebCore::ScrollbarThemeMac::paint):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (102475 => 102476)
--- trunk/Source/WebCore/ChangeLog 2011-12-09 22:42:31 UTC (rev 102475)
+++ trunk/Source/WebCore/ChangeLog 2011-12-09 22:48:01 UTC (rev 102476)
@@ -1,5 +1,23 @@
2011-12-09 Anders Carlsson <[email protected]>
+ Move the "is currently drawing into layer" flag out into ScrollbarThemeMac
+ https://bugs.webkit.org/show_bug.cgi?id=74217
+
+ Reviewed by Beth Dakin.
+
+ There's no need to store this flag inside ScrollAnimatorMac, just make it a global and put it in ScrollbarThemeMac instead.
+
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (-[WebScrollbarPainterDelegate layer]):
+ (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+ * platform/mac/ScrollbarThemeMac.h:
+ * platform/mac/ScrollbarThemeMac.mm:
+ (WebCore::ScrollbarThemeMac::isCurrentlyDrawingIntoLayer):
+ (WebCore::ScrollbarThemeMac::paint):
+
+2011-12-09 Anders Carlsson <[email protected]>
+
Minor cleanup in ScrollAnimatorMac.mm
https://bugs.webkit.org/show_bug.cgi?id=74211
Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h (102475 => 102476)
--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h 2011-12-09 22:42:31 UTC (rev 102475)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h 2011-12-09 22:48:01 UTC (rev 102476)
@@ -82,9 +82,6 @@
void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition);
- void setIsDrawingIntoLayer(bool b) { m_drawingIntoLayer = b; }
- bool isDrawingIntoLayer() const { return m_drawingIntoLayer; }
-
bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad; }
virtual void setIsActive();
@@ -161,7 +158,6 @@
Timer<ScrollAnimatorMac> m_snapRubberBandTimer;
#endif
- bool m_drawingIntoLayer;
bool m_haveScrolledSincePageLoad;
bool m_needsScrollerStyleUpdate;
IntRect m_visibleScrollerThumbRect;
Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (102475 => 102476)
--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2011-12-09 22:42:31 UTC (rev 102475)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2011-12-09 22:48:01 UTC (rev 102476)
@@ -413,7 +413,7 @@
if (!_scrollbar)
return nil;
- if (![self scrollAnimator]->isDrawingIntoLayer())
+ if (!ScrollbarThemeMac::isCurrentlyDrawingIntoLayer())
return nil;
// FIXME: This should attempt to return an actual layer.
@@ -558,7 +558,6 @@
, m_scrollElasticityController(this)
, m_snapRubberBandTimer(this, &ScrollAnimatorMac::snapRubberBandTimerFired)
#endif
- , m_drawingIntoLayer(false)
, m_haveScrolledSincePageLoad(false)
, m_needsScrollerStyleUpdate(false)
{
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (102475 => 102476)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2011-12-09 22:42:31 UTC (rev 102475)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2011-12-09 22:48:01 UTC (rev 102476)
@@ -62,6 +62,8 @@
#if USE(SCROLLBAR_PAINTER)
void setNewPainterForScrollbar(Scrollbar*, ScrollbarPainter);
ScrollbarPainter painterForScrollbar(Scrollbar*);
+
+ static bool isCurrentlyDrawingIntoLayer();
#endif
protected:
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (102475 => 102476)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm 2011-12-09 22:42:31 UTC (rev 102475)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm 2011-12-09 22:48:01 UTC (rev 102476)
@@ -36,6 +36,7 @@
#include <Carbon/Carbon.h>
#include <wtf/HashMap.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/TemporaryChange.h>
#include <wtf/UnusedParam.h>
// FIXME: There are repainting problems due to Aqua scroll bar buttons' visual overflow.
@@ -185,6 +186,14 @@
{
return scrollbarMap()->get(scrollbar).get();
}
+
+static bool g_isCurrentlyDrawingIntoLayer;
+
+bool ScrollbarThemeMac::isCurrentlyDrawingIntoLayer()
+{
+ return g_isCurrentlyDrawingIntoLayer;
+}
+
#endif
ScrollbarThemeMac::ScrollbarThemeMac()
@@ -513,10 +522,9 @@
else
value = 0;
}
+
+ TemporaryChange<bool> isCurrentlyDrawingIntoLayer(g_isCurrentlyDrawingIntoLayer, context->isCALayerContext());
- ScrollAnimatorMac* scrollAnimator = static_cast<ScrollAnimatorMac*>(scrollbar->scrollableArea()->scrollAnimator());
- scrollAnimator->setIsDrawingIntoLayer(context->isCALayerContext());
-
GraphicsContextStateSaver stateSaver(*context);
context->clip(damageRect);
context->translate(scrollbar->frameRect().x(), scrollbar->frameRect().y());
@@ -527,7 +535,6 @@
(static_cast<CGFloat>(scrollbar->visibleSize()) - overhang) / scrollbar->totalSize(),
scrollbar->frameRect());
- scrollAnimator->setIsDrawingIntoLayer(false);
return true;
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes