summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/throbber_view.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 21:57:48 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 21:57:48 +0000
commitb360895e1e4ba2db735f82d85563a631e1cc0c5b (patch)
tree1752bbb98415a9e661ac04592be5c63b9d51f699 /chrome/browser/cocoa/throbber_view.mm
parent43f0899d89c0ca4697ea51439d1541af16749ff8 (diff)
downloadchromium_src-b360895e1e4ba2db735f82d85563a631e1cc0c5b.zip
chromium_src-b360895e1e4ba2db735f82d85563a631e1cc0c5b.tar.gz
chromium_src-b360895e1e4ba2db735f82d85563a631e1cc0c5b.tar.bz2
Put back in code that installs ThrobberView, but comment out timer. Add a big comment about why this is so slow. BUG=none TEST=none.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/throbber_view.mm')
-rw-r--r--chrome/browser/cocoa/throbber_view.mm18
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/throbber_view.mm b/chrome/browser/cocoa/throbber_view.mm
index b93f45d..26f8ec5 100644
--- a/chrome/browser/cocoa/throbber_view.mm
+++ b/chrome/browser/cocoa/throbber_view.mm
@@ -61,6 +61,17 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
}
image_.reset([[CIImage alloc] initWithBitmapImageRep:rep]);
+#if 0
+// TODO(pinkerton): The invalidation of the view to trigger re-draw causes
+// the entire title-bar to redraw (you can see it with QuartzDebug). For some
+// reason, setting isOpaque on this view, or any of its parent views, doesn't
+// help. As a result, enabling this timer causes new tab to take a very long
+// time on a loaded machine, crushing our perf bot when it's under load. For
+// now, I'm disabling the timer so we draw the first frame of the animation,
+// but nothing more. There are a couple of ways we can fix this:
+// 1) Try to figure out why the invalidate is invalidating the entire title bar
+// 2) Find some way to draw only the pixels we want and nothing else, but I
+// don't know how we'd do that.
// Start a timer for the animation frames.
target_.reset([[TimerTarget alloc] initWithThrobber:self]);
timer_ =
@@ -69,6 +80,7 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
selector:@selector(animate:)
userInfo:nil
repeats:YES];
+#endif
}
return self;
}
@@ -78,10 +90,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
[super dealloc];
}
-- (BOOL)isOpaque {
- return YES;
-}
-
- (void)removeFromSuperview {
[timer_ invalidate];
timer_ = nil;
@@ -98,7 +106,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
// Overridden to draw the appropriate frame in the image strip.
- (void)drawRect:(NSRect)rect {
-#if 0
float imageDimension = [image_ extent].size.height;
float xOffset = animationFrame_ * imageDimension;
NSRect sourceImageRect =
@@ -107,7 +114,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
fromRect:sourceImageRect
operation:NSCompositeSourceOver
fraction:1.0];
-#endif
}
@end