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

Side by Side Diff: third_party/WebKit/Source/platform/testing/FakeGraphicsLayerClient.h

Issue 2380683006: SPv2: Add support for tracking raster paint invalidations in testing. (Closed)
Patch Set: none Created 4 years, 2 months 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 unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698