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

Unified Diff: ui/gfx/scoped_canvas.h

Issue 1971333002: Views: factor out Combobox background and const-ify style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ios build break Created 4 years, 7 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
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/gfx/scoped_canvas.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/gfx/gfx.gyp ('k') | ui/gfx/scoped_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698