Title: [93645] trunk/Source/WebCore
Revision
93645
Author
[email protected]
Date
2011-08-23 15:59:34 -0700 (Tue, 23 Aug 2011)

Log Message

Chromium Mac: Use a custom pattern image for rubber banding overhang area
https://bugs.webkit.org/show_bug.cgi?id=66707

Patch by Alexei Svitkine <[email protected]> on 2011-08-23
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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (93644 => 93645)


--- trunk/Source/WebCore/ChangeLog	2011-08-23 22:57:49 UTC (rev 93644)
+++ trunk/Source/WebCore/ChangeLog	2011-08-23 22:59:34 UTC (rev 93645)
@@ -1,3 +1,16 @@
+2011-08-23  Alexei Svitkine  <[email protected]>
+
+        Chromium Mac: Use a custom pattern image for rubber banding overhang area
+        https://bugs.webkit.org/show_bug.cgi?id=66707
+
+        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-23  Tatiana Meshkova  <[email protected]>
 
         Prepare to paint slider thumb separately.

Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm (93644 => 93645)


--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm	2011-08-23 22:57:49 UTC (rev 93644)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm	2011-08-23 22:59:34 UTC (rev 93645)
@@ -42,18 +42,12 @@
 #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.
 
 using namespace std;
@@ -200,24 +194,9 @@
     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 @@
 
     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)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to