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

Side by Side Diff: sky/engine/core/rendering/RenderView.cpp

Issue 758843004: Delete most of rendering/compositing. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 13 matching lines...) Expand all
24 #include "gen/sky/platform/RuntimeEnabledFeatures.h" 24 #include "gen/sky/platform/RuntimeEnabledFeatures.h"
25 #include "sky/engine/core/dom/Document.h" 25 #include "sky/engine/core/dom/Document.h"
26 #include "sky/engine/core/dom/Element.h" 26 #include "sky/engine/core/dom/Element.h"
27 #include "sky/engine/core/frame/LocalFrame.h" 27 #include "sky/engine/core/frame/LocalFrame.h"
28 #include "sky/engine/core/page/Page.h" 28 #include "sky/engine/core/page/Page.h"
29 #include "sky/engine/core/rendering/GraphicsContextAnnotator.h" 29 #include "sky/engine/core/rendering/GraphicsContextAnnotator.h"
30 #include "sky/engine/core/rendering/HitTestResult.h" 30 #include "sky/engine/core/rendering/HitTestResult.h"
31 #include "sky/engine/core/rendering/RenderGeometryMap.h" 31 #include "sky/engine/core/rendering/RenderGeometryMap.h"
32 #include "sky/engine/core/rendering/RenderLayer.h" 32 #include "sky/engine/core/rendering/RenderLayer.h"
33 #include "sky/engine/core/rendering/RenderSelectionInfo.h" 33 #include "sky/engine/core/rendering/RenderSelectionInfo.h"
34 #include "sky/engine/core/rendering/compositing/RenderLayerCompositor.h"
35 #include "sky/engine/platform/TraceEvent.h" 34 #include "sky/engine/platform/TraceEvent.h"
36 #include "sky/engine/platform/geometry/FloatQuad.h" 35 #include "sky/engine/platform/geometry/FloatQuad.h"
37 #include "sky/engine/platform/geometry/TransformState.h" 36 #include "sky/engine/platform/geometry/TransformState.h"
38 #include "sky/engine/platform/graphics/GraphicsContext.h" 37 #include "sky/engine/platform/graphics/GraphicsContext.h"
39 38
40 namespace blink { 39 namespace blink {
41 40
42 RenderView::RenderView(Document* document) 41 RenderView::RenderView(Document* document)
43 : RenderBlockFlow(document) 42 : RenderBlockFlow(document)
44 , m_frameView(document->view()) 43 , m_frameView(document->view())
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 132
134 if (width() != viewWidth()) 133 if (width() != viewWidth())
135 return true; 134 return true;
136 135
137 if (height() != viewHeight()) { 136 if (height() != viewHeight()) {
138 if (RenderObject* backgroundRenderer = this->backgroundRenderer()) { 137 if (RenderObject* backgroundRenderer = this->backgroundRenderer()) {
139 // When background-attachment is 'fixed', we treat the viewport (ins tead of the 'root' 138 // When background-attachment is 'fixed', we treat the viewport (ins tead of the 'root'
140 // i.e. html or body) as the background positioning area, and we sho uld full paint invalidation 139 // i.e. html or body) as the background positioning area, and we sho uld full paint invalidation
141 // viewport resize if the background image is not composited and nee ds full paint invalidation on 140 // viewport resize if the background image is not composited and nee ds full paint invalidation on
142 // background positioning area resize. 141 // background positioning area resize.
143 if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(la yer())) { 142 if (backgroundRenderer->style()->hasFixedBackgroundImage()
144 if (backgroundRenderer->style()->hasFixedBackgroundImage() 143 && mustInvalidateFillLayersPaintOnHeightChange(backgroundRendere r->style()->backgroundLayers()))
145 && mustInvalidateFillLayersPaintOnHeightChange(backgroundRen derer->style()->backgroundLayers())) 144 return true;
146 return true;
147 }
148 } 145 }
149 } 146 }
150 147
151 return false; 148 return false;
152 } 149 }
153 150
154 void RenderView::layout() 151 void RenderView::layout()
155 { 152 {
156 SubtreeLayoutScope layoutScope(*this); 153 SubtreeLayoutScope layoutScope(*this);
157 154
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 if (!m_frameView) 306 if (!m_frameView)
310 return; 307 return;
311 308
312 if (layer()->compositingState() == PaintsIntoOwnBacking) { 309 if (layer()->compositingState() == PaintsIntoOwnBacking) {
313 layer()->paintInvalidator().setBackingNeedsPaintInvalidationInRect(paint InvalidationRect); 310 layer()->paintInvalidator().setBackingNeedsPaintInvalidationInRect(paint InvalidationRect);
314 } else { 311 } else {
315 m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(pa intInvalidationRect)); 312 m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(pa intInvalidationRect));
316 } 313 }
317 } 314 }
318 315
319 void RenderView::invalidatePaintForViewAndCompositedLayers()
320 {
321 setShouldDoFullPaintInvalidation(true);
322
323 // The only way we know how to hit these ASSERTS below this point is via the Chromium OS login screen.
324 DisableCompositingQueryAsserts disabler;
325
326 if (compositor()->inCompositingMode())
327 compositor()->fullyInvalidatePaint();
328 }
329
330 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta te) const 316 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta te) const
331 { 317 {
332 // Apply our transform if we have one (because of full page zooming). 318 // Apply our transform if we have one (because of full page zooming).
333 if (!paintInvalidationContainer && layer() && layer()->transform()) 319 if (!paintInvalidationContainer && layer() && layer()->transform())
334 rect = layer()->transform()->mapRect(rect); 320 rect = layer()->transform()->mapRect(rect);
335 } 321 }
336 322
337 323
338 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu latedOffset) const 324 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu latedOffset) const
339 { 325 {
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (!result.innerNonSharedNode()) 685 if (!result.innerNonSharedNode())
700 result.setInnerNonSharedNode(node); 686 result.setInnerNonSharedNode(node);
701 687
702 LayoutPoint adjustedPoint = point; 688 LayoutPoint adjustedPoint = point;
703 offsetForContents(adjustedPoint); 689 offsetForContents(adjustedPoint);
704 690
705 result.setLocalPoint(adjustedPoint); 691 result.setLocalPoint(adjustedPoint);
706 } 692 }
707 } 693 }
708 694
709 bool RenderView::usesCompositing() const
710 {
711 return m_compositor && m_compositor->staleInCompositingMode();
712 }
713
714 RenderLayerCompositor* RenderView::compositor()
715 {
716 if (!m_compositor)
717 m_compositor = adoptPtr(new RenderLayerCompositor(*this));
718
719 return m_compositor.get();
720 }
721
722 void RenderView::setIsInWindow(bool isInWindow)
723 {
724 if (m_compositor)
725 m_compositor->setIsInWindow(isInWindow);
726 }
727
728 void RenderView::pushLayoutState(LayoutState& layoutState) 695 void RenderView::pushLayoutState(LayoutState& layoutState)
729 { 696 {
730 m_layoutState = &layoutState; 697 m_layoutState = &layoutState;
731 } 698 }
732 699
733 void RenderView::popLayoutState() 700 void RenderView::popLayoutState()
734 { 701 {
735 ASSERT(m_layoutState); 702 ASSERT(m_layoutState);
736 m_layoutState = m_layoutState->next(); 703 m_layoutState = m_layoutState->next();
737 } 704 }
(...skipping 25 matching lines...) Expand all
763 m_iframes.remove(iframe); 730 m_iframes.remove(iframe);
764 } 731 }
765 732
766 void RenderView::updateIFramesAfterLayout() 733 void RenderView::updateIFramesAfterLayout()
767 { 734 {
768 for (auto& iframe: m_iframes) 735 for (auto& iframe: m_iframes)
769 iframe->updateWidgetBounds(); 736 iframe->updateWidgetBounds();
770 } 737 }
771 738
772 } // namespace blink 739 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698