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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none Created 4 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 #include "platform/graphics/paint/PaintChunker.h" 5 #include "platform/graphics/paint/PaintChunker.h"
6 6
7 #include "platform/RuntimeEnabledFeatures.h" 7 #include "platform/RuntimeEnabledFeatures.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 bool PaintChunker::incrementDisplayItemIndex(const DisplayItem& item) { 32 bool PaintChunker::incrementDisplayItemIndex(const DisplayItem& item) {
33 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 33 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
34 34
35 #if DCHECK_IS_ON() 35 #if DCHECK_IS_ON()
36 if (!gNullPaintPropertyChecksDisabled) { 36 if (!gNullPaintPropertyChecksDisabled) {
37 // Property nodes should never be null because they should either be set to 37 // Property nodes should never be null because they should either be set to
38 // properties created by a LayoutObject/FrameView, or be set to a non-null 38 // properties created by a LayoutObject/FrameView, or be set to a non-null
39 // root node. If these DCHECKs are hit we are missing a call to update the 39 // root node. If these DCHECKs are hit we are missing a call to update the
40 // properties. See: ScopedPaintChunkProperties. 40 // properties. See: ScopedPaintChunkProperties.
41 DCHECK(m_currentProperties.transform); 41 DCHECK(m_currentProperties.propertyTreeState.transform());
42 DCHECK(m_currentProperties.clip); 42 DCHECK(m_currentProperties.propertyTreeState.clip());
43 DCHECK(m_currentProperties.effect); 43 DCHECK(m_currentProperties.propertyTreeState.effect());
44 DCHECK(m_currentProperties.scroll); 44 DCHECK(m_currentProperties.propertyTreeState.scroll());
45 } 45 }
46 #endif 46 #endif
47 47
48 ItemBehavior behavior; 48 ItemBehavior behavior;
49 Optional<PaintChunk::Id> newChunkId; 49 Optional<PaintChunk::Id> newChunkId;
50 if (DisplayItem::isForeignLayerType(item.getType())) { 50 if (DisplayItem::isForeignLayerType(item.getType())) {
51 behavior = RequiresSeparateChunk; 51 behavior = RequiresSeparateChunk;
52 // Use null chunkId if we are skipping cache, so that the chunk will not 52 // Use null chunkId if we are skipping cache, so that the chunk will not
53 // match any old chunk and will be treated as brand new. 53 // match any old chunk and will be treated as brand new.
54 if (!item.skippedCache()) 54 if (!item.skippedCache())
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 Vector<PaintChunk> PaintChunker::releasePaintChunks() { 113 Vector<PaintChunk> PaintChunker::releasePaintChunks() {
114 Vector<PaintChunk> chunks; 114 Vector<PaintChunk> chunks;
115 chunks.swap(m_chunks); 115 chunks.swap(m_chunks);
116 m_chunkBehavior.clear(); 116 m_chunkBehavior.clear();
117 m_currentChunkId = WTF::nullopt; 117 m_currentChunkId = WTF::nullopt;
118 m_currentProperties = PaintChunkProperties(); 118 m_currentProperties = PaintChunkProperties();
119 return chunks; 119 return chunks;
120 } 120 }
121 121
122 } // namespace blink 122 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698