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

Unified Diff: Source/platform/mac/ThemeMac.h

Issue 488353003: Specify clip rects when drawing Mac native widgets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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: Source/platform/mac/ThemeMac.h
diff --git a/Source/platform/mac/ThemeMac.h b/Source/platform/mac/ThemeMac.h
index 1e215e78da5b00d1e8b12c00f68d2cb0c5ee9072..d376b2fbce22e615a3f14ae8b169a82db3e05570 100644
--- a/Source/platform/mac/ThemeMac.h
+++ b/Source/platform/mac/ThemeMac.h
@@ -54,6 +54,20 @@ public:
virtual void paint(ControlPart, ControlStates, GraphicsContext*, const IntRect&, float zoomFactor, ScrollView*) const;
virtual void inflateControlPaintRect(ControlPart, ControlStates, IntRect&, float zoomFactor) const;
+ // Inflate an IntRect to accout for specific padding around margins.
+ enum {
+ TopMargin = 0,
+ RightMargin = 1,
+ BottomMargin = 2,
+ LeftMargin = 3
+ };
+ static PLATFORM_EXPORT IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f);
+
+ // Inflate an IntRect to account for its focus ring. This is only used when
+ // BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING is defined (otherwise, the focus ring's
+ // bounds could be accurately computed with -[NSCell focusRingMaskBoundsForFrame:inView:]).
+ static PLATFORM_EXPORT IntRect inflateRectForFocusRing(const IntRect&);
+
// FIXME: Once RenderThemeMac is converted over to use Theme then this can be internal to ThemeMac.
static NSView* ensuredView(ScrollView*);
static void setFocusRingClipRect(const FloatRect&);

Powered by Google App Engine
This is Rietveld 408576698