Index: Source/core/paint/TranslationRecorder.h |
diff --git a/Source/core/paint/TranslationRecorder.h b/Source/core/paint/TranslationRecorder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3b84b746ec36846ec6012ac0e290c47b0e8f9ad |
--- /dev/null |
+++ b/Source/core/paint/TranslationRecorder.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2014 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 TranslationRecorder_h |
+#define TranslationRecorder_h |
+ |
+#include "core/paint/ViewDisplayList.h" |
+#include "platform/geometry/FloatSize.h" |
+ |
+namespace blink { |
+ |
+class GraphicsContext; |
+class RenderObject; |
+ |
+class TranslationDisplayItem : public DisplayItem { |
+public: |
+ TranslationDisplayItem(const FloatSize& translation) |
+ // FIXME: Need proper identifier for this display item. |
+ : DisplayItem(nullptr, Translation), m_translation(translation) { } |
+ |
+private: |
+ virtual void replay(GraphicsContext*) override; |
+ |
+ FloatSize m_translation; |
+}; |
+ |
+class EndTranslationDisplayItem : public TranslationDisplayItem { |
+public: |
+ EndTranslationDisplayItem(const FloatSize& translation) : TranslationDisplayItem(-translation) { } |
+}; |
+ |
+class TranslationRecorder { |
+public: |
+ explicit TranslationRecorder(RenderObject*, GraphicsContext*, const FloatSize& translation); |
+ ~TranslationRecorder(); |
+ |
+private: |
+ RenderObject* m_renderer; |
+ GraphicsContext* m_context; |
+ FloatSize m_translation; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // TranslationRecorder_h |