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

Unified Diff: ui/compositor/transform_recorder.h

Issue 1470123002: Split ClipTransformRecorder into {Clip,Transform}Recorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize transformed to false. Created 5 years, 1 month 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/compositor/paint_context.h ('k') | ui/compositor/transform_recorder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/transform_recorder.h
diff --git a/ui/compositor/transform_recorder.h b/ui/compositor/transform_recorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3307bc704cc137862aec67741843c81892231bd
--- /dev/null
+++ b/ui/compositor/transform_recorder.h
@@ -0,0 +1,43 @@
+// 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_TRANSFORM_RECORDER_H_
+#define UI_COMPOSITOR_TRANSFORM_RECORDER_H_
+
+#include "base/macros.h"
+#include "ui/compositor/compositor_export.h"
+
+namespace cc {
+class DisplayItem;
+class DisplayItemList;
+}
+
+namespace gfx {
+class Transform;
+}
+
+namespace ui {
+class PaintContext;
+
+// A class to provide scoped transforms of painting to a DisplayItemList. The
+// transform provided will be applied to any DisplayItems added to the
+// DisplayItemList while this object is alive. In other words, any nested
+// PaintRecorders or other TransformRecorders will be transformed.
+class COMPOSITOR_EXPORT TransformRecorder {
+ public:
+ explicit TransformRecorder(const PaintContext& context);
+ ~TransformRecorder();
+
+ void Transform(const gfx::Transform& transform);
+
+ private:
+ const PaintContext& context_;
+ bool transformed_;
+
+ DISALLOW_COPY_AND_ASSIGN(TransformRecorder);
+};
+
+} // namespace ui
+
+#endif // UI_COMPOSITOR_TRANSFORM_RECORDER_H_
« no previous file with comments | « ui/compositor/paint_context.h ('k') | ui/compositor/transform_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698