[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
kenneth at webkit.org
kenneth at webkit.org
Thu Oct 29 20:47:59 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit cd73270cbed7cd5fd2d09eceb022aeaec9cafb94
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 19 20:25:25 2009 +0000
Refactor out some of the code in paint() into paintPanScrollIcon()
and paintScrollbars() in preparation of some Qt API changes.
Patch by Kenneth Rohde Christiansen <kenneth at webkit.org> on 2009-10-19
Reviewed by David Hyatt.
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/ScrollView.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 564f364..b71093e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -32,6 +32,17 @@
2009-10-19 Kenneth Rohde Christiansen <kenneth at webkit.org>
+ Reviewed by David Hyatt.
+
+ Refactor out some of the code in paint() into paintPanScrollIcon()
+ and paintScrollbars() in preparation of some Qt API changes.
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::paint):
+ * platform/ScrollView.h:
+
+2009-10-19 Kenneth Rohde Christiansen <kenneth at webkit.org>
+
Reviewed by Adam Roben.
Make the local static panScrollIcon into a Image* instead
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 6fcfedf..ee8726a 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -751,6 +751,22 @@ void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& corn
ScrollbarTheme::nativeTheme()->paintScrollCorner(this, context, cornerRect);
}
+void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
+{
+ if (m_horizontalScrollbar)
+ m_horizontalScrollbar->paint(context, rect);
+ if (m_verticalScrollbar)
+ m_verticalScrollbar->paint(context, rect);
+
+ paintScrollCorner(context, scrollCornerRect());
+}
+
+void ScrollView::paintPanScrollIcon(GraphicsContext* context)
+{
+ DEFINE_STATIC_LOCAL(Image*, panScrollIcon, (Image::loadPlatformResource("panIcon").releaseRef()));
+ context->drawImage(panScrollIcon, m_panScrollIconPoint);
+}
+
void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
{
if (platformWidget()) {
@@ -785,20 +801,15 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
scrollViewDirtyRect.intersect(frameRect());
context->translate(x(), y());
scrollViewDirtyRect.move(-x(), -y());
- if (m_horizontalScrollbar)
- m_horizontalScrollbar->paint(context, scrollViewDirtyRect);
- if (m_verticalScrollbar)
- m_verticalScrollbar->paint(context, scrollViewDirtyRect);
- paintScrollCorner(context, scrollCornerRect());
+ paintScrollbars(context, scrollViewDirtyRect);
+
context->restore();
}
// Paint the panScroll Icon
- if (m_drawPanScrollIcon) {
- DEFINE_STATIC_LOCAL(Image*, panScrollIcon, (Image::loadPlatformResource("panIcon").releaseRef()));
- context->drawImage(panScrollIcon, m_panScrollIconPoint);
- }
+ if (m_drawPanScrollIcon)
+ paintPanScrollIcon(context);
}
bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint)
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 8fcdf60..1950a54 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -207,6 +207,7 @@ public:
// Widget override. Handles painting of the contents of the view as well as the scrollbars.
virtual void paint(GraphicsContext*, const IntRect&);
+ void paintScrollbars(GraphicsContext*, const IntRect&);
// Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
virtual void show();
@@ -217,6 +218,7 @@ public:
static const int noPanScrollRadius = 15;
void addPanScrollIcon(const IntPoint&);
void removePanScrollIcon();
+ void paintPanScrollIcon(GraphicsContext*);
virtual bool isPointInScrollbarCorner(const IntPoint&);
virtual bool scrollbarCornerPresent() const;
@@ -234,7 +236,7 @@ protected:
virtual void contentsResized() = 0;
virtual void visibleContentsResized() = 0;
-
+
// These methods are used to create/destroy scrollbars.
void setHasHorizontalScrollbar(bool);
void setHasVerticalScrollbar(bool);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list