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

Side by Side Diff: ui/base/cocoa/nsview_additions.mm

Issue 951063002: Mac: Fix bookmark button drawing regression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tracking
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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 #include "base/mac/sdk_forward_declarations.h" 5 #include "base/mac/sdk_forward_declarations.h"
6 #import "ui/base/cocoa/nsview_additions.h" 6 #import "ui/base/cocoa/nsview_additions.h"
7 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 7 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } else { 84 } else {
85 [transform translateXBy:-NSMinX(frame) yBy:NSMaxY(frame)]; 85 [transform translateXBy:-NSMinX(frame) yBy:NSMaxY(frame)];
86 [transform scaleXBy:1.0 yBy:-1.0]; 86 [transform scaleXBy:1.0 yBy:-1.0];
87 } 87 }
88 [transform concat]; 88 [transform concat];
89 89
90 // This can be made robust to recursive calls, but is as of yet unneeded. 90 // This can be made robust to recursive calls, but is as of yet unneeded.
91 DCHECK(!g_ancestorBeingDrawnFrom && !g_childBeingDrawnTo); 91 DCHECK(!g_ancestorBeingDrawnFrom && !g_childBeingDrawnTo);
92 g_ancestorBeingDrawnFrom = ancestorView; 92 g_ancestorBeingDrawnFrom = ancestorView;
93 g_childBeingDrawnTo = self; 93 g_childBeingDrawnTo = self;
94 [ancestorView drawRect:[self convertRect:dirtyRect toView:ancestorView]]; 94 [ancestorView drawRect:NSIntersectionRect(
95 [ancestorView bounds],
96 [self convertRect:dirtyRect toView:ancestorView])];
95 g_childBeingDrawnTo = nil; 97 g_childBeingDrawnTo = nil;
96 g_ancestorBeingDrawnFrom = nil; 98 g_ancestorBeingDrawnFrom = nil;
97 } 99 }
98 100
99 - (NSView*)cr_viewBeingDrawnTo { 101 - (NSView*)cr_viewBeingDrawnTo {
100 if (!g_ancestorBeingDrawnFrom) 102 if (!g_ancestorBeingDrawnFrom)
101 return self; 103 return self;
102 DCHECK(g_ancestorBeingDrawnFrom == self); 104 DCHECK(g_ancestorBeingDrawnFrom == self);
103 return g_childBeingDrawnTo; 105 return g_childBeingDrawnTo;
104 } 106 }
105 107
106 @end 108 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698