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

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: fixes :) 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..8517040e810ad50fe64ce74336c9a272fa8b602e 100644
--- a/ui/gfx/scoped_canvas.h
+++ b/ui/gfx/scoped_canvas.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/rect.h"
tapted 2016/04/22 13:46:52 forward-declare?
Elly Fong-Jones 2016/04/25 14:30:50 Done.
namespace gfx {
@@ -28,6 +29,21 @@ 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 RTL.
tapted 2016/04/22 13:46:52 nit: replace `flipped RTL` with `horizontally flip
Elly Fong-Jones 2016/04/25 14:30:50 Done.
+
tapted 2016/04/22 13:46:52 nit: remove blank line
Elly Fong-Jones 2016/04/25 14:30:50 Done.
+class ScopedRTLFlipCanvas {
+ public:
+ ScopedRTLFlipCanvas(gfx::Canvas* canvas, gfx::Rect rect);
tapted 2016/04/22 13:46:52 nit: const-ref on `rect`
Elly Fong-Jones 2016/04/25 14:30:50 Done.
+ ~ScopedRTLFlipCanvas() {}
+
+ private:
+ ScopedCanvas canvas_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedRTLFlipCanvas);
+};
+
} // namespace gfx
#endif // UI_GFX_SCOPED_CANVAS_H_

Powered by Google App Engine
This is Rietveld 408576698