| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef FakeGraphicsLayerClient_h | 5 #ifndef FakeGraphicsLayerClient_h |
| 6 #define FakeGraphicsLayerClient_h | 6 #define FakeGraphicsLayerClient_h |
| 7 | 7 |
| 8 #include "platform/graphics/GraphicsLayerClient.h" | 8 #include "platform/graphics/GraphicsLayerClient.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 // A simple GraphicsLayerClient implementation suitable for use in unit tests. | 12 // A simple GraphicsLayerClient implementation suitable for use in unit tests. |
| 13 class FakeGraphicsLayerClient : public GraphicsLayerClient { | 13 class FakeGraphicsLayerClient : public GraphicsLayerClient { |
| 14 public: | 14 public: |
| 15 // GraphicsLayerClient implementation. | 15 // GraphicsLayerClient implementation. |
| 16 IntRect computeInterestRect(const GraphicsLayer*, | 16 IntRect computeInterestRect(const GraphicsLayer*, |
| 17 const IntRect&) const override { | 17 const IntRect&) const override { |
| 18 return IntRect(); | 18 return IntRect(); |
| 19 } | 19 } |
| 20 String debugName(const GraphicsLayer*) const override { return String(); } | 20 String debugName(const GraphicsLayer*) const override { return String(); } |
| 21 bool isTrackingPaintInvalidations() const override { | 21 bool isTrackingRasterInvalidations() const override { |
| 22 return m_isTrackingPaintInvalidations; | 22 return m_isTrackingRasterInvalidations; |
| 23 } | 23 } |
| 24 bool needsRepaint(const GraphicsLayer&) const override { return true; } | 24 bool needsRepaint(const GraphicsLayer&) const override { return true; } |
| 25 void paintContents(const GraphicsLayer*, | 25 void paintContents(const GraphicsLayer*, |
| 26 GraphicsContext&, | 26 GraphicsContext&, |
| 27 GraphicsLayerPaintingPhase, | 27 GraphicsLayerPaintingPhase, |
| 28 const IntRect&) const override {} | 28 const IntRect&) const override {} |
| 29 | 29 |
| 30 void setIsTrackingPaintInvalidations(bool isTrackingPaintInvalidations) { | 30 void setIsTrackingRasterInvalidations(bool isTrackingRasterInvalidations) { |
| 31 m_isTrackingPaintInvalidations = isTrackingPaintInvalidations; | 31 m_isTrackingRasterInvalidations = isTrackingRasterInvalidations; |
| 32 } | 32 } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 bool m_isTrackingPaintInvalidations = false; | 35 bool m_isTrackingRasterInvalidations = false; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace blink | 38 } // namespace blink |
| 39 | 39 |
| 40 #endif // FakeGraphicsLayerClient_h | 40 #endif // FakeGraphicsLayerClient_h |
| OLD | NEW |