| Index: ui/gfx/scoped_canvas.h
|
| diff --git a/ui/gfx/scoped_canvas.h b/ui/gfx/scoped_canvas.h
|
| index 4a260bf93c3622b78892628667e839c4d2a21632..bee478b56343dc45d410f81a07bcda60295cc7a8 100644
|
| --- a/ui/gfx/scoped_canvas.h
|
| +++ b/ui/gfx/scoped_canvas.h
|
| @@ -7,11 +7,14 @@
|
|
|
| #include "base/macros.h"
|
| #include "ui/gfx/canvas.h"
|
| +#include "ui/gfx/gfx_export.h"
|
|
|
| namespace gfx {
|
|
|
| +class Rect;
|
| +
|
| // Saves the drawing state, and restores the state when going out of scope.
|
| -class ScopedCanvas {
|
| +class GFX_EXPORT ScopedCanvas {
|
| public:
|
| explicit ScopedCanvas(gfx::Canvas* canvas) : canvas_(canvas) {
|
| if (canvas_)
|
| @@ -28,6 +31,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 GFX_EXPORT ScopedRTLFlipCanvas {
|
| + 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_
|
|
|