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

Unified Diff: ui/views/bubble/bubble_border.h

Issue 1633403002: MacViews: Add native drop shadow to dialogs on OSX < 10.10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: ui/views/bubble/bubble_border.h
diff --git a/ui/views/bubble/bubble_border.h b/ui/views/bubble/bubble_border.h
index fac3a719a474b9771fda692b4fad20bfb99a868c..2aff6de66af9744dbf0f3f3f56fab26f67637442 100644
--- a/ui/views/bubble/bubble_border.h
+++ b/ui/views/bubble/bubble_border.h
@@ -15,8 +15,11 @@
namespace gfx {
class Rect;
+class Path;
}
+class SkPath;
+
namespace views {
class Painter;
@@ -204,6 +207,12 @@ class VIEWS_EXPORT BubbleBorder : public Border {
// Gets the arrow offset to use.
int GetArrowOffset(const gfx::Size& border_size) const;
+ // Returns the arrow mask/path given |view_bounds|. |view_bounds| should be in
+ // it's own coordinates(i.e. with origin at (0,0)). An empty mask is returned
tapted 2016/01/28 05:59:22 nit: it's -> its, `coordinates(i.e. with origin at
karandeepb 2016/02/04 03:39:27 Done.
+ // in case the border doesn't have an arrow or the arrow paint type is not
+ // PAINT_NORMAL.
+ void GetArrowMask(const gfx::Rect& view_bounds, gfx::Path* mask) const;
tapted 2016/01/28 05:59:22 I think GetArrowPath is a better name for it, sinc
karandeepb 2016/02/04 03:39:28 Done.
+
// Overridden from Border:
void Paint(const View& view, gfx::Canvas* canvas) override;
gfx::Insets GetInsets() const override;
@@ -220,6 +229,8 @@ class VIEWS_EXPORT BubbleBorder : public Border {
gfx::Size GetSizeForContentsSize(const gfx::Size& contents_size) const;
gfx::ImageSkia* GetArrowImage() const;
gfx::Rect GetArrowRect(const gfx::Rect& bounds) const;
+ void GetArrowMaskFromArrowBounds(const gfx::Rect& arrow_bounds,
tapted 2016/01/28 05:59:22 Mask/mask -> Path/path
karandeepb 2016/02/04 03:39:27 Done.
+ SkPath* mask) const;
void DrawArrow(gfx::Canvas* canvas, const gfx::Rect& arrow_bounds) const;
internal::BorderImages* GetImagesForTest() const;

Powered by Google App Engine
This is Rietveld 408576698