Chromium Code Reviews| 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_ |