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..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_ |