OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef TranslationRecorder_h |
| 6 #define TranslationRecorder_h |
| 7 |
| 8 #include "core/paint/ViewDisplayList.h" |
| 9 #include "platform/geometry/FloatSize.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class GraphicsContext; |
| 14 class RenderObject; |
| 15 |
| 16 class TranslationDisplayItem : public DisplayItem { |
| 17 public: |
| 18 TranslationDisplayItem(const FloatSize& translation) |
| 19 // FIXME: Need proper identifier for this display item. |
| 20 : DisplayItem(nullptr, Translation), m_translation(translation) { } |
| 21 |
| 22 private: |
| 23 virtual void replay(GraphicsContext*) override; |
| 24 |
| 25 FloatSize m_translation; |
| 26 }; |
| 27 |
| 28 class EndTranslationDisplayItem : public TranslationDisplayItem { |
| 29 public: |
| 30 EndTranslationDisplayItem(const FloatSize& translation) : TranslationDisplay
Item(-translation) { } |
| 31 }; |
| 32 |
| 33 class TranslationRecorder { |
| 34 public: |
| 35 explicit TranslationRecorder(RenderObject*, GraphicsContext*, const FloatSiz
e& translation); |
| 36 ~TranslationRecorder(); |
| 37 |
| 38 private: |
| 39 RenderObject* m_renderer; |
| 40 GraphicsContext* m_context; |
| 41 FloatSize m_translation; |
| 42 }; |
| 43 |
| 44 } // namespace blink |
| 45 |
| 46 #endif // TranslationRecorder_h |
OLD | NEW |