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

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*, 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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp ('k') | third_party/WebKit/Source/web/LinkHighlightImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698