Index: ui/compositor/paint_recorder.h |
diff --git a/ui/compositor/paint_recorder.h b/ui/compositor/paint_recorder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1a233af62036c05200acbc50f93052032dbabc38 |
--- /dev/null |
+++ b/ui/compositor/paint_recorder.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_COMPOSITOR_PAINT_RECORDER_H_ |
+#define UI_COMPOSITOR_PAINT_RECORDER_H_ |
+ |
+#include "base/macros.h" |
+#include "ui/compositor/compositor_export.h" |
+ |
+namespace gfx { |
+class Canvas; |
+} |
+ |
+namespace ui { |
+class PaintContext; |
+ |
+// A class to hide the complexity behind setting up a recording into a |
+// DisplayItem. This is meant to be short-lived within the scope of recording |
+// taking place, the DisplayItem should be removed from the PaintRecorder once |
+// recording is complete and can be cached. |
+class COMPOSITOR_EXPORT PaintRecorder { |
+ public: |
+ PaintRecorder(const PaintContext& context); |
sky
2015/04/02 23:43:09
explicit
danakj
2015/04/03 00:27:36
oops thanks.
|
+ ~PaintRecorder(); |
+ |
+ // Gets a gfx::Canvas for painting into. |
+ gfx::Canvas* canvas() { return canvas_; } |
+ |
+ private: |
+ gfx::Canvas* canvas_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PaintRecorder); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_COMPOSITOR_PAINT_RECORDER_H_ |