| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 47 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
| 48 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 48 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 49 TransformPaintPropertyNode* transform = m_frameView->scrollTranslati
on() ? m_frameView->scrollTranslation() : m_frameView->preTranslation(); | 49 TransformPaintPropertyNode* transform = m_frameView->scrollTranslati
on() ? m_frameView->scrollTranslation() : m_frameView->preTranslation(); |
| 50 ClipPaintPropertyNode* clip = m_frameView->contentClip(); | 50 ClipPaintPropertyNode* clip = m_frameView->contentClip(); |
| 51 if (transform || clip) { | 51 if (transform || clip) { |
| 52 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); | 52 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); |
| 53 if (transform) | 53 if (transform) |
| 54 properties.transform = transform; | 54 properties.transform = transform; |
| 55 if (clip) | 55 if (clip) |
| 56 properties.clip = clip; | 56 properties.clip = clip; |
| 57 scopedPaintChunkProperties.emplace(context.getPaintController(),
properties); | 57 scopedPaintChunkProperties.emplace(context.getPaintController(),
*frameView().layoutView(), properties); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 TransformRecorder transformRecorder(context, *frameView().layoutView(), | 61 TransformRecorder transformRecorder(context, *frameView().layoutView(), |
| 62 AffineTransform::translation(frameView().x() - frameView().scrollX()
, frameView().y() - frameView().scrollY())); | 62 AffineTransform::translation(frameView().x() - frameView().scrollX()
, frameView().y() - frameView().scrollY())); |
| 63 | 63 |
| 64 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameToVisibleContentRect, frameView().visibleContentRect()); | 64 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameToVisibleContentRect, frameView().visibleContentRect()); |
| 65 | 65 |
| 66 documentDirtyRect.moveBy(-frameView().location() + frameView().scrollPos
ition()); | 66 documentDirtyRect.moveBy(-frameView().location() + frameView().scrollPos
ition()); |
| 67 paintContents(context, globalPaintFlags, documentDirtyRect); | 67 paintContents(context, globalPaintFlags, documentDirtyRect); |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (shouldPaintScrollbars) { | 70 if (shouldPaintScrollbars) { |
| 71 IntRect scrollViewDirtyRect = rect.m_rect; | 71 IntRect scrollViewDirtyRect = rect.m_rect; |
| 72 IntRect visibleAreaWithScrollbars(frameView().location(), frameView().vi
sibleContentRect(IncludeScrollbars).size()); | 72 IntRect visibleAreaWithScrollbars(frameView().location(), frameView().vi
sibleContentRect(IncludeScrollbars).size()); |
| 73 scrollViewDirtyRect.intersect(visibleAreaWithScrollbars); | 73 scrollViewDirtyRect.intersect(visibleAreaWithScrollbars); |
| 74 scrollViewDirtyRect.moveBy(-frameView().location()); | 74 scrollViewDirtyRect.moveBy(-frameView().location()); |
| 75 | 75 |
| 76 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 76 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
| 77 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 77 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 78 if (TransformPaintPropertyNode* transform = m_frameView->preTranslat
ion()) { | 78 if (TransformPaintPropertyNode* transform = m_frameView->preTranslat
ion()) { |
| 79 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); | 79 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); |
| 80 properties.transform = transform; | 80 properties.transform = transform; |
| 81 scopedPaintChunkProperties.emplace(context.getPaintController(),
properties); | 81 scopedPaintChunkProperties.emplace(context.getPaintController(),
*frameView().layoutView(), properties); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 TransformRecorder transformRecorder(context, *frameView().layoutView(), | 85 TransformRecorder transformRecorder(context, *frameView().layoutView(), |
| 86 AffineTransform::translation(frameView().x(), frameView().y())); | 86 AffineTransform::translation(frameView().x(), frameView().y())); |
| 87 | 87 |
| 88 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameScrollbars, IntRect(IntPoint(), visibleAreaWithScrollbars.size())); | 88 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameScrollbars, IntRect(IntPoint(), visibleAreaWithScrollbars.size())); |
| 89 | 89 |
| 90 paintScrollbars(context, scrollViewDirtyRect); | 90 paintScrollbars(context, scrollViewDirtyRect); |
| 91 } | 91 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 bar.paint(context, CullRect(rect)); | 211 bar.paint(context, CullRect(rect)); |
| 212 } | 212 } |
| 213 | 213 |
| 214 const FrameView& FramePainter::frameView() | 214 const FrameView& FramePainter::frameView() |
| 215 { | 215 { |
| 216 ASSERT(m_frameView); | 216 ASSERT(m_frameView); |
| 217 return *m_frameView; | 217 return *m_frameView; |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |