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

Unified Diff: ui/gfx/scoped_canvas.h

Issue 1904753002: MenuButton: support Mac look & feel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cache arrow images 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/scoped_canvas.h
diff --git a/ui/gfx/scoped_canvas.h b/ui/gfx/scoped_canvas.h
index 4a260bf93c3622b78892628667e839c4d2a21632..85b7fa5ca1113c684ced54596a7d99064e1562c2 100644
--- a/ui/gfx/scoped_canvas.h
+++ b/ui/gfx/scoped_canvas.h
@@ -10,6 +10,8 @@
namespace gfx {
+class Rect;
+
// Saves the drawing state, and restores the state when going out of scope.
class ScopedCanvas {
public:
@@ -28,6 +30,20 @@ class ScopedCanvas {
DISALLOW_COPY_AND_ASSIGN(ScopedCanvas);
};
+// Saves the drawing state, and applies an RTL transform for the supplied rect
+// if the UI is in RTL layout. The resulting transform is such that anything
+// drawn inside the supplied rect will be flipped horizontally.
+class ScopedRTLFlipCanvas {
tapted 2016/04/26 05:05:57 ooh this needs to be GFX_EXPORT (+include gfx_expo
Elly Fong-Jones 2016/04/26 17:41:25 I made this and ScopedCanvas both GFX_EXPORT. I'm
tapted 2016/04/27 03:25:11 The inlined methods wouldn't have required it, but
+ public:
+ ScopedRTLFlipCanvas(gfx::Canvas* canvas, const gfx::Rect& rect);
+ ~ScopedRTLFlipCanvas() {}
+
+ private:
+ ScopedCanvas canvas_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedRTLFlipCanvas);
+};
+
} // namespace gfx
#endif // UI_GFX_SCOPED_CANVAS_H_
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/gfx/scoped_canvas.cc » ('j') | ui/views/controls/button/menu_button.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698