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

Side by Side Diff: ui/views/view.cc

Issue 1836993004: Fix bubble client area clipping regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 if (paint_relative_to_parent) { 806 if (paint_relative_to_parent) {
807 // Set the clip rect to the bounds of this View, or |clip_path_| if it's 807 // Set the clip rect to the bounds of this View, or |clip_path_| if it's
808 // been set. Note that the X (or left) position we pass to ClipRect takes 808 // been set. Note that the X (or left) position we pass to ClipRect takes
809 // into consideration whether or not the View uses a right-to-left layout so 809 // into consideration whether or not the View uses a right-to-left layout so
810 // that we paint the View in its mirrored position if need be. 810 // that we paint the View in its mirrored position if need be.
811 if (clip_path_.isEmpty()) { 811 if (clip_path_.isEmpty()) {
812 clip_recorder.ClipRect(GetMirroredBounds()); 812 clip_recorder.ClipRect(GetMirroredBounds());
813 } else { 813 } else {
814 gfx::Path clip_path_in_parent = clip_path_; 814 gfx::Path clip_path_in_parent = clip_path_;
815 clip_path_in_parent.offset(GetMirroredX(), y()); 815 clip_path_in_parent.offset(GetMirroredX(), y());
816 clip_recorder.ClipPath(clip_path_in_parent); 816 clip_recorder.ClipPathWithAntiAliasing(clip_path_in_parent);
Evan Stade 2016/03/29 01:27:58 I tried to avoid this before and instead inset by
msw 2016/03/29 23:08:27 Maybe add a comment about why the aa is needed her
Evan Stade 2016/03/29 23:11:52 Do you have a suggestion for a good comment? It se
msw 2016/03/29 23:19:13 Shrug, I don't understand why it would have transp
817 } 817 }
818 } 818 }
819 819
820 ui::TransformRecorder transform_recorder(context); 820 ui::TransformRecorder transform_recorder(context);
821 if (paint_relative_to_parent) { 821 if (paint_relative_to_parent) {
822 // Translate the graphics such that 0,0 corresponds to where 822 // Translate the graphics such that 0,0 corresponds to where
823 // this View is located relative to its parent. 823 // this View is located relative to its parent.
824 gfx::Transform transform_from_parent; 824 gfx::Transform transform_from_parent;
825 gfx::Vector2d offset_from_parent = GetMirroredPosition().OffsetFromOrigin(); 825 gfx::Vector2d offset_from_parent = GetMirroredPosition().OffsetFromOrigin();
826 transform_from_parent.Translate(offset_from_parent.x(), 826 transform_from_parent.Translate(offset_from_parent.x(),
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 // Message the RootView to do the drag and drop. That way if we're removed 2425 // Message the RootView to do the drag and drop. That way if we're removed
2426 // the RootView can detect it and avoid calling us back. 2426 // the RootView can detect it and avoid calling us back.
2427 gfx::Point widget_location(event.location()); 2427 gfx::Point widget_location(event.location());
2428 ConvertPointToWidget(this, &widget_location); 2428 ConvertPointToWidget(this, &widget_location);
2429 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2429 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2430 // WARNING: we may have been deleted. 2430 // WARNING: we may have been deleted.
2431 return true; 2431 return true;
2432 } 2432 }
2433 2433
2434 } // namespace views 2434 } // namespace views
OLDNEW
« ui/views/bubble/bubble_frame_view.cc ('K') | « ui/views/bubble/bubble_frame_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698