Commit 6cafa099 authored by sail@chromium.org's avatar sail@chromium.org

Remove blur on bubble windows

Bubble windows sometimes had drawing artifacts. It looks like this was caused by the blur filter we added to those windows.

This CL removes the blur filter (partial revert of r134795 and r147628).

BUG=138761
TEST=Ran and verified that bubble windows looked ok on external display.


Review URL: https://chromiumcodereview.appspot.com/10833009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148451 0039d316-1c4b-4281-b951-d872f2087c98
parent 94387cbe
......@@ -137,10 +137,6 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
if (!window.get())
return nil;
// Don't blur the extension window background. This can interfer with OpenGL
// drawing on the window. See http://openradar.appspot.com/11920246
[window setHasBlurredBackground:NO];
anchoredAt = [parentWindow convertBaseToScreen:anchoredAt];
if ((self = [super initWithWindow:window
parentWindow:parentWindow
......
......@@ -62,7 +62,7 @@
[bezier lineToPoint:NSMakePoint(arrowStart.x + info_bubble::kBubbleArrowWidth,
arrowStart.y)];
[bezier closePath];
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.9] set];
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.96] set];
[bezier fill];
}
......
......@@ -21,17 +21,12 @@ class AppNotificationBridge;
// If NO the window will never become key.
// Default YES.
BOOL canBecomeKeyWindow_;
// If YES then things under the window will look blurred.
// Default YES.
BOOL hasBlurredBackground_;
// Bridge to proxy Chrome notifications to the window.
scoped_ptr<AppNotificationBridge> notificationBridge_;
}
@property(nonatomic) BOOL delayOnClose;
@property(nonatomic) BOOL canBecomeKeyWindow;
// Only has an effect if called before the bubble is shown.
@property(nonatomic) BOOL hasBlurredBackground;
// Returns YES if the window is in the process of closing.
// Can't use "windowWillClose" notification because that will be sent
......
......@@ -6,7 +6,6 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/memory/scoped_nsobject.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
......@@ -25,25 +24,6 @@ const NSTimeInterval kMinimumTimeInterval =
std::numeric_limits<NSTimeInterval>::min();
} // namespace
// Forward declare private window server functions used to style the window.
extern "C" {
typedef int CGSConnection;
typedef int CGSWindow;
typedef void* CGSWindowFilterRef;
CGSConnection _CGSDefaultConnection();
CGError CGSNewCIFilterByName(CGSConnection cid,
CFStringRef filterName,
CGSWindowFilterRef *outFilter);
CGError CGSAddWindowFilter(CGSConnection cid,
CGSWindow wid,
CGSWindowFilterRef filter,
int flags);
CGError CGSReleaseCIFilter(CGSConnection cid, CGSWindowFilterRef filter);
CGError CGSSetCIFilterValuesFromDictionary(
CGSConnection cid, CGSWindowFilterRef filter, CFDictionaryRef filterValues);
} // extern "C"
@interface InfoBubbleWindow (Private)
- (void)appIsTerminating;
- (void)finishCloseAfterAnimation;
......@@ -115,7 +95,6 @@ class AppNotificationBridge : public content::NotificationObserver {
@synthesize delayOnClose = delayOnClose_;
@synthesize canBecomeKeyWindow = canBecomeKeyWindow_;
@synthesize hasBlurredBackground = hasBlurredBackground_;
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)aStyle
......@@ -131,7 +110,6 @@ class AppNotificationBridge : public content::NotificationObserver {
[self setHasShadow:YES];
delayOnClose_ = YES;
canBecomeKeyWindow_ = YES;
hasBlurredBackground_ = YES;
notificationBridge_.reset(new AppNotificationBridge(self));
// Start invisible. Will be made visible when ordered front.
......@@ -224,25 +202,6 @@ class AppNotificationBridge : public content::NotificationObserver {
newOrigin.y += kOrderInSlideOffset;
[self setFrameOrigin:newOrigin];
// Add a gaussian blur to the window.
if (hasBlurredBackground_) {
CGSConnection cgsConnection = _CGSDefaultConnection();
CGSWindowFilterRef filter;
if (CGSNewCIFilterByName(cgsConnection, CFSTR("CIGaussianBlur"),
&filter) == kCGErrorSuccess) {
NSDictionary* blurOptions =
[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.5]
forKey:@"inputRadius"];
if (CGSSetCIFilterValuesFromDictionary(cgsConnection, filter,
base::mac::NSToCFCast(blurOptions)) == kCGErrorSuccess) {
CGSAddWindowFilter(cgsConnection, [self windowNumber], filter, 1);
}
CGSReleaseCIFilter(cgsConnection, filter);
}
}
// Apply animations to show and move self.
[NSAnimationContext beginGrouping];
// The star currently triggers on mouse down, not mouse up.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment