Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_action_button.mm

Issue 9837043: Initialize bitmap to (0, 0, 0, 0) for CanvasPaintT<T> instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unneeded clear for extension icons. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | skia/ext/canvas_paint_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 @end 312 @end
313 313
314 @implementation BrowserActionCell 314 @implementation BrowserActionCell
315 315
316 @synthesize tabId = tabId_; 316 @synthesize tabId = tabId_;
317 @synthesize extensionAction = extensionAction_; 317 @synthesize extensionAction = extensionAction_;
318 318
319 - (void)drawBadgeWithinFrame:(NSRect)frame { 319 - (void)drawBadgeWithinFrame:(NSRect)frame {
320 gfx::CanvasSkiaPaint canvas(frame, false); 320 gfx::CanvasSkiaPaint canvas(frame, false);
321 canvas.sk_canvas()->clear(SkColorSetARGB(0, 0, 0, 0));
322 canvas.set_composite_alpha(true); 321 canvas.set_composite_alpha(true);
323 gfx::Rect boundingRect(NSRectToCGRect(frame)); 322 gfx::Rect boundingRect(NSRectToCGRect(frame));
324 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_); 323 extensionAction_->PaintBadge(&canvas, boundingRect, tabId_);
325 } 324 }
326 325
327 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { 326 - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
328 gfx::ScopedNSGraphicsContextSaveGState scopedGState; 327 gfx::ScopedNSGraphicsContextSaveGState scopedGState;
329 [super drawInteriorWithFrame:cellFrame inView:controlView]; 328 [super drawInteriorWithFrame:cellFrame inView:controlView];
330 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; 329 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset;
331 [self drawBadgeWithinFrame:cellFrame]; 330 [self drawBadgeWithinFrame:cellFrame];
332 } 331 }
333 332
334 @end 333 @end
OLDNEW
« no previous file with comments | « no previous file | skia/ext/canvas_paint_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698