| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 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 14 matching lines...) Expand all Loading... |
| 25 #include "sky/engine/core/frame/FrameView.h" | 25 #include "sky/engine/core/frame/FrameView.h" |
| 26 #include "sky/engine/core/rendering/LayoutState.h" | 26 #include "sky/engine/core/rendering/LayoutState.h" |
| 27 #include "sky/engine/core/rendering/PaintInvalidationState.h" | 27 #include "sky/engine/core/rendering/PaintInvalidationState.h" |
| 28 #include "sky/engine/core/rendering/RenderBlockFlow.h" | 28 #include "sky/engine/core/rendering/RenderBlockFlow.h" |
| 29 #include "sky/engine/core/rendering/RenderIFrame.h" | 29 #include "sky/engine/core/rendering/RenderIFrame.h" |
| 30 #include "sky/engine/platform/scroll/ScrollableArea.h" | 30 #include "sky/engine/platform/scroll/ScrollableArea.h" |
| 31 #include "sky/engine/wtf/OwnPtr.h" | 31 #include "sky/engine/wtf/OwnPtr.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class RenderLayerCompositor; | |
| 36 | |
| 37 // The root of the render tree, corresponding to the CSS initial containing bloc
k. | 35 // The root of the render tree, corresponding to the CSS initial containing bloc
k. |
| 38 // It's dimensions match that of the logical viewport (which may be different fr
om | 36 // It's dimensions match that of the logical viewport (which may be different fr
om |
| 39 // the visible viewport in fixed-layout mode), and it is always at position (0,0
) | 37 // the visible viewport in fixed-layout mode), and it is always at position (0,0
) |
| 40 // relative to the document (and so isn't necessarily in view). | 38 // relative to the document (and so isn't necessarily in view). |
| 41 class RenderView final : public RenderBlockFlow { | 39 class RenderView final : public RenderBlockFlow { |
| 42 public: | 40 public: |
| 43 explicit RenderView(Document*); | 41 explicit RenderView(Document*); |
| 44 virtual ~RenderView(); | 42 virtual ~RenderView(); |
| 45 | 43 |
| 46 bool hitTest(const HitTestRequest&, HitTestResult&); | 44 bool hitTest(const HitTestRequest&, HitTestResult&); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 72 } | 70 } |
| 73 int viewLogicalHeight() const; | 71 int viewLogicalHeight() const; |
| 74 LayoutUnit viewLogicalHeightForPercentages() const; | 72 LayoutUnit viewLogicalHeightForPercentages() const; |
| 75 | 73 |
| 76 FrameView* frameView() const { return m_frameView; } | 74 FrameView* frameView() const { return m_frameView; } |
| 77 | 75 |
| 78 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o
verride; | 76 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o
verride; |
| 79 | 77 |
| 80 void invalidatePaintForRectangle(const LayoutRect&) const; | 78 void invalidatePaintForRectangle(const LayoutRect&) const; |
| 81 | 79 |
| 82 void invalidatePaintForViewAndCompositedLayers(); | |
| 83 | |
| 84 virtual void paint(PaintInfo&, const LayoutPoint&) override; | 80 virtual void paint(PaintInfo&, const LayoutPoint&) override; |
| 85 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&) ov
erride; | 81 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&) ov
erride; |
| 86 | 82 |
| 87 enum SelectionPaintInvalidationMode { PaintInvalidationNewXOROld, PaintInval
idationNewMinusOld, PaintInvalidationNothing }; | 83 enum SelectionPaintInvalidationMode { PaintInvalidationNewXOROld, PaintInval
idationNewMinusOld, PaintInvalidationNothing }; |
| 88 void setSelection(RenderObject* start, int startPos, RenderObject*, int endP
os, SelectionPaintInvalidationMode = PaintInvalidationNewXOROld); | 84 void setSelection(RenderObject* start, int startPos, RenderObject*, int endP
os, SelectionPaintInvalidationMode = PaintInvalidationNewXOROld); |
| 89 void getSelection(RenderObject*& startRenderer, int& startOffset, RenderObje
ct*& endRenderer, int& endOffset) const; | 85 void getSelection(RenderObject*& startRenderer, int& startOffset, RenderObje
ct*& endRenderer, int& endOffset) const; |
| 90 void clearSelection(); | 86 void clearSelection(); |
| 91 RenderObject* selectionStart() const { return m_selectionStart; } | 87 RenderObject* selectionStart() const { return m_selectionStart; } |
| 92 RenderObject* selectionEnd() const { return m_selectionEnd; } | 88 RenderObject* selectionEnd() const { return m_selectionEnd; } |
| 93 IntRect selectionBounds(bool clipToVisibleContent = true) const; | 89 IntRect selectionBounds(bool clipToVisibleContent = true) const; |
| 94 void selectionStartEnd(int& startPos, int& endPos) const; | 90 void selectionStartEnd(int& startPos, int& endPos) const; |
| 95 void invalidatePaintForSelection() const; | 91 void invalidatePaintForSelection() const; |
| 96 | 92 |
| 97 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; | 93 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; |
| 98 virtual void absoluteQuads(Vector<FloatQuad>&) const override; | 94 virtual void absoluteQuads(Vector<FloatQuad>&) const override; |
| 99 | 95 |
| 100 virtual LayoutRect viewRect() const override; | 96 virtual LayoutRect viewRect() const override; |
| 101 | 97 |
| 102 bool shouldDoFullPaintInvalidationForNextLayout() const; | 98 bool shouldDoFullPaintInvalidationForNextLayout() const; |
| 103 bool doingFullPaintInvalidation() const { return m_frameView->needsFullPaint
Invalidation(); } | 99 bool doingFullPaintInvalidation() const { return m_frameView->needsFullPaint
Invalidation(); } |
| 104 | 100 |
| 105 LayoutState* layoutState() const { return m_layoutState; } | 101 LayoutState* layoutState() const { return m_layoutState; } |
| 106 | 102 |
| 107 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid
e; | 103 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid
e; |
| 108 | 104 |
| 109 // Notification that this view moved into or out of a native window. | |
| 110 void setIsInWindow(bool); | |
| 111 | |
| 112 RenderLayerCompositor* compositor(); | |
| 113 bool usesCompositing() const; | |
| 114 | |
| 115 IntRect unscaledDocumentRect() const; | 105 IntRect unscaledDocumentRect() const; |
| 116 LayoutRect backgroundRect(RenderBox* backgroundRenderer) const; | 106 LayoutRect backgroundRect(RenderBox* backgroundRenderer) const; |
| 117 | 107 |
| 118 IntRect documentRect() const; | 108 IntRect documentRect() const; |
| 119 | 109 |
| 120 // Renderer that paints the root background has background-images which all
have background-attachment: fixed. | 110 // Renderer that paints the root background has background-images which all
have background-attachment: fixed. |
| 121 bool rootBackgroundIsEntirelyFixed() const; | 111 bool rootBackgroundIsEntirelyFixed() const; |
| 122 | 112 |
| 123 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const override; | 113 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const override; |
| 124 | 114 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 154 | 144 |
| 155 FrameView* m_frameView; | 145 FrameView* m_frameView; |
| 156 | 146 |
| 157 RawPtr<RenderObject> m_selectionStart; | 147 RawPtr<RenderObject> m_selectionStart; |
| 158 RawPtr<RenderObject> m_selectionEnd; | 148 RawPtr<RenderObject> m_selectionEnd; |
| 159 | 149 |
| 160 int m_selectionStartPos; | 150 int m_selectionStartPos; |
| 161 int m_selectionEndPos; | 151 int m_selectionEndPos; |
| 162 | 152 |
| 163 LayoutState* m_layoutState; | 153 LayoutState* m_layoutState; |
| 164 OwnPtr<RenderLayerCompositor> m_compositor; | |
| 165 | 154 |
| 166 unsigned m_renderCounterCount; | 155 unsigned m_renderCounterCount; |
| 167 | 156 |
| 168 unsigned m_hitTestCount; | 157 unsigned m_hitTestCount; |
| 169 | 158 |
| 170 WTF::HashSet<RenderIFrame*> m_iframes; | 159 WTF::HashSet<RenderIFrame*> m_iframes; |
| 171 }; | 160 }; |
| 172 | 161 |
| 173 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView()); | 162 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView()); |
| 174 | 163 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 194 m_paintInvalidationState->m_cachedOffsetsEnabled = true; | 183 m_paintInvalidationState->m_cachedOffsetsEnabled = true; |
| 195 } | 184 } |
| 196 private: | 185 private: |
| 197 const PaintInvalidationState* m_paintInvalidationState; | 186 const PaintInvalidationState* m_paintInvalidationState; |
| 198 bool m_didDisable; | 187 bool m_didDisable; |
| 199 }; | 188 }; |
| 200 | 189 |
| 201 } // namespace blink | 190 } // namespace blink |
| 202 | 191 |
| 203 #endif // SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ | 192 #endif // SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ |
| OLD | NEW |