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

Unified Diff: ui/base/cocoa/constrained_window/constrained_window_animation.mm

Issue 1817233002: Temporarily disable all calls of CGS private APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/constrained_window/constrained_window_animation.mm
diff --git a/ui/base/cocoa/constrained_window/constrained_window_animation.mm b/ui/base/cocoa/constrained_window/constrained_window_animation.mm
index 3618a1b97825fc36365861ab3d3928d170cb3f2b..669300263400aca9c196dd50152ee6bc8e7b2196 100644
--- a/ui/base/cocoa/constrained_window/constrained_window_animation.mm
+++ b/ui/base/cocoa/constrained_window/constrained_window_animation.mm
@@ -93,38 +93,41 @@ NSPoint GetCGSWindowScreenOrigin(NSWindow* window) {
// Set the transparency of the window.
void SetWindowAlpha(NSWindow* window, float alpha) {
- CGSConnection cid = _CGSDefaultConnection();
- CGSSetWindowAlpha(cid, [window windowNumber], alpha);
+ // TODO(erikchen): Temporarily disabled. https://crbug.com/515627.
+ // CGSConnection cid = _CGSDefaultConnection();
+ // CGSSetWindowAlpha(cid, [window windowNumber], alpha);
}
// Scales the window and translates it so that it stays centered relative
// to its original position.
void SetWindowScale(NSWindow* window, float scale) {
- CGFloat scale_delta = 1.0 - scale;
- CGFloat cur_scale = 1.0 + scale_delta;
- CGAffineTransform transform =
- CGAffineTransformMakeScale(cur_scale, cur_scale);
-
- // Translate the window to keep it centered at the original location.
- NSSize window_size = [window frame].size;
- CGFloat scale_offset_x = window_size.width * (1 - cur_scale) / 2.0;
- CGFloat scale_offset_y = window_size.height * (1 - cur_scale) / 2.0;
-
- NSPoint origin = GetCGSWindowScreenOrigin(window);
- CGFloat new_x = -origin.x + scale_offset_x;
- CGFloat new_y = -origin.y + scale_offset_y;
- transform = CGAffineTransformTranslate(transform, new_x, new_y);
-
- CGSConnection cid = _CGSDefaultConnection();
- CGSSetWindowTransform(cid, [window windowNumber], transform);
+ // TODO(erikchen): Temporarily disabled. https://crbug.com/515627.
+ // CGFloat scale_delta = 1.0 - scale;
+ // CGFloat cur_scale = 1.0 + scale_delta;
+ // CGAffineTransform transform =
+ // CGAffineTransformMakeScale(cur_scale, cur_scale);
+
+ // // Translate the window to keep it centered at the original location.
+ // NSSize window_size = [window frame].size;
+ // CGFloat scale_offset_x = window_size.width * (1 - cur_scale) / 2.0;
+ // CGFloat scale_offset_y = window_size.height * (1 - cur_scale) / 2.0;
+
+ // NSPoint origin = GetCGSWindowScreenOrigin(window);
+ // CGFloat new_x = -origin.x + scale_offset_x;
+ // CGFloat new_y = -origin.y + scale_offset_y;
+ // transform = CGAffineTransformTranslate(transform, new_x, new_y);
+
+ // CGSConnection cid = _CGSDefaultConnection();
+ // CGSSetWindowTransform(cid, [window windowNumber], transform);
}
// Unsets any window warp that may have been previously applied.
// Window warp prevents other effects such as CGSSetWindowTransform from
// being applied.
void ClearWindowWarp(NSWindow* window) {
- CGSConnection cid = _CGSDefaultConnection();
- CGSSetWindowWarp(cid, [window windowNumber], 0, 0, NULL);
+ // TODO(erikchen): Temporarily disabled. https://crbug.com/515627.
+ // CGSConnection cid = _CGSDefaultConnection();
+ // CGSSetWindowWarp(cid, [window windowNumber], 0, 0, NULL);
}
// Applies various transformations using a warp effect. The window is
@@ -135,43 +138,44 @@ void SetWindowWarp(NSWindow* window,
float y_offset,
float scale,
float perspective_offset) {
- NSRect win_rect = [window frame];
- win_rect.origin = NSZeroPoint;
- NSRect screen_rect = win_rect;
- screen_rect.origin = GetCGSWindowScreenOrigin(window);
-
- // Apply a vertical translate.
- screen_rect.origin.y -= y_offset;
-
- // Apply a scale and translate to keep the window centered.
- screen_rect.origin.x += (NSWidth(win_rect) - NSWidth(screen_rect)) / 2.0;
- screen_rect.origin.y += (NSHeight(win_rect) - NSHeight(screen_rect)) / 2.0;
-
- // A 2 x 2 mesh that maps each corner of the window to a location in screen
- // coordinates. Note that the origin of the coordinate system is top, left.
- CGPointWarp mesh[2][2] = {
- {{
- // Top left.
- {NSMinX(win_rect), NSMinY(win_rect)},
- {NSMinX(screen_rect) + perspective_offset, NSMinY(screen_rect)},
- },
- {
- // Top right.
- {NSMaxX(win_rect), NSMinY(win_rect)},
- {NSMaxX(screen_rect) - perspective_offset, NSMinY(screen_rect)}, }},
- {{
- // Bottom left.
- {NSMinX(win_rect), NSMaxY(win_rect)},
- {NSMinX(screen_rect), NSMaxY(screen_rect)},
- },
- {
- // Bottom right.
- {NSMaxX(win_rect), NSMaxY(win_rect)},
- {NSMaxX(screen_rect), NSMaxY(screen_rect)}, }},
- };
-
- CGSConnection cid = _CGSDefaultConnection();
- CGSSetWindowWarp(cid, [window windowNumber], 2, 2, &(mesh[0][0]));
+ // TODO(erikchen): Temporarily disabled. https://crbug.com/515627.
+ // NSRect win_rect = [window frame];
+ // win_rect.origin = NSZeroPoint;
+ // NSRect screen_rect = win_rect;
+ // screen_rect.origin = GetCGSWindowScreenOrigin(window);
+
+ // // Apply a vertical translate.
+ // screen_rect.origin.y -= y_offset;
+
+ // // Apply a scale and translate to keep the window centered.
+ // screen_rect.origin.x += (NSWidth(win_rect) - NSWidth(screen_rect)) / 2.0;
+ // screen_rect.origin.y += (NSHeight(win_rect) - NSHeight(screen_rect)) / 2.0;
+
+ // // A 2 x 2 mesh that maps each corner of the window to a location in screen
+ // // coordinates. Note that the origin of the coordinate system is top, left.
+ // CGPointWarp mesh[2][2] = {
+ // {{
+ // // Top left.
+ // {NSMinX(win_rect), NSMinY(win_rect)},
+ // {NSMinX(screen_rect) + perspective_offset, NSMinY(screen_rect)},
+ // },
+ // {
+ // // Top right.
+ // {NSMaxX(win_rect), NSMinY(win_rect)},
+ // {NSMaxX(screen_rect) - perspective_offset, NSMinY(screen_rect)}, }},
+ // {{
+ // // Bottom left.
+ // {NSMinX(win_rect), NSMaxY(win_rect)},
+ // {NSMinX(screen_rect), NSMaxY(screen_rect)},
+ // },
+ // {
+ // // Bottom right.
+ // {NSMaxX(win_rect), NSMaxY(win_rect)},
+ // {NSMaxX(screen_rect), NSMaxY(screen_rect)}, }},
+ // };
+
+ // CGSConnection cid = _CGSDefaultConnection();
+ // CGSSetWindowWarp(cid, [window windowNumber], 2, 2, &(mesh[0][0]));
}
// Sets the various effects that are a part of the Show/Hide animation.
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698