Diff
Modified: trunk/Source/WebCore/ChangeLog (93119 => 93120)
--- trunk/Source/WebCore/ChangeLog 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/ChangeLog 2011-08-16 16:57:42 UTC (rev 93120)
@@ -1,3 +1,23 @@
+2011-08-16 Tony Chang <[email protected]>
+
+ Unreviewed, rolling out r93114.
+ http://trac.webkit.org/changeset/93114
+ https://bugs.webkit.org/show_bug.cgi?id=66226
+
+ broke the chromium mac compile
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::wheelEvent):
+ * platform/ScrollbarTheme.h:
+ * platform/ScrollbarThemeComposite.cpp:
+ * platform/ScrollbarThemeComposite.h:
+ * platform/chromium/ScrollbarThemeChromiumMac.h:
+ * platform/chromium/ScrollbarThemeChromiumMac.mm:
+ (WebCore::ScrollbarThemeChromiumMac::ScrollbarThemeChromiumMac):
+ (WebCore::scrollbarStateToThemeState):
+ (WebCore::ScrollbarThemeChromiumMac::paintTickmarks):
+ * platform/mac/ScrollbarThemeMac.h:
+
2011-08-16 Alexei Svitkine <[email protected]>
Chromium Mac: Rubber banding gutter drawing
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (93119 => 93120)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2011-08-16 16:57:42 UTC (rev 93120)
@@ -1086,9 +1086,17 @@
}
}
-void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect&)
{
- ScrollbarTheme::nativeTheme()->paintOverhangAreas(this, context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
+ // FIXME: This should be checking the dirty rect.
+
+ context->setFillColor(Color::white, ColorSpaceDeviceRGB);
+ if (!horizontalOverhangRect.isEmpty())
+ context->fillRect(horizontalOverhangRect);
+
+ context->setFillColor(Color::white, ColorSpaceDeviceRGB);
+ if (!verticalOverhangRect.isEmpty())
+ context->fillRect(verticalOverhangRect);
}
bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint)
Modified: trunk/Source/WebCore/platform/ScrollbarTheme.h (93119 => 93120)
--- trunk/Source/WebCore/platform/ScrollbarTheme.h 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/ScrollbarTheme.h 2011-08-16 16:57:42 UTC (rev 93120)
@@ -82,8 +82,6 @@
virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
static void defaultPaintScrollCorner(GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
- virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect&, const IntRect&, const IntRect&) { }
-
virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&) { return false; }
virtual bool shouldSnapBackToDragOrigin(Scrollbar*, const PlatformMouseEvent&) { return false; }
virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar*, const PlatformMouseEvent&) { return false; }
Modified: trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp (93119 => 93120)
--- trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp 2011-08-16 16:57:42 UTC (rev 93120)
@@ -315,15 +315,4 @@
context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
}
-void ScrollbarThemeComposite::paintOverhangAreas(ScrollView*, GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
-{
- context->setFillColor(Color::white, ColorSpaceDeviceRGB);
- if (!horizontalOverhangRect.isEmpty())
- context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
-
- context->setFillColor(Color::white, ColorSpaceDeviceRGB);
- if (!verticalOverhangRect.isEmpty())
- context->fillRect(intersection(verticalOverhangRect, dirtyRect));
}
-
-}
Modified: trunk/Source/WebCore/platform/ScrollbarThemeComposite.h (93119 => 93120)
--- trunk/Source/WebCore/platform/ScrollbarThemeComposite.h 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/ScrollbarThemeComposite.h 2011-08-16 16:57:42 UTC (rev 93120)
@@ -44,7 +44,6 @@
virtual int trackLength(Scrollbar*);
virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect);
- virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
protected:
virtual bool hasButtons(Scrollbar*) = 0;
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h (93119 => 93120)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-08-16 16:57:42 UTC (rev 93120)
@@ -40,8 +40,6 @@
ScrollbarThemeChromiumMac();
virtual ~ScrollbarThemeChromiumMac();
- void preferencesChanged();
-
virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
@@ -60,8 +58,6 @@
void setNewPainterForScrollbar(Scrollbar*, WKScrollbarPainterRef);
WKScrollbarPainterRef painterForScrollbar(Scrollbar*);
- virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
-
protected:
virtual bool hasButtons(Scrollbar*);
virtual bool hasThumb(Scrollbar*);
@@ -77,8 +73,8 @@
virtual void paintTickmarks(GraphicsContext*, Scrollbar*, const IntRect&);
-private:
- RefPtr<Pattern> m_overhangPattern;
+public:
+ void preferencesChanged();
};
}
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm (93119 => 93120)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-08-16 16:57:42 UTC (rev 93120)
@@ -27,9 +27,7 @@
#include "config.h"
#include "ScrollbarThemeChromiumMac.h"
-#include "BitmapImage.h"
#include "FrameView.h"
-#include "Gradient.h"
#include "ImageBuffer.h"
#include "LocalCurrentGraphicsContext.h"
#include "PlatformBridge.h"
@@ -46,13 +44,6 @@
#include "skia/ext/skia_utils_mac.h"
#endif
-
-// Undocumented Lion method to get the pattern for the over-scroll area.
-@interface NSColor (LionSekretAPI)
-+ (NSImage*)_linenPatternImage;
-@end
-
-
// FIXME: There are repainting problems due to Aqua scroll bar buttons' visual overflow.
using namespace std;
@@ -194,21 +185,6 @@
static bool initialized;
if (!initialized) {
initialized = true;
-
- // Load the linen pattern image used for overhang drawing if available.
- if ([NSColor respondsToSelector:@selector(_linenPatternImage)]) {
- NSImage* image = [NSColor _linenPatternImage];
- if (image) {
- NSData* tiffData = [image TIFFRepresentation];
- if (tiffData) {
- CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)tiffData, NULL);
- CGImageRef cgImage = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL);
- RefPtr<Image> patternImage = BitmapImage::create(cgImage);
- m_overhangPattern = Pattern::create(patternImage, true, true);
- }
- }
- }
-
[ScrollbarPrefsObserver registerAsObserver];
preferencesChanged();
}
@@ -460,8 +436,7 @@
}
}
-static PlatformBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scrollbar)
-{
+static PlatformBridge::ThemePaintState scrollbarStateToThemeState(Scrollbar* scrollbar) {
if (!scrollbar->enabled())
return PlatformBridge::StateDisabled;
if (!scrollbar->scrollableArea()->isActive())
@@ -623,8 +598,7 @@
return true;
}
-void ScrollbarThemeChromiumMac::paintTickmarks(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
-{
+void ScrollbarThemeChromiumMac::paintTickmarks(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect) {
if (scrollbar->orientation() != VerticalScrollbar)
return;
@@ -669,98 +643,4 @@
context->restore();
}
-void ScrollbarThemeChromiumMac::paintOverhangAreas(ScrollView* view, GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
-{
- const int kShadowSize = 5;
- const struct {
- float stop;
- Color color;
- } kShadowColors[] = {
- { 0.0, Color(0, 0, 0, 141) },
- { 0.2, Color(0, 0, 0, 89) },
- { 0.6, Color(0, 0, 0, 30) },
- { 1.0, Color(0, 0, 0, 0) }
- };
-
- bool hasHorizontalOverhang = !horizontalOverhangRect.isEmpty();
- bool hasVerticalOverhang = !verticalOverhangRect.isEmpty();
-
- context->save();
-
- if (m_overhangPattern.get())
- context->setFillPattern(m_overhangPattern);
- else
- context->setFillColor(Color::darkGray, ColorSpaceDeviceRGB);
-
- if (hasHorizontalOverhang)
- context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
- if (hasVerticalOverhang)
- context->fillRect(intersection(verticalOverhangRect, dirtyRect));
-
- IntSize scrollOffset = view->scrollOffset();
- FloatPoint shadowCornerOrigin;
- FloatPoint shadowCornerOffset;
-
- // Draw the shadow for the horizontal overhang.
- if (hasHorizontalOverhang) {
- RefPtr<Gradient> gradient;
- IntRect shadowRect = horizontalOverhangRect;
- if (scrollOffset.height() < 0) {
- shadowRect.setY(shadowRect.maxY() - kShadowSize);
- shadowRect.setHeight(kShadowSize);
- gradient = Gradient::create(FloatPoint(0, shadowRect.maxY()), FloatPoint(0, shadowRect.y()));
- shadowCornerOrigin.setY(shadowRect.maxY());
- shadowCornerOffset.setY(-kShadowSize);
- } else {
- shadowRect.setHeight(kShadowSize);
- gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.maxY()));
- shadowCornerOrigin.setY(shadowRect.y());
- }
- if (hasHorizontalOverhang) {
- shadowRect.setWidth(shadowRect.width() - verticalOverhangRect.width());
- if (scrollOffset.width() < 0) {
- shadowRect.setX(shadowRect.x() + verticalOverhangRect.width());
- shadowCornerOrigin.setX(shadowRect.x());
- shadowCornerOffset.setX(-kShadowSize);
- } else {
- shadowCornerOrigin.setX(shadowRect.maxX());
- }
- }
- for (unsigned i = 0; i < WTF_ARRAY_LENGTH(kShadowColors); i++)
- gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
- context->setFillGradient(gradient);
- context->fillRect(intersection(shadowRect, dirtyRect));
- }
-
- // Draw the shadow for the vertical overhang.
- if (hasVerticalOverhang) {
- RefPtr<Gradient> gradient;
- IntRect shadowRect = verticalOverhangRect;
- if (scrollOffset.width() < 0) {
- shadowRect.setX(shadowRect.maxX() - kShadowSize);
- shadowRect.setWidth(kShadowSize);
- gradient = Gradient::create(FloatPoint(shadowRect.maxX(), 0), FloatPoint(shadowRect.x(), 0));
- } else {
- shadowRect.setWidth(kShadowSize);
- gradient = Gradient::create(FloatPoint(shadowRect.x(), 0), FloatPoint(shadowRect.maxX(), 0));
- }
- for (unsigned i = 0; i < WTF_ARRAY_LENGTH(kShadowColors); i++)
- gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
- context->setFillGradient(gradient);
- context->fillRect(intersection(shadowRect, dirtyRect));
- }
-
- // If both rectangles present, draw a radial gradient for the corner.
- if (hasHorizontalOverhang && hasVerticalOverhang) {
- RefPtr<Gradient> gradient = Gradient::create(shadowCornerOrigin, 0, shadowCornerOrigin, kShadowSize);
- for (unsigned i = 0; i < WTF_ARRAY_LENGTH(kShadowColors); i++)
- gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
- context->setFillGradient(gradient);
- context->fillRect(FloatRect(shadowCornerOrigin.x() + shadowCornerOffset.x(), shadowCornerOrigin.y() + shadowCornerOffset.y(), kShadowSize, kShadowSize));
- }
-
- context->restore();
}
-
-
-}
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (93119 => 93120)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2011-08-16 16:56:02 UTC (rev 93119)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2011-08-16 16:57:42 UTC (rev 93120)
@@ -39,8 +39,6 @@
ScrollbarThemeMac();
virtual ~ScrollbarThemeMac();
- void preferencesChanged();
-
virtual void updateEnabledState(Scrollbar*);
virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
@@ -78,6 +76,9 @@
virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar*, const PlatformMouseEvent&);
+
+public:
+ void preferencesChanged();
};
}