Chromium Mac: Use a custom pattern image for rubber banding overhang area
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Aug 2011 15:29:03 +0000 (15:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Aug 2011 15:29:03 +0000 (15:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66707

Also roll Chromium revision to 98101, to include dependency: http://codereview.chromium.org/7714036/

Patch by Alexei Svitkine <asvitkine@chromium.org> on 2011-08-26
Reviewed by Dimitri Glazkov.

No new tests since its just changing the Chromium-specific overhang pattern.

* platform/chromium/ScrollbarThemeChromiumMac.mm:
(WebCore::ScrollbarThemeChromiumMac::ScrollbarThemeChromiumMac):
(WebCore::ScrollbarThemeChromiumMac::paintOverhangAreas):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
Source/WebKit/chromium/DEPS

index a0c56f3..be7ebdd 100644 (file)
@@ -1,3 +1,18 @@
+2011-08-26  Alexei Svitkine  <asvitkine@chromium.org>
+
+        Chromium Mac: Use a custom pattern image for rubber banding overhang area
+        https://bugs.webkit.org/show_bug.cgi?id=66707
+
+        Also roll Chromium revision to 98101, to include dependency: http://codereview.chromium.org/7714036/
+
+        Reviewed by Dimitri Glazkov.
+
+        No new tests since its just changing the Chromium-specific overhang pattern.
+
+        * platform/chromium/ScrollbarThemeChromiumMac.mm:
+        (WebCore::ScrollbarThemeChromiumMac::ScrollbarThemeChromiumMac):
+        (WebCore::ScrollbarThemeChromiumMac::paintOverhangAreas):
+
 2011-08-26  Eric Carlson  <eric.carlson@apple.com>
 
         <video> playlist can not advance when playing in background tab
index 4af973d..1466839 100644 (file)
 #include <wtf/UnusedParam.h>
 
 #if USE(SKIA)
-#include "BitmapImageSingleFrameSkia.h"
 #include "PlatformContextSkia.h"
 #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.
 
@@ -200,24 +194,9 @@ ScrollbarThemeChromiumMac::ScrollbarThemeChromiumMac()
     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);
-#if USE(SKIA)
-                    SkBitmap bitmap = gfx::CGImageToSkBitmap(cgImage);
-                    RefPtr<Image> patternImage = BitmapImageSingleFrameSkia::create(bitmap, false);
-#else
-                    RefPtr<Image> patternImage = BitmapImage::create(cgImage);
-#endif                    
-                    m_overhangPattern = Pattern::create(patternImage, true, true);
-                }
-            }
-        }
+        // Load the linen pattern image used for overhang drawing.
+        RefPtr<Image> patternImage = Image::loadPlatformResource("overhangPattern");
+        m_overhangPattern = Pattern::create(patternImage, true, true);
 
         [ScrollbarPrefsObserver registerAsObserver];
         preferencesChanged();
@@ -718,11 +697,7 @@ void ScrollbarThemeChromiumMac::paintOverhangAreas(ScrollView* view, GraphicsCon
 
     context->save();
 
-    if (m_overhangPattern.get())
-        context->setFillPattern(m_overhangPattern);
-    else    
-        context->setFillColor(Color::darkGray, ColorSpaceDeviceRGB);
-
+    context->setFillPattern(m_overhangPattern);
     if (hasHorizontalOverhang)
         context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
     if (hasVerticalOverhang)
index fd62396..db6c497 100644 (file)
@@ -32,7 +32,7 @@
 
 vars = {
   'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
-  'chromium_rev': '97891'
+  'chromium_rev': '98101'
 }
 
 deps = {