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

Side by Side Diff: sky/engine/core/rendering/RenderBox.h

Issue 899753003: Walk render tree instead of render layers for paint. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 10 matching lines...) Expand all
21 */ 21 */
22 22
23 #ifndef SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ 23 #ifndef SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_
24 #define SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ 24 #define SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_
25 25
26 #include "sky/engine/core/rendering/RenderBoxModelObject.h" 26 #include "sky/engine/core/rendering/RenderBoxModelObject.h"
27 #include "sky/engine/core/rendering/RenderOverflow.h" 27 #include "sky/engine/core/rendering/RenderOverflow.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 struct LayerPaintingInfo;
31 struct PaintInfo; 32 struct PaintInfo;
32 class RenderBlockFlow; 33 class RenderBlockFlow;
33 34
34 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; 35 enum SizeType { MainOrPreferredSize, MinSize, MaxSize };
35 enum AvailableLogicalHeightType { ExcludeMarginBorderPadding, IncludeMarginBorde rPadding }; 36 enum AvailableLogicalHeightType { ExcludeMarginBorderPadding, IncludeMarginBorde rPadding };
36 enum MarginDirection { BlockDirection, InlineDirection }; 37 enum MarginDirection { BlockDirection, InlineDirection };
37 38
38 enum ShouldComputePreferred { ComputeActual, ComputePreferred }; 39 enum ShouldComputePreferred { ComputeActual, ComputePreferred };
39 40
40 enum ContentsClipBehavior { ForceContentsClip, SkipContentsClipIfPossible }; 41 enum ContentsClipBehavior { ForceContentsClip, SkipContentsClipIfPossible };
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 m_marginBox.setStart(styleToUse->direction(), value); 261 m_marginBox.setStart(styleToUse->direction(), value);
261 } 262 }
262 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) 263 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0)
263 { 264 {
264 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); 265 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
265 m_marginBox.setEnd(styleToUse->direction(), value); 266 m_marginBox.setEnd(styleToUse->direction(), value);
266 } 267 }
267 268
268 virtual void absoluteQuads(Vector<FloatQuad>&) const override; 269 virtual void absoluteQuads(Vector<FloatQuad>&) const override;
269 270
271 void paintLayer(GraphicsContext* context, RenderLayer* rootLayer, const IntR ect& rect);
272
270 virtual void layout() override; 273 virtual void layout() override;
271 virtual void paint(PaintInfo&, const LayoutPoint&) override; 274 virtual void paint(PaintInfo&, const LayoutPoint&, Vector<RenderBox*>& layer s) override;
272 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override; 275 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override;
273 276
274 virtual LayoutUnit minPreferredLogicalWidth() const override; 277 virtual LayoutUnit minPreferredLogicalWidth() const override;
275 virtual LayoutUnit maxPreferredLogicalWidth() const override; 278 virtual LayoutUnit maxPreferredLogicalWidth() const override;
276 279
277 // FIXME: We should rename these back to overrideLogicalHeight/Width and hav e them store 280 // FIXME: We should rename these back to overrideLogicalHeight/Width and hav e them store
278 // the border-box height/width like the regular height/width accessors on Re nderBox. 281 // the border-box height/width like the regular height/width accessors on Re nderBox.
279 // Right now, these are different than contentHeight/contentWidth because th ey still 282 // Right now, these are different than contentHeight/contentWidth because th ey still
280 // include the scrollbar height/width. 283 // include the scrollbar height/width.
281 LayoutUnit overrideLogicalContentWidth() const; 284 LayoutUnit overrideLogicalContentWidth() const;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 LayoutUnit availableWidth() const { return availableLogicalWidth(); } 375 LayoutUnit availableWidth() const { return availableLogicalWidth(); }
373 LayoutUnit availableHeight() const { return availableLogicalHeight(IncludeMa rginBorderPadding); } 376 LayoutUnit availableHeight() const { return availableLogicalHeight(IncludeMa rginBorderPadding); }
374 377
375 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0) override; 378 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0) override;
376 379
377 virtual LayoutRect overflowClipRect(const LayoutPoint& location); 380 virtual LayoutRect overflowClipRect(const LayoutPoint& location);
378 LayoutRect clipRect(const LayoutPoint& location); 381 LayoutRect clipRect(const LayoutPoint& location);
379 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset, Cont entsClipBehavior); 382 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset, Cont entsClipBehavior);
380 void popContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); 383 void popContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset);
381 384
382 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE D(); }
383 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&); 385 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&);
384 386
385 // Called when a positioned object moves but doesn't necessarily change size . A simplified layout is attempted 387 // Called when a positioned object moves but doesn't necessarily change size . A simplified layout is attempted
386 // that just updates the object's position. If the size does change, the obj ect remains dirty. 388 // that just updates the object's position. If the size does change, the obj ect remains dirty.
387 bool tryLayoutDoingPositionedMovementOnly() 389 bool tryLayoutDoingPositionedMovementOnly()
388 { 390 {
389 LayoutUnit oldWidth = width(); 391 LayoutUnit oldWidth = width();
390 updateLogicalWidth(); 392 updateLogicalWidth();
391 // If we shrink to fit our width may have changed, so we still need full layout. 393 // If we shrink to fit our width may have changed, so we still need full layout.
392 if (oldWidth != width()) 394 if (oldWidth != width())
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 460
459 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip) const override; 461 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip) const override;
460 462
461 void paintRootBoxFillLayers(const PaintInfo&); 463 void paintRootBoxFillLayers(const PaintInfo&);
462 464
463 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild); 465 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild);
464 466
465 void updateIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalH eight) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; } 467 void updateIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalH eight) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; }
466 468
467 private: 469 private:
470 void paintLayerContents(GraphicsContext* context, const LayerPaintingInfo& p aintingInfo, const IntRect& rect);
471
468 void shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logi calLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues&) const; 472 void shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logi calLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues&) const;
469 473
470 bool skipContainingBlockForPercentHeightCalculation(const RenderBox* contain ingBlock) const; 474 bool skipContainingBlockForPercentHeightCalculation(const RenderBox* contain ingBlock) const;
471 475
472 LayoutUnit containingBlockLogicalWidthForPositioned(const RenderBoxModelObje ct* containingBlock) const; 476 LayoutUnit containingBlockLogicalWidthForPositioned(const RenderBoxModelObje ct* containingBlock) const;
473 LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObj ect* containingBlock) const; 477 LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObj ect* containingBlock) const;
474 478
475 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const; 479 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const;
476 void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBox ModelObject* containerBlock, TextDirection containerDirection, 480 void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBox ModelObject* containerBlock, TextDirection containerDirection,
477 LayoutUnit containerLogicalWidth, La youtUnit bordersPlusPadding, 481 LayoutUnit containerLogicalWidth, La youtUnit bordersPlusPadding,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 if (UNLIKELY(inlineBoxWrapper() != 0)) 571 if (UNLIKELY(inlineBoxWrapper() != 0))
568 deleteLineBoxWrapper(); 572 deleteLineBoxWrapper();
569 } 573 }
570 574
571 ensureRareData().m_inlineBoxWrapper = boxWrapper; 575 ensureRareData().m_inlineBoxWrapper = boxWrapper;
572 } 576 }
573 577
574 } // namespace blink 578 } // namespace blink
575 579
576 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ 580 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698