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

Side by Side Diff: third_party/WebKit/Source/core/paint/FramePainter.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "core/paint/FramePainter.h" 5 #include "core/paint/FramePainter.h"
6 6
7 #include "core/editing/markers/DocumentMarkerController.h" 7 #include "core/editing/markers/DocumentMarkerController.h"
8 #include "core/fetch/MemoryCache.h" 8 #include "core/fetch/MemoryCache.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/inspector/InspectorInstrumentation.h" 10 #include "core/inspector/InspectorInstrumentation.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // TODO(pdr): Creating frame paint properties here will not be needed once 50 // TODO(pdr): Creating frame paint properties here will not be needed once
51 // settings()->rootLayerScrolls() is enabled. 51 // settings()->rootLayerScrolls() is enabled.
52 // TODO(pdr): Make this conditional on the rootLayerScrolls setting. 52 // TODO(pdr): Make this conditional on the rootLayerScrolls setting.
53 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; 53 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties;
54 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && 54 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
55 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 55 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
56 if (const PropertyTreeState* contentsState = 56 if (const PropertyTreeState* contentsState =
57 m_frameView->totalPropertyTreeStateForContents()) { 57 m_frameView->totalPropertyTreeStateForContents()) {
58 PaintChunkProperties properties( 58 PaintChunkProperties properties(
59 context.getPaintController().currentPaintChunkProperties()); 59 context.getPaintController().currentPaintChunkProperties());
60 properties.transform = contentsState->transform(); 60 properties.propertyTreeState = *contentsState;
61 properties.clip = contentsState->clip();
62 properties.effect = contentsState->effect();
63 properties.scroll = contentsState->scroll();
64 scopedPaintChunkProperties.emplace(context.getPaintController(), 61 scopedPaintChunkProperties.emplace(context.getPaintController(),
65 *frameView().layoutView(), 62 *frameView().layoutView(),
66 properties); 63 properties);
67 } 64 }
68 } 65 }
69 66
70 TransformRecorder transformRecorder( 67 TransformRecorder transformRecorder(
71 context, *frameView().layoutView(), 68 context, *frameView().layoutView(),
72 AffineTransform::translation(frameView().x() - frameView().scrollX(), 69 AffineTransform::translation(frameView().x() - frameView().scrollX(),
73 frameView().y() - frameView().scrollY())); 70 frameView().y() - frameView().scrollY()));
(...skipping 20 matching lines...) Expand all
94 91
95 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; 92 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties;
96 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 93 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
97 if (const PropertyTreeState* contentsState = 94 if (const PropertyTreeState* contentsState =
98 m_frameView->totalPropertyTreeStateForContents()) { 95 m_frameView->totalPropertyTreeStateForContents()) {
99 // The scrollbar's property nodes are similar to the frame view's 96 // The scrollbar's property nodes are similar to the frame view's
100 // contents state but we want to exclude the content-specific 97 // contents state but we want to exclude the content-specific
101 // properties. This prevents the scrollbars from scrolling, for example. 98 // properties. This prevents the scrollbars from scrolling, for example.
102 PaintChunkProperties properties( 99 PaintChunkProperties properties(
103 context.getPaintController().currentPaintChunkProperties()); 100 context.getPaintController().currentPaintChunkProperties());
104 properties.transform = m_frameView->preTranslation(); 101 properties.propertyTreeState.setTransform(
105 properties.clip = m_frameView->contentClip()->parent(); 102 m_frameView->preTranslation());
106 properties.effect = contentsState->effect(); 103 properties.propertyTreeState.setClip(
104 m_frameView->contentClip()->parent());
105 properties.propertyTreeState.setEffect(contentsState->effect());
107 auto* scrollBarScroll = contentsState->scroll(); 106 auto* scrollBarScroll = contentsState->scroll();
108 if (m_frameView->scroll()) 107 if (m_frameView->scroll())
109 scrollBarScroll = m_frameView->scroll()->parent(); 108 scrollBarScroll = m_frameView->scroll()->parent();
110 properties.scroll = scrollBarScroll; 109 properties.propertyTreeState.setScroll(scrollBarScroll);
111 scopedPaintChunkProperties.emplace(context.getPaintController(), 110 scopedPaintChunkProperties.emplace(context.getPaintController(),
112 *frameView().layoutView(), 111 *frameView().layoutView(),
113 properties); 112 properties);
114 } 113 }
115 } 114 }
116 115
117 TransformRecorder transformRecorder( 116 TransformRecorder transformRecorder(
118 context, *frameView().layoutView(), 117 context, *frameView().layoutView(),
119 AffineTransform::translation(frameView().x(), frameView().y())); 118 AffineTransform::translation(frameView().x(), frameView().y()));
120 119
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 250
252 bar.paint(context, CullRect(rect)); 251 bar.paint(context, CullRect(rect));
253 } 252 }
254 253
255 const FrameView& FramePainter::frameView() { 254 const FrameView& FramePainter::frameView() {
256 DCHECK(m_frameView); 255 DCHECK(m_frameView);
257 return *m_frameView; 256 return *m_frameView;
258 } 257 }
259 258
260 } // namespace blink 259 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxClipper.cpp ('k') | third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698