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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h

Issue 1497873002: Make DisplayItemClient an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 SubsequenceRecorder_h 5 #ifndef SubsequenceRecorder_h
6 #define SubsequenceRecorder_h 6 #define SubsequenceRecorder_h
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class GraphicsContext; 14 class GraphicsContext;
15 class PaintController; 15 class PaintController;
16 16
17 // SubsequenceRecorder records BeginSubsequenceDisplayItem and EndSubsequenceDis playItem 17 // SubsequenceRecorder records BeginSubsequenceDisplayItem and EndSubsequenceDis playItem
18 // sentinels at either end of a continguous sequence of DisplayItems, and suppor ts 18 // sentinels at either end of a continguous sequence of DisplayItems, and suppor ts
19 // caching via a CachedDisplayItem with the CachedSubsequence DisplayItem type. 19 // caching via a CachedDisplayItem with the CachedSubsequence DisplayItem type.
20 // 20 //
21 // Also note that useCachedSubsequenceIfPossible is not sufficient to determine whether a 21 // Also note that useCachedSubsequenceIfPossible is not sufficient to determine whether a
22 // CachedSubsequence can be used. In particular, the client is responsible for c hecking that 22 // CachedSubsequence can be used. In particular, the client is responsible for c hecking that
23 // none of the DisplayItemClients that contribute to the subsequence have been i nvalidated. 23 // none of the DisplayItemClients that contribute to the subsequence have been i nvalidated.
24 // 24 //
25 class PLATFORM_EXPORT SubsequenceRecorder final { 25 class PLATFORM_EXPORT SubsequenceRecorder final {
26 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 26 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
27 WTF_MAKE_NONCOPYABLE(SubsequenceRecorder); 27 WTF_MAKE_NONCOPYABLE(SubsequenceRecorder);
28 public: 28 public:
29 static bool useCachedSubsequenceIfPossible(GraphicsContext&, const DisplayIt emClientWrapper&); 29 static bool useCachedSubsequenceIfPossible(GraphicsContext&, const DisplayIt emClient&);
30 30
31 SubsequenceRecorder(GraphicsContext&, const DisplayItemClientWrapper&); 31 SubsequenceRecorder(GraphicsContext&, const DisplayItemClient&);
32 ~SubsequenceRecorder(); 32 ~SubsequenceRecorder();
33 33
34 void setUncacheable(); 34 void setUncacheable();
35 35
36 private: 36 private:
37 PaintController& m_paintController; 37 PaintController& m_paintController;
38 DisplayItemClientWrapper m_client; 38 const DisplayItemClient& m_client;
39 size_t m_beginSubsequenceIndex; 39 size_t m_beginSubsequenceIndex;
40 }; 40 };
41 41
42 } // namespace blink 42 } // namespace blink
43 43
44 #endif // SubsequenceRecorder_h 44 #endif // SubsequenceRecorder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698