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*, const IntRect&) const over
ride { return IntRect(); } | 16 IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const over
ride { return IntRect(); } |
17 String debugName(const GraphicsLayer*) const override { return String(); } | 17 String debugName(const GraphicsLayer*) const override { return String(); } |
18 bool isTrackingPaintInvalidations() const override { return m_isTrackingPain
tInvalidations; } | 18 bool isTrackingRasterInvalidations() const override { return m_isTrackingRas
terInvalidations; } |
19 bool needsRepaint(const GraphicsLayer&) const override { return true; } | 19 bool needsRepaint(const GraphicsLayer&) const override { return true; } |
20 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect&) const override { } | 20 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect&) const override { } |
21 | 21 |
22 void setIsTrackingPaintInvalidations(bool isTrackingPaintInvalidations) | 22 void setIsTrackingRasterInvalidations(bool isTrackingRasterInvalidations) |
23 { | 23 { |
24 m_isTrackingPaintInvalidations = isTrackingPaintInvalidations; | 24 m_isTrackingRasterInvalidations = isTrackingRasterInvalidations; |
25 } | 25 } |
26 | 26 |
27 private: | 27 private: |
28 bool m_isTrackingPaintInvalidations = false; | 28 bool m_isTrackingRasterInvalidations = false; |
29 }; | 29 }; |
30 | 30 |
31 } // namespace blink | 31 } // namespace blink |
32 | 32 |
33 #endif // FakeGraphicsLayerClient_h | 33 #endif // FakeGraphicsLayerClient_h |
OLD | NEW |